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
# | |
# myObject = new MyObject(); | |
# myObject.ready = readyMixin; | |
# myObject.asyncInit(function(){ myObject.ready(true); }); | |
# | |
# myObject.ready(function() { | |
# console.log("I'm ready now!"); | |
# }); | |
# | |
# myObject.ready(function() { |
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
var lastT = 0; | |
var downT = 0; | |
var lastState = "unknown"; | |
wistiaEmbed.bind("timechange", function(t) { | |
lastT = t; | |
}); | |
wistiaEmbed.bind("down", function() { |
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
<div id="wistia_1d35830d05" class="wistia_embed" style="width:947px;height:360px;" data-video-width="640" data-video-height="360"> </div> | |
<script charset="ISO-8859-1" src="http://fast.wistia.com/static/concat/E-v1%2Cplaylist-v1%2Cplaylist-v1-bento%2CrequireEmail-v1.js"></script> | |
<script> | |
wistiaPlaylist = Wistia.playlist("1d35830d05", { | |
version: "v1", | |
theme: "bento", | |
videoOptions: { | |
autoPlay: true, | |
videoWidth: 640, | |
videoHeight: 360 |
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
<!-- | |
Steps to do A/B testing. | |
1. Pick any number of videos in your Wistia account. If they're in the same project, you can compare them in the Project View. | |
2. Get the hashed ID for each of them (this is the alphanumeric code after /medias/ in the URL bar). | |
3. Go into the Embed Builder for one of the videos, and grab an API embed code. | |
4. Change the id attribute in the API embed code to something legible. I renamed it to "thumbnail_test" below. | |
5. Add a `container` option to the embed code and specify your ID. | |
5. Modify the embed code to use a different hashed ID based on whatever conditions you want. | |
The code below chooses one hashed ID if they've come from an email (wemail is in the URL), and one of two others if not. |
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
Valid HTML4 Transitional Doctype: | |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | |
Valid HTML5 Doctype: | |
<!DOCTYPE html> |
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
<a id="my_popover" href="http://fast.wistia.com/embed/iframe/fcf31a497a?autoPlay=true&controlsVisibleOnLoad=true&playerColor=81c2f0&popover=true&version=v1&videoHeight=360&videoWidth=640" class="wistia-popover[height=360,playerColor=81c2f0,width=640]"><img src="http://embed.wistia.com/deliveries/e45e6fd93899ef7abbbd0d1dc643e99e8d2f84d7.jpg?image_play_button=true&image_play_button_color=4991C4e0&image_crop_resized=150x84" alt="" /></a><script charset="ISO-8859-1" src="http://fast.wistia.com/static/popover-v1.js"></script> | |
<script> | |
wistiaJQuery("#my_popover").click(); | |
</script> |
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
<!-- A default Wistia embed code, plus the 'container' attribute so we can have multiples of the same video on the page. --> | |
<div id="wistia_4d8229898d_1" class="wistia_embed" style="width:640px;height:360px;" data-video-width="640" data-video-height="360"> </div> | |
<script charset="ISO-8859-1" src="http://fast.wistia.com/static/concat/E-v1.js"></script> | |
<script> | |
wistiaEmbed1 = Wistia.embed("4d8229898d", { | |
version: "v1", | |
videoWidth: 640, | |
videoHeight: 360, | |
container: "wistia_4d8229898d_1" | |
}); |
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 ... |
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
<div id="wistia_036h4wlrgo" class="wistia_embed" style="width:500px;height:281px;" data-video-width="500" data-video-height="281"> </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 |
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
(function($) { | |
var deNthWordize, mode, nthWordize; | |
nthWordize = function(el) { | |
var $escaper, $this, $tns, textNode, textNodes, _i, _len; | |
$this = $(el); | |
textNodes = $this.find(":not(iframe)").andSelf().contents().filter(function() { | |
return this.nodeType === 3; | |
}); | |
for (_i = 0, _len = textNodes.length; _i < _len; _i++) { | |
textNode = textNodes[_i]; |