paulirish / lite-youtube-embed

A faster youtube embed.
https://paulirish.github.io/lite-youtube-embed/
Other
5.6k stars 259 forks source link

On mobile, double click is neccesary #149

Open bsastregx opened 1 year ago

bsastregx commented 1 year ago

Hello, Greetings!

I have imported lite-youtube-embed on a component I am working on with Lit Element. Everything is working fine, except that on mobile, I have to double click the play button to make the video work. Do you have any idea what might be the reason?

I have created a repo for this issue. Feel free to downoad and test:

https://github.com/bsastregx/video-lite-embed

Thanks in advance.

westonruter commented 1 year ago

Which mobile browser are you testing with?

Double-tapping is a notoriously difficult problem to fix. See https://github.com/paulirish/lite-youtube-embed/issues/6

paul-mckibben commented 11 months ago

I'm seeing the same thing, but only on iOS/Safari. No problem on desktop Safari, other desktop browsers, or Chrome on Android.

kj-ivy commented 6 months ago

Same issue here. Safari, Chrome and Firefox on iPad all require a double tap for me while all desktop browsers and all browsers on Android work fine.

amannn commented 6 months ago

The YouTube player embed disables autoplay on mobile on purpose. The way lite-youtube-embed works, is that it only displays the poster image initially and will lazy load the YouTube player embed when the user presses play. Unfortunately, on mobile the video will not autoplay when the real player has loaded, requiring another interaction.

It would be very helpful if the YouTube embed would provide a way to enable autoplay on mobile (/cc @paulirish).

4matic commented 5 months ago

What about using jsapi on mobile devices?

Garbee commented 5 months ago

It would be very helpful if the YouTube embed would provide a way to enable autoplay on mobile (/cc @paulirish).

I very much doubt they would. We need to be aware that there are still many parts of the world where data costs are high for people to consume content. If video autoplay from YT were enabled on mobile, those are the exact areas where the economic impact could end up being massive.

Imagine loading a blog post that explains something and embeds a video as a 2nd method of consumption. You just need the text but it auto-plays the video thinking it would be helpful. That one thing just started costing some people real money.

mikeott commented 4 months ago

I very much doubt they would. We need to be aware that there are still many parts of the world where data costs are high for people to consume content. If video autoplay from YT were enabled on mobile, those are the exact areas where the economic impact could end up being massive.

That's a very valid and important point. But in this instance, the discussion is about getting the video to autoplay on (IOS devices) when the user has already tapped the play button. When the button is clicked, that's intent, regardless of the users feelings toward bandwidth costs. @amannn didn't mean 'autoplay' to mean the video would autoplay without any interaction, he meant the video would autoplay when you tap the play button (really you could just say the video would play when you hit the button, but the parameter name is 'autoplay' - which in the context of lite-youtube-embed is admittedly a little misleading I know).

From a usability perspective it's no different to embedding a YouTube video in the traditional way, obviously except that would be worse due to the bloated scripts that method includes before you even play the video.

All that said, I too wish for the same functionality. I've tried several ways to make it work, none of them successful. It feels like we're just all doomed to standard bloated YouTube embeds for the best cross-platform compatibility :-(