vue-lazy-youtube-video icon indicating copy to clipboard operation
vue-lazy-youtube-video copied to clipboard

autoplay not working on mobile

Open caweidmann opened this issue 5 years ago • 1 comments

Hi there

I'm trying to get autoplay to work on mobile, but haven't been successful. I've tried the following three approaches:

<YouTubeVideo
  :src="`https://www.youtube.com/embed/${video.id}`"
/>

<YouTubeVideo
  :iframeAttributes="{autoplay:true}"
  :src="`https://www.youtube.com/embed/${video.id}`"
/>

<YouTubeVideo
  :iframeAttributes="{autoplay:'autoplay'}"
  :src="`https://www.youtube.com/embed/${video.id}`"
/>

If you open the demo page on a phone you can replicate the issue.

Before tap: before

After tap: after

And then I have to tap again to get it playing. Not sure if this is something that can be solved by this plugin?

caweidmann avatar Apr 09 '20 20:04 caweidmann

@caweidmann, Thanks for creating the issue.

On mobile a video should be muted (pass &mute=1 via URL).

This SO question will definitely help you, since library allows you to pass any URL query params, as well as iframeAttributes.

To create YT.Player instance refer to #20.

andrewvasilchuk avatar Aug 15 '20 14:08 andrewvasilchuk