• Resolved dmontandon

    (@dmontandon)


    Hi,

    I’m having a problem with h5p, gamipress and the integration plugin. In fact, I want to award the users based on if they watch the interactive video until the end.

    I sent a message to the integration plugin (between gamipress and h5p) and they said they can’t do anything and suggest to publish a message here.

    Is there a possibility to have a hook (or event, don’t know what is it exactly) when the user watch the entire interactive video. Because for now the integration plugin only offer the possibility to award people when they complete an activity.

    I hope I’m clear enough in my explication…

    Have a nice day,
    Best regards

Viewing 1 replies (of 1 total)
  • Plugin Author icc0rz

    (@icc0rz)

    Unfortunately, there is no built-in functionality for this – you have to add an end-screen with a submit button to get the user to confirm that he/she is finished watching it.
    This is because it isn’t easy to define what counts as having watched an entire video. Sure you could add a simple event when the playback ends but you don’t really know if the user has been watching all the way. Also, many users typically leave or close the video before the very last second of the video. Sure you could make some sort of tracker to ensure that at least 80% of the video is watched, but that is a lot of work. Also, you have to consider if you want your web page to be accessible and WCAG compliant – where you are required to have a clear user action for submitting and using data like this (or at least something along those lines, please see the actual succession criteria).

    Anyway, if you only want the ‘ended’ event you can add a JavaScript via a custom theme or plugin and listen for it and then award the badge. The script would look something like this:
    document.getElementsByClassName('h5p-iframe')[0].contentWindow.H5P.instances[0].video.on('stateChange', function (e) { if (e.data === 0) console.log('ENDED'); });

    But you probably will have to make it crystal clear to the users that they have to watch the video to the very last second to get the badge.

Viewing 1 replies (of 1 total)
  • The topic ‘Interactive video hook with Gamipress’ is closed to new replies.