Skip to content

Instantly share code, notes, and snippets.

@MaxPower15
Created January 10, 2013 01:56
Show Gist options
  • Save MaxPower15/4498734 to your computer and use it in GitHub Desktop.
Save MaxPower15/4498734 to your computer and use it in GitHub Desktop.
Pseudocode for pre-roll on playlist
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