Return to Snippet

Revision: 47385
at June 7, 2011 10:02 by whak


Initial Code
<script src="http://www.google.com/jsapi"></script>
<script src="http://ajax.googleapis.com/ajax/libs/swfobject/2.1/swfobject.js"></script>
<div id="ytapiplayer">You need Flash player 8+ and JavaScript enabled to view this video.</div>
<script type="text/javascript">
    google.load("swfobject", "2.1");
    function onYouTubePlayerReady(playerId) {
        ytplayer = document.getElementById("myytplayer");
        ytplayer.playVideo();
        ytplayer.mute();
    }
    var params = { allowScriptAccess: "always" };
    var atts = { id: "myytplayer" };
    swfobject.embedSWF("http://www.youtube.com/v/J2hqhNhAj_g?enablejsapi=1&playerapiid=ytplayer&allowFullScreen=true&version=3",
    "ytapiplayer", "425", "356", "8", null, null, params, atts);
</script>

Initial URL
http://www.faisalkaleem.com/api/how-to-autoplay-a-youtube-video-in-mute-using-js-api.html

Initial Description

                                

Initial Title
Youtube Video w/ Javascript API - Autoplay & Muted

Initial Tags
javascript

Initial Language
JavaScript