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

Autoplay #66

Open
brmassa opened this issue Jul 8, 2022 · 1 comment
Open

Autoplay #66

brmassa opened this issue Jul 8, 2022 · 1 comment
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@brmassa
Copy link

brmassa commented Jul 8, 2022

I tried to add params="autoplay=1" to allow auto play (also autoload to start to play once it is on screen)

however, it does not work. It's because the plugin automatically includes autoplay=0 on all urls.

solution
either:
1* not include autoplay=0 on video url
2* flag this behaviour

@justinribeiro
Copy link
Owner

Autoplay is a double edged sword. The flag doesn't work on mobile (because the web platform long ago agreed that was a bad idea) and setting autoplay=1 usually just results in desktop working which confuses integrators of the component who want the behavior on both platforms. On the other edge of the sword, the component uses that flag to create some of the injector behavior so you end up with a fast and smooth experience when clicking play.

To autoplay on both platforms you have to use the JS API and do some work like in the https://github.com/justinribeiro/lite-youtube/blob/main/demo/bg-play.html example or via the the iframe postMessage ala 9af7a6f#diff-c2f0c4bb74f062c99d3589cb43e6820a4cfb7f8cad9432505b663c06132fb384R374-R379

I'll make a revision to the documentation that points this out in the interim, as I'll have to give this some thought in terms of something more turn key.

@justinribeiro justinribeiro added the documentation Improvements or additions to documentation label Jul 12, 2022
@justinribeiro justinribeiro self-assigned this Jul 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants