Skip to content

Update params during video playback #256

@andrea-daru

Description

@andrea-daru

Hi all,
Im using Moodle and I'm trying to customize the behaviour of H5P.InteractiveVideo to enable skipping after the video has been viewed at least once.
I'm developing a custom theme for Moodle and I'm able to attach JS and to catch "ended" event launched by the video player
but I cannot find documentation on how to interact with the InteractiveVideo library:

(function ($) {
    $(document).ready(function () {
        $('video.h5p-video').on('ended', function(){
            console.log("ended");
            $(this).preventSkipping = false;
        })
    })
})(H5P.jQuery);

This script is called every time the video reach the end of the video. Setting preventSkipping = false it does not cause anything.
This is the example I've used to alter H5P from my custom theme: h5pmods-moodle-plugin
Any help would be appreciated. Thank you in advance.
Andrea

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions