Created
March 5, 2018 09:32
-
-
Save stanruss/b355c2a30f9af10aac2fb7722500ab5f to your computer and use it in GitHub Desktop.
stop play on youtube
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 href="http://www.youtube.com/embed/JMJXvsCLu6s" target="_blank" onclick="window.open(this.href, '', 'width='+screen.availWidth/2+',height='+screen.availHeight/2+',top='+screen.availHeight/4+',left='+screen.availWidth/4); return false;"> <i class="far fa-file-video white-text"></i> </a> | |
OR | |
<div id="play"></div> | |
<div id="playYoutube1">воспроизведение</div> | |
<div id="pauseYoutube1">пауза</div> | |
<script src="//www.youtube.com/player_api"></script> | |
<script> | |
var play; | |
function onYouTubePlayerAPIReady() { | |
play = new YT.Player('play', {videoId: 'JMJXvsCLu6s',}); | |
document.getElementById('playYoutube1').onclick = function() {play.playVideo();}; | |
document.getElementById('pauseYoutube1').onclick = function() {play.pauseVideo();}; | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment