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

Mobile only: click does not auto-play youtube video #30

Closed
wzzbzz opened this issue Jul 12, 2021 · 2 comments
Closed

Mobile only: click does not auto-play youtube video #30

wzzbzz opened this issue Jul 12, 2021 · 2 comments
Labels
duplicate This issue or pull request already exists

Comments

@wzzbzz
Copy link

wzzbzz commented Jul 12, 2021

Clicking play button causes Youtube video to load, but not play.

this occurs on cell phones, and in the Chrome emulators.

https://qat.btrtoday.com/read/featured/test-video-embed/

@justinribeiro justinribeiro added the duplicate This issue or pull request already exists label Jul 12, 2021
@justinribeiro
Copy link
Owner

This is an side effect of the autoplay policy on mobile which prevents the flag from automatically playing the video after the first tap. This component (or any component really) can't directly control this affect.

To reduce this, you can use the autoload attr which will trigger the intersection observer to inject+load, reducing the interaction to one tap.

Previously: #23

@wzzbzz
Copy link
Author

wzzbzz commented Jul 14, 2021

Thanks for this help - solved them mobile click issue.

However, now the video auto-plays on Desktop as soon as it scrolls into view. This becomes an issue when there are multiple posts. (see reference link).

https://www.btrtoday.com/read/featured/our-week-in-music-thirst-trap-live-pop-star-drama-exclusive-live-music/

I'll solve this by being smarter about applying the autoload attr, but I'm wondering if there's anything better

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants