Youtube player autoplay doesn't work on init

RESOLVED WORKSFORME

Status

Webmaker
popcorn.js
RESOLVED WORKSFORME
5 years ago
4 years ago

People

(Reporter: arnaud, Unassigned)

Tracking

Details

(Reporter)

Description

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
(Reporter)

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 () {
    player.pause();
});
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.
(Reporter)

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.
(Reporter)

Comment 4

5 years ago
Hi,

After looking for a solution again yesterday I've remark that this bug is only occurring with this particular video: www.youtube.com/watch?v=zDZFcDGpL4U

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: https://popcorn.webmaker.org/templates/basic/

Then saved it: http://popcorn.webmadecontent.org/zcl?preview=true

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