Hi Folks,
i am using the background video element inside a div with a youtube video. Works fine. But i need to show the controls with a possibility to mute or unmute sound and see the timeline of the video. Any suggestions?
Cheers Ralf
1 reply · opened Aug 11, 2017
Hi Folks,
i am using the background video element inside a div with a youtube video. Works fine. But i need to show the controls with a possibility to mute or unmute sound and see the timeline of the video. Any suggestions?
Cheers Ralf
Hello,
Thanks for your Patience! Unfortunately, the youtube controls are currently not supported on the Background Video. However, you can consider adding a Play/Pause and Mute/Unmute Button on the Video.
Add the following HTML Code inside the .yt-bg-player Container:
[
](#)
[
](#)
[
](#)and then the following JS Code at the bottom of the Page:
jQuery('.yt-play-pause').on( 'click', function(){
var element = jQuery(this),
ytPlayer = element.parents('.yt-bg-player');
if( ytPlayer.YTPGetPlayer().getPlayerState() == 1 ){
ytPlayer.YTPPause();
element.addClass('class_name');
};
if( ytPlayer.YTPGetPlayer().getPlayerState() == 2 ){
ytPlayer.YTPPlay();
};
return false;
});
jQuery('.yt-mute').on( 'click', function(){
var element = jQuery(this),
ytPlayer = element.parents('.yt-bg-player');
ytPlayer.YTPMute();
});
jQuery('.yt-unmute').on( 'click', function(){
var element = jQuery(this),
ytPlayer = element.parents('.yt-bg-player');
ytPlayer.YTPUnmute();
});
This will definitely work fine. Hope this Helps!
Let us know if we can help you with anything else or if you find any further issues.
Have the same question, or something new?
Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.
Reply on the dashboard