Im working on getting the video to mute after the first time it's played. I created the following code and placed it in a module. When published the video does not appear. I tested the code in JSFiddle
jsfiddle.net/kulikdesign/t24U2/298/
and it works there. I've tried the code in various places on the page but i think i'm missing something.
<script type="text/javascript">
var player;
function onYouTubeIframeAPIReady() {
player = new YT.Player('mbYTP_bgndVideo99', {
events: {'onStateChange': onPlayerStateChange }
});
}
function onPlayerStateChange(event) {
switch(event.data) {
case 0:
player.mute();
player.playVideo();
break;
}
}
</script>