Support Online: Mon - Fri / 08:00am - 05:00pm (GMT +7)
Your Time: Our Time:

file Mute volume after video plays once

More
7 years 9 months ago #16326 by Comicbook Guy
Hi,

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>

Please Log in or Create an account to join the conversation.

More
7 years 9 months ago #16329 by NT
Hello,
Thanks for contacting us and choosing our product
Please send me your account your site via private message, I will check it for you
Thanks!

****************
Best Regards
__DiepNT__

Please Log in or Create an account to join the conversation.

Moderators: Jackie
Time to create page: 0.051 seconds
Powered by Kunena Forum