Created
July 11, 2013 20:54
-
-
Save christopherhill/5979154 to your computer and use it in GitHub Desktop.
Wistia work in progress. Eventually will take the rel attribute of a link and display a fancybox popup.
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
/* wistiaJQuery(document).bind("wistia-popover", function(event, iframe) { | |
iframe.wistiaApi.time(30).play(); | |
iframe.wistiaApi.bind("end", function() { | |
alert("The video ended!"); | |
}); | |
}); */ | |
$(document).ready(function() { | |
$("a.fancybox").fancybox(); | |
$(".popup").on("click", function(e) { | |
e.preventDefault(); | |
// $.fancybox.close(); | |
var videoId = $(this).attr('rel'); | |
// var startTime = $(this).attr('startTime'); | |
var iFrameURL = "http://fast.wistia.net/embed/iframe/" + videoId + "?controlsVisibleOnLoad=false&plugin%5BpostRoll-v1%5D%5Blink%5D=http%3A%2F%2Finfo.appdynamics.com%2Ffreetrial.html%3Futm_source%3Dappdynamics%26utm_medium%3Dvideo%26utm_campaign%3Dpromotetrial%26utm_content%3Dedmunds.com%26utm_term%3D&plugin%5BpostRoll-v1%5D%5Bstyle%5D%5BbackgroundColor%5D=%23616161&plugin%5BpostRoll-v1%5D%5Bstyle%5D%5Bcolor%5D=%23ffffff&plugin%5BpostRoll-v1%5D%5Bstyle%5D%5BfontFamily%5D=Gill%20Sans%2C%20Helvetica%2C%20Arial%2C%20sans-serif&plugin%5BpostRoll-v1%5D%5Bstyle%5D%5BfontSize%5D=36px&plugin%5BpostRoll-v1%5D%5Btext%5D=Try%20AppDynamics%20for%20free%21%3Cbr%2F%3EGet%20a%20free%20trial%20of%20AppDynamics%20Pro&version=v1&videoHeight=360&videoWidth=640&wmode=transparent&volumeControl=true"; | |
// $(this).attr('href', iFrameURL); | |
console.log(iFrameURL); | |
$.fancybox.open({ | |
/* afterShow: function(startTime) { | |
$(".fancybox-iframe").attr('id', 'wistia_embed'); | |
$(".fancybox-iframe").addClass('wistia_embed'); | |
var wistiaEmbed = $(".fancybox-iframe")[0].wistiaApi; | |
console.log(wistiaEmbed); | |
wistiaEmbed.bind('play', function() { | |
wistiaEmbed.time(100); | |
return this.unbind; | |
}) | |
}, */ | |
type: 'iframe', | |
width: 620, | |
height: 320, | |
href: iFrameURL, | |
padding: 5 | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment