m90 / seeThru

HTML5 video with alpha channel transparencies

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Firing another function when first one ends.

kukagg opened this issue · comments

commented

Looked in the source and found out a solution. Thanks again for great plugin. Cheers!

UPD#1:
I had 15 videos I would like to fire after each other and on external calls. I made it simpler than m90 proposed. However his method is more efficient and follows best-practices along with chaining. My page is supposed to create an illusion of a human sitting in front while background is camera feed. The approach I needed is to change between videos whenever operator preferred. The reason is that we are going to use it as a demo of real-life use for online cloud queue service.

I solved my issue just looking into the source like any decent Luke would do.

Thanks to m90 for quick and described answer. Gotta thank you man!

Hi!

If I get you right you want to listen for the ended event of your video, right?

So if you want to chain a sequence of videos together you could just do:

$('.transparent-videos').seeThru({start : 'external'}); //make videos transparent but do not start playback

//start playback of first video and listen for its ended event
$('.transparent-videos').eq(0).seeThru('play').on('ended', function(){ // you could also use the DOM element's play-method, it would break the chain though

    //start playback of second video and listen for its ended event
    $('.transparent-videos').eq(1).seeThru('play').on('ended', function(){

        //start playback of third video
        $('.transparent-videos').eq(2).seeThru('play');

    });

});

See this page for reference on HTML5 Media Events.

Hi! Good to hear you found a solution, but could you roll back your issue body so it might be kept as reference for other people that might have the same problem? Thanks!