Programming/MFC-C++

youtube 재생시 음소거 설정하기

빠릿베짱이 2015. 8. 12. 10:31
반응형
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <title> New Document </title>
  <meta name="Generator" content="EditPlus">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
 </head>
<body>
<script>
var tag = document.createElement('script');

    tag.src = "https://www.youtube.com/iframe_api";
    var firstScriptTag = document.getElementsByTagName('script')[0];
    firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);

    var player;

    function onYouTubeIframeAPIReady() {
        player = new YT.Player('ytplayer', {
            events: {
                'onReady': onPlayerReady
            }
        });
    }

    function onPlayerReady() {
        player.playVideo();
        // Mute!
        player.mute();
    }
</script>

  <iframe id="ytplayer" width="1080" height="920" src="https://www.youtube.com/embed/uMJpLCmRweA?&html5-1&enablejsapi=1&autoplay=1" frameborder="0" allowfullscreen=""></iframe>

</body>
</html>


반응형