UNAUTHORIZED_OVERLAY Android bug
See original GitHub issueCurrently experiencing this issue on Android. iOS is working fine.
Running: react native: 0.44 react-native-youtube: 1.0.0-alpha-4 Device: Galaxy Note 5 (real device)
I always get UNAUTHORIZED_OVERLAY error when playing the video inline, it just shows a black screen, no controls whatsoever. If the video starts as fullscreen it works perfectly fine, as soon as it goes inline it complains.
I’ve used previous version on RN 0.39 and it all works fine, my coding appears to be fine too. It seems to be a bug with RN 0.44.
<YouTube videoId={videoId} play={true}
fullscreen={false} loop={false}
controls={1}
onReady={(e)=>{this.setState({ready:true})}}
apiKey={apiKey}
style={{width:300, height:150}}
onError={(e) => {this.YTerror(e)}}
/>
Any solutions?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:28
- Comments:131 (25 by maintainers)
Top Results From Across the Web
Video pausing with error "Unauthorized overlay"
YouTube video playback stopped due to unauthorized overlay on top of player. The YouTubePlayerView is obscured by android.view.View{16771a9d V.ED.
Read more >How to Fix Screen Overlay Error on Android 2019 - YouTube
Experiencing annoying “screen overlay ” errors on your Android device? Watch this video to learn how to fix Android screen overlay errors.
Read more >How To Solve Screen Overlay Problem : r/Android - Reddit
My first suspect were screen filter apps too. So, I killed cf.lumen. And I still had the issue. So, I started disabling "Draw...
Read more >Android – Video pausing with error “Unauthorized overlay” – iTecNote
Android – Video pausing with error “Unauthorized overlay” ... I am getting following error while playing video in fullscreen mode (only in fullscreen)....
Read more >Android Player API: Videos stopping because of overlay that ...
Issue summary: I have an activity that consists of a RecyclerView of videos. I select one which opens a new activity with a...
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
I discover that Youtube view will show when change the orientation of screen, and no need to set fullscreen nor play.
So I solved this problem by change a bit of the height in the styles after onReady event be triggered. (initial height is 301)
onReady={e => this.setState({ height: 300 })}
style={{ alignSelf: 'stretch', height: this.state.height, backgroundColor: 'black', marginVertical: 10 }}
The native youtube player has several constraints like this, and is too restrictive. One of the solutions seems to be to use webviews in app. More reasons why its not very reliable - https://github.com/PierfrancescoSoffritti/Android-YouTube-Player#why-does-this-library-exist
I’ve written a simple wrapper around the webplayer with react-native-webview. You can check it out https://github.com/LonelyCpp/react-native-youtube-iframe 😃