question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

UNAUTHORIZED_OVERLAY Android bug

See original GitHub issue

Currently 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:open
  • Created 6 years ago
  • Reactions:28
  • Comments:131 (25 by maintainers)

github_iconTop GitHub Comments

45reactions
ben54260commented, Jun 12, 2017

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 }}

18reactions
LonelyCppcommented, Mar 1, 2020

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 😃

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found