vue-lazy-youtube-video
vue-lazy-youtube-video copied to clipboard
autoplay not working on mobile
trafficstars
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:

After tap:

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, 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.