-
-
Save evgeny-ilyin/d2f8f3f2f0dd08b0d9cb2862e063cd16 to your computer and use it in GitHub Desktop.
Revisions
-
Chris Ferdinandi revised this gist
Jun 6, 2014 . 1 changed file with 6 additions and 2 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 @@ -1,11 +1,15 @@ /** * Stop an iframe or HTML5 <video> from playing * @param {Element} element The element that contains the video */ var stopVideo = function ( element ) { var iframe = element.querySelector( 'iframe'); var video = element.querySelector( 'video' ); if ( iframe ) { var iframeSrc = iframe.src; iframe.src = iframeSrc; } if ( video ) { video.pause(); } }; -
Chris Ferdinandi created this gist
Feb 17, 2014 .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,11 @@ var stopVideo = function ( element ) { var iframe = element.querySelector( 'iframe'); var video = element.querySelector( 'video' ); if ( iframe !== null ) { var iframeSrc = iframe.src; iframe.src = iframeSrc; } if ( video !== null ) { video.pause(); } };