Dispatch even once video is completed using HTML/ Javascript

Forums: 
  1. How do we call dispatch event when the video is completed or fully watched using HTML/JAVASCRIPT?
  2. This is how we embed H5P video on our code.

<iframe src="https://to-ny.h5p.com/content/1291686223075947967/embed" aria-label="Greta and eight young activists reveal how the climate crisis is shaping their lives | UNICEF"

width="1088" height="637" frameborder="0" allowfullscreen="allowfullscreen"

allow="autoplay *; geolocation *; microphone *; camera *; midi *; encrypted-media *"></iframe>

<script src="https://to-ny.h5p.com/js/h5p-resizer.js" charset="UTF-8"></script>
Any guidance regarding it is appreciated!

Content types: 
otacke's picture

Hi!

When you are embedding content (from a different server), there's no way that you can access the iframe content directly for security reasons. That's not exclusive to H5P, but a general security feature of browsers. As a consequence, you cannot access the H5P events and xAPI events that might help you to achieve what you want. You could build yourself a proxy and would get access to the iframe contents, but then you'd run into trouble with other files needed not being served. If you really want to amend H5P's features, then you'd need to run it on your own server.

And then you need to address how you define "completed" or "fully watched". When a person has reached the end of the video? If really every second of the video has been viewed? Something else?

Best,
Oliver