-
Notifications
You must be signed in to change notification settings - Fork 473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UNAUTHORIZED_OVERLAY Android bug #161
Comments
Same error using the branch v1. Just work when rotate the device. RN: 0.44.0 |
https://stackoverflow.com/questions/31638871/video-pausing-with-error-unauthorized-overlay the developer must look a solution for this in the above link |
Has anyone found a solution to this? The rotating works for me, but it's not necessarily what I'd call preferable. 😅 |
I gave up to be honest, tried to remove <WebView
style={props.style}
source={{uri: `https://www.youtube.com/embed/${props.videoId}?controls=0&showinfo=0`}}
/> I know it's not a proper solution, but at least works on both iOS and Android with RN 0.44.3. |
The problem with this issue seems to be the status bar. I'm using react-native-navigation that supposedly allows you to hide the SB but its not working. Anyone found any other solution yet? |
Ok I actually was able to hide the status bar using StatusBar from react-native, but the problem persists, still same error |
I think I might have found the reason for this error. I was running logcat and found this log that actually gave me a hint. So what I did was I just subtracted '2px' width from YouTube player and voila!!! Its working perfectly. I am actually using react-native-drawer and inLine mode was not working at all. |
@reyhaan Where you subtract the px? I tried directly in the styles and doesn't work. |
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.
|
I run the example app as it is now and that one works, then I upgraded to the latest RN version, without doing any other change and then it stops working throwing that error. How could the height be different only by changing RN version? Also I did a logcat and for me this is the error I'm getting
I removed all the components from EDIT: Now I get a similar error if I don't change the height onReady
|
Thank you @ben54260 ! This solved the problem, the videos are loading as expected and can toggle fullscreen with no issues. Strange why we need to do this, Android Youtube is a diva. Closing |
@abbasfreestyle The Android module really is pretty sensitive |
@abbasfreestyle How's this solved? I just tried what @ben54260 said in the example project running on RN 0.45 and I still have the same issue. Did you change anything else other than that? What version of RN are you using? Have you tried running the example? |
@tafelito can you try making those value 1 i.e. top:1, bottom: 1, right:1, left: 1 ? I am just guessing though! |
@reyhaan Same thing. It gives the error
Not sure why it complains about a ReactTextView, cause I removed any extra view other than the YouTube player |
Ok I found the issue. On the YouTube.android.js there is a TextView. I removed it and now it's working. Seems like that is not needed anymore, unless I'm missing anything |
According to youtube SDK website:
This rule make me crazy, too. =( |
@tafelito There seems to be some change that cause a bug in Android on RN > 0.44 |
thanks @davidohayon669 that would be great! |
@davidohayon669 did you manage to push it already? It's kinda killing purpose of the app I'm creating at the moment 😛 |
@davidohayon669 - unfortunately, problem persists.
|
@DeviousM are you sure it isn't covered in any way? what do you get when you try the example in this repo? |
@davidohayon669 I've been following this issue as it unfolds and also am having the same trouble. Project is using nativebase layouts (Container as a main wrapper for each component). Video loads up fine and plays for half a second then immediately stops with the overlay error. Also i have installed and relinked the latest version (alpha 6) and am on RN v44). Project is also using react-native-router-flux with a drawer component but I wouldn't imagine that causing any issues. This problem persists on both emulator && physical device
code
Edit1: trying a bunch of different configurations and it seems like it's got something to do with a view much higher up in the tree. RCTView is super fucky with it |
@chrissbendel - I have exactly the same issue. Also using the NativeBase & react-native-router-flux & drawer component. Don't know if it has anything to do with it. |
This solved is working for me. |
I confirm that by removing the createDrawerNavigator it works. Any idea on how to solve it? My application needs a Drawer |
For those who are using Wix/React Native Navigation, it had been fixed by version 6.7.5. Please see here for details wix/react-native-navigation#6220
|
I have tip! I think I maybe found a solution with react-native-navigation. If you are using stack navigation, you can't render react-native-youtube bellow active screen in stack, because active screen is above others and it overlays video. It is very strange issue, because active screen is not covered by anything, but it seems like if one of player is covered none of them works. Now I am rendering only one video at the same time and it works. |
Bottom tab navigation update. If you mount (focus) tab after tab with video, the video is getting this error. All tabs are rendered and they cover each other somehow. |
Woow. still no solution for this old issue???????? |
Same here with React Navigation v5 :( |
Could you a explain in details ? |
used the same implementation as @saravanakumargn and it also work perfect for me. |
a solution which worked for me was adding position:"absolute" style on the Youtube's parent View |
If the player is placed in Higher up in the component tree and outside of the navigation, then the problem doesn't appear. |
HOW? |
Sorry for the late reply.
I placed youtube outside tabbar and drawer navigation.
I hide tabbar on that screen so it's solved my Problem.
…On Sat, Dec 26, 2020, 11:21 AM RajeshKumar Nasit ***@***.***> wrote:
If the player is placed in Higher up in the component tree and outside of
the navigation, then the problem doesn't appear.
HOW?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#161 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AI6XECDMALLWG4QZI5E432LSWV2VPANCNFSM4DMU4IXA>
.
|
Please try with this code. I am sure you will get success with this. |
I am having this issue when I am playing the video either full screen or not, whenever I pull the notifications down when the video is playing the video crashes. It is only observed on physical devices. On emulators it does not crash. Any ideas why? |
With me the problem was happening and I could only fix it when instead of calling a drawer screen, I called a stack with youtube on it. I think the overlay gets from the drawer... |
Hmmm... I am running the video on a global modal on top of a stack navigator. I do not have a drawer navigation on my app, and still having the video crash whenever the user pulls the notifications down only on physical devices. |
what did you mean |
UI Youtube on android here |
|
Adjusting position or height didn't work for me in the following version Finally what worked was, created a new route in the outermost stack in a switchNavigator, then navigated to there. The only downside now is that I need to manually handle the hardware back button to go back to the route it came from. If not, since it is the outermost route in navigation, the app exits.
|
Just in case anyone is still facing this issue. I ended up using react-native-portal to place the player outside of the react-navigation. This fixed the issue at least for me. |
Wow! Didn't know a thing as portal existed. Will try implementing this once again. Thanks for the comment |
it is truely an overlapping issue setting height properly will do the job.
|
I've solved this problem by disabling Reactotron - it creates overlay upon the app view |
Previously, I faced same issues. |
I've solved this problem by removing ViewPropTypes from the package file located in "node_modules/react-native-youtube/YouTube.android.js" . it Works for me.
|
It just works beautifully for me. After Portal implementation, you kind of "teleport" the player to where you set your , which must be at the highest level of your application so Youtube does not throw the Overlay error by effectively not having any View over the player anymore. The only issue is that I need to correct the player position once it gets above all the content, this is a minor adjustment though. Thank you very much @aimensasi 🤘 |
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.
Any solutions?
The text was updated successfully, but these errors were encountered: