Embed Youtube video autoplay not working
See original GitHub issueBug description: Youtube embedded player not working correctly in webview. Autoplay not working.
To Reproduce:
<WebView
mediaPlaybackRequiresUserAction={false}
allowsInlineMediaPlayback={true}
// this prop makes autoplay right after loaded but its not allow go fullscreen since its embed for pc web not mobile if i understand it correctly
//userAgent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36"
source={{
uri: `https://www.youtube.com/embed/${video.id}?autoplay=1&modestbranding=1&playsinline=1`,
}}
/>
Expected behavior: Autoplay right after video loaded in webview.
Screenshots/Videos:
Example with prop userAgent
: https://streamable.com/w43awn
Example with expected behaviour but autoplay not working: https://streamable.com/qq57kj
Environment:
- OS: iOS
- OS version: 14.2
- react-native version: 0.63.2
- react-native-webview version:^11.0.0
Issue Analytics
- State:
- Created 3 years ago
- Comments:6
Top Results From Across the Web
YouTube Autoplay does not work with iFrame
When you load the page Youtube need to search the video with you "list" parameter, then take the first video of you playlist...
Read more >Autoplay not working on Embedded YouTube Video - YouTube
Are you trying to embed a youtube video in a web page and have it autoplay but its not working ? YouTube recently...
Read more >Why does my YouTube video not autoplay?
First thing's first, make sure that autoplay is enabled when you're watching a video. This is simple enough to do, as the autoplay...
Read more >YouTube AutoPlay Not Working | 8 Quick Fixes
YouTube AutoPlay Not Working; Fix 1: Enable the YouTube AutoPlay Feature; Fix 2: Clear the Cache and Data of the Browser; Fix 3:...
Read more >Best Ways to Fix YouTube Autoplay Not Working
1. Toggle on/off AutoPlay & Log out Your YouTube Account · Launch the web browser and open the YouTube website. · Open any...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Is there a user agent that fixes both issues?
Also if you don’t need fullscreen (of course it’d be nice to have…) you can disable the button by passing
&fs=0
into the webview URL.Edit: Instead of passing
{ uri }
tosource
, pass in{ html }
and within your HTML use the JavaScript Iframe API to build your video player.HI, I’m facing same issue any help?