Created
January 10, 2013 01:56
-
-
Save MaxPower15/4498734 to your computer and use it in GitHub Desktop.
Pseudocode for pre-roll on playlist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wistiaPlaylist = Wistia.playlist("playlisthashedid", { | |
... the options generated by Wistia ... | |
}); | |
var savedSection, savedVideo; | |
wistiaPlaylist.bind("play", function() { | |
savedSection = wistiaPlaylist.currentSectionIndex(); | |
savedVideo = wistiaPlaylist.currentVideoIndex(); | |
wistiaPlaylist.remove(); | |
wistiaEmbed = Wistia.embed("prerollhashedid", { | |
... whatever options you want ... | |
container: "whatever_the_playlist_container_is" | |
}); | |
wistiaEmbed.bind("end", function() { | |
wistiaEmbed.remove(); | |
wistiaPlaylist = Wistia.playlist("playlisthashedid", { | |
... whatever the options were for the original playlist ... | |
startSection: savedSection, | |
startVideo: savedVideo | |
}); | |
}); | |
return this.unbind; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment