Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YouTube player auto starts and pauses at the beginning even if autoplay is true. #38

Open
menismu opened this issue Apr 4, 2018 · 0 comments

Comments

@menismu
Copy link
Owner

menismu commented Apr 4, 2018

Issue reported: mozilla#430
Reported by: @stevemao

@stevemao
Contributor
stevemao commented on 21 Jan 2015
YouTube player auto plays and pauses at the beginning. I can understand if autoplay is false but if its true , there is an obvious glitch. This is more obvious on iPad.

Reading through the source in popcorn.HTMLYouTubeVideoElement.js It forces an initial play on the video and then pause. This causes the glitch. I modified the source so the video will not pause but still running fine. What's the intentions of the play, pause and play logic if autoplay is true or its a bug?

@stevemao stevemao changed the title from YouTube player auto starts and pause at the beginning. to YouTube player auto starts and pauses at the beginning even if autoplay is true. on 21 Jan 2015
@stevemao
Contributor
stevemao commented on 21 Jan 2015
Also if autoplay is false, I think it shouldn't force a play but instead defer all events and once the video starts to play, dispatch these events. This way user will not see the initial play and pause, and can still see the initial image on the video (if letting user see the image is one of the purposes of not playing it automatically).

@ScottDowne
Contributor
ScottDowne commented on 21 Jan 2015
That's to trigger a ready state and start buffering.

Otherwise it won't buffer until the user hits play, causing a wait.

@stevemao
Contributor
stevemao commented on 21 Jan 2015
Well, if autoplay is true this does not make too much difference (only one split second wait for buffering) but a glitch.

If autoplay is false I think it would be better to let dev choose if they want the video start buffering or not.

@ScottDowne
Contributor
ScottDowne commented on 22 Jan 2015
Maybe we can attach this functionality to preload?

Example, if preload is true, it goes through the existing play/pause hack to trigger buffering, if preload is false, it waits for user interaction before buffering?

The reason for the need to reduce the wait as much as possible, even if it is a split second, is to have wrappers sequenced together and seemingly play as one clip.

I never could get YouTube working well on ios, so it never was a priority.

Also might be possible to hide the video until a loadedmetadata event is fired, then display it, hiding the glitch.

@stevemao
Contributor
stevemao commented on 22 Jan 2015
I like the preload option. +1

I'm not sure how well it works to hide the glitch. Does it hide the sound as well? Will it cause a different kind of glitch? There are too much to test I think.

@ScottDowne
Contributor
ScottDowne commented on 22 Jan 2015
Yeah sound does get muted, but youtube has sync issues with their muted event and what actually happens when it is Flash.

Come to think of it, now that YouTube has HTML5 used in most cases, which performs much better than flash back when I first wrote this hack, that the delay might not be too bad.

It used to cause a delay of 2-3 seconds when it was only Flash.

Might be worth investigating removing the hack.

@stevemao
Contributor
stevemao commented on 22 Jan 2015
+1 Makes sense

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant