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

auto play not working #465

Closed ghopretz closed 3 years ago

ghopretz commented 4 years ago

when i change video id using: player.YTPChangeMovie({videoURL: id, autoPlay: true, mute: false, vol: 100}); auto play not working. player event always stuck at YTPUnstarted .

pupunzi commented 4 years ago

The autoplay can work only if the audio is nìmuted due to the latest browser's legacy. Try setting the mute setting to true.

ghopretz commented 4 years ago

I have try to mute setting to true, but auto play still not working. player event still stuck at YTPUnstarted.

When i try to insert player.YTPPlay(); in:

        player.on("YTPUnstarted", function(e){
            console.log("YTPUnstarted " + sjudul);
            try{
                player.YTPPlay();
                console.log("TRY TO PLAY VIDEO FROM UNSTARTED");
            }catch(e){
                console.log("Error play " + e);
            }
        });

the player still not auto playing