Youtube player autoplay doesn't work on init



5 years ago
4 years ago


(Reporter: arnaud, Unassigned)





5 years ago
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.65 Safari/537.31

Steps to reproduce:

Init a Popcorn player with a Youtube URL with the smart player.
Call autoplay with false flag.

Actual results:

Player loads and start playing the video

Expected results:

Player should load in pause state

Comment 1

5 years ago
The only workaround I've found so far is to listen to the "loadeddata" event and immediately pause the player.

player.on("loadeddata", function () {
Something may of broke, as we do take measures to ensure youtube does not autoplay.

I also believe we autoplay false by default.

What makes this hard is, youtube does not start loading until it receives a play, so we fake the play, then pause once it starts loading. Basically, we're forced to do what you're doing in your loadedmetadata event anyway. If autoplay is true, we simply do not pause after it is loaded.

Comment 3

5 years ago
I've gone step by step in the code and pauseVideo is call but at the beginning, after loading and it does not work for the reason you mentioned.

Fake play works, since the video starts immediately but it is not followed by a pause.

Comment 4

5 years ago

After looking for a solution again yesterday I've remark that this bug is only occurring with this particular video:

With all others videos I have tried it works fine.

I don't know what is wrong with this one but it autoplays even if you call pause (at loading only, after you can control its state without issue).
Hm, interesting.

I loaded that clip into popcorn maker:

Then saved it:

It seems fine on my end.
Scott to RESO WFM, so I'll do that for him.
Last Resolved: 4 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.