pupunzi / jquery.mb.YTPlayer

use a custom yutube player for a video as background on jQuery framework
https://pupunzi.com/mb.components/mb.YTPlayer/demo/demo.html
1.3k stars 431 forks source link

Player mutes the video by default ignoring 'mute:false' parameter #359

Closed kumfc closed 6 years ago

kumfc commented 6 years ago

The problem was described in the title. It started to happen after some of the recent updates. Calling jQuery("#bgv").YTPUnmute(); after loading the player is fixing the problem, but thats not the proper solution because this is working only after page reload.

kumfc commented 6 years ago

As i can see, this is related to the new Chrome autoplay policy. Any possible bypass?

pupunzi commented 6 years ago

Hi, It is not a bug. With the latest Youtube policy the video can auto play only if muted. At the time this is applied only by Webkit browsers but soon by all.

You can restore the previous behavior commenting from line 353:

        /**
         * If autoPlay is set to true the mute must be true 
         * as required by the latest Youtube policy
         */
        if(YTPlayer.opt.autoPlay)
          YTPlayer.opt.mute = true;

All the best, Matteo

kumfc commented 6 years ago

Thanks for your answer, already decided to force users to press on the button before loading other page content.