Last active
June 17, 2018 20:59
Revisions
-
jessedc revised this gist
Apr 10, 2013 . 1 changed file with 16 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ <html> <head></head> <body> <!-- NOTE: ?api=1 and player_id at the end of the URL --> <iframe id="player" width="" height="" src="http://player.vimeo.com/video/62207569?api=1&player_id=player" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe> <script src="http://a.vimeocdn.com/js/froogaloop2.min.js"></script> <script> var player = $f(document.getElementById('player')); player.addEvent('ready', function() { player.api('play'); }); </script> </body> </html> -
jessedc revised this gist
Apr 9, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -27,7 +27,7 @@ //finds the 'play' button within the Vimeo iframe function iFrameButton() { //window.frames[0].document.getElementsByTagName('div')[1]; // this also works return window.frames[0].document.getElementsByTagName('button')[5]; } //simple boolean condition to check for the iframe button -
jessedc created this gist
Apr 9, 2013 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,45 @@ <html> <head></head> <body> <iframe width="" height="" src="http://player.vimeo.com/video/62207569 " frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe> <script> //NOTE: Jesse Collis github.com/jessedc - this works as of it's last updated date. YMMV // Add a listener for the window's load event window.addEventListener('load', onWindowLoad, false); function onWindowLoad(event) { //use a loop to continue checking the vimeo iframe for the 'play' button checkForTrue(isIframeButtonLoaded, iFrameButtonLoaded); } function checkForTrue(func, callback) { setTimeout(function() { if (func()) { callback( iFrameButton() ); } else { checkForTrue(func, callback); }; }, 1000); } //finds the 'play' button within the Vimeo iframe function iFrameButton() { //window.frames[0].document.getElementsByTagName('div')[1]; // this also works return window.frames[0].document.getElementsByTagName('div')[1];//window.frames[0].document.getElementsByTagName('button')[5]; } //simple boolean condition to check for the iframe button function isIframeButtonLoaded() { return ( iFrameButton() != null ); } //once the button is loaded, click it function iFrameButtonLoaded(iFrameButton) { iFrameButton.click(); } </script> </body> </html>