Autoplay does not work upon videoId changes
See original GitHub issueDescribe the bug
If videoId is changed after the first render of YoutubePlayer, the video will not autoplay despite play prop being true
To Reproduce
https://snack.expo.dev/zeiphINXa
Steps to reproduce the behavior:
- Click
Toggle Render-> see that video is autoplayed. - Click
Switch video-> video is no longer played - Click
Toggle Rendertwice to unmount and remount component -> video is autoplayed
Expected behavior
Video should always be played or paused based on the play prop
I tested this on both Expo and bare React Native project.
Smartphone (Expo):
- Device: n/a
- OS + version: Android/iOS
react-native-youtube-iframeversion 11.6.2react-native-webviewversion ^2.1.1Expoversion 42.0.0
Smartphone (Bare):
- Device: Poco X3 Pro
- OS + version: Android 11
react-native-youtube-iframeversion 11.6.2react-native-webviewversion ^2.1.1Expoversion 42.0.0
Thank you.
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (7 by maintainers)
Top Results From Across the Web
Video auto play is not working in Safari and Chrome desktop ...
I had this issue in Safari 11 where a background video (no audio) wouldn't play automatically. Adding muted and autoplay did the trick....
Read more >Fix HTML Video Autoplay Not Working - PQINA
You've added a video tag to your website, set the video source, but it won't autoplay. Let's fix it.
Read more >How to Fix Windows 10 AutoPlay Not Working? – 6 Methods
Sometimes, Windows 10 AutoPlay may not work. How to fix windows 10 autoplay not working issue? This video offers 6 methods. Method 1....
Read more >Video issues (autoplay not working, video player looks different)
In this article Video autoplay handling Autoplay test Video slider and Slider autoplay Video doesn't look the way it should be Can't swipe ......
Read more >[Problem Solved!] Windows 10 AutoPlay Not Working - MiniTool
Open Control Panel. · Click AutoPlay. · Scroll down to the bottom of the AutoPlay settings interface and click the Reset all defaults...
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 Free
Top 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

@LonelyCpp I can confirm that the new version works! I will try to put together a PR some time soon for the discussed refactor though.
Thanks for the work!
@vishwadeepghimirezph this was published with v2.2.0
try it out and let me know