Skip to content

Instantly share code, notes, and snippets.

@MaxPower15
Forked from potcherboy/gist:4503147
Last active December 10, 2015 22:59
Show Gist options
  • Save MaxPower15/4506566 to your computer and use it in GitHub Desktop.
Save MaxPower15/4506566 to your computer and use it in GitHub Desktop.
<div id="wistia_036h4wlrgo" class="wistia_embed" style="width:500px;height:281px;" data-video-width="500" data-video-height="281">&nbsp;</div>
<script charset="ISO-8859-1" src="http://fast.wistia.net/static/concat/E-v1%2Cplaylist-v1.js"></script>
<script>
wistiaPlaylist = Wistia.playlist("036h4wlrgo", {
version: "v1",
videoOptions: {
volumeControl: true,
autoPlay: true,
videoWidth: 500,
videoHeight: 281
},
media_0_0: {
autoPlay: false,
controlsVisibleOnLoad: false
}
});
var savedSection, savedVideo;
wistiaPlaylist.bind("play", function() {
savedSection = wistiaPlaylist.currentSectionIndex();
savedVideo = wistiaPlaylist.currentVideoIndex();
wistiaPlaylist.remove();
wistiaEmbed = Wistia.embed("1p1ceiavf9", {
version: "v1",
videoWidth: 500,
videoHeight: 281,
controlsVisibleOnLoad: false,
container: "wistia_036h4wlrgo",
autoPlay: true
});
wistiaEmbed.bind("end", function() {
wistiaEmbed.remove();
wistiaPlaylist = Wistia.playlist("036h4wlrgo", {
version: "v1",
videoOptions: {
volumeControl: true,
autoPlay: true,
videoWidth: 500,
videoHeight: 281
},
media_0_0: {
autoPlay: false,
controlsVisibleOnLoad: false
},
startSection: savedSection,
startVideo: savedVideo
});
wistiaPlaylist.play();
});
return this.unbind;
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment