-
Notifications
You must be signed in to change notification settings - Fork 31
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
Screen sleeps in android according to device settings while video is playing #143
Comments
Hi @pratik-yadav-cvent, you should be able to control this behavior in your application by using the FLAG_KEEP_SCREEN_ON flag. Hope this helps. |
Hi @maxstoller , I want this behaviour for a single screen in app not for the whole. Basically, i want to keep the screen awake in video playback mode. |
Hi @pratik-yadav-cvent would https://www.npmjs.com/package/@sayem314/react-native-keep-awake meet your needs? |
I've written some native code which I've got working in the latest version of React Native. These scripts exist under: android/app/src/main/java/com/APPNAME/keepawake
in MainApplication.java
We now need to enable the permissions for this in the
If you get any build errors, I did have to enable kotlin: To use this native module we can create a hook:
You can then use this hook whenever you use the IVSPlayer and then iOS and Android behaviour should match ! :) I hope you find this helpful. feel free to ask any questions. |
Ah it seems like that package does the same! |
Describe the bug
In Android screen gets locked during video playback if the device setting has the auto locked option enabled. If user don't do any interaction then it gets auto locked.
To reproduce
Just reduce the time auto screen lock time from device settings and play the video and wait for sometime it will get autolocked
Expected behavior
Screen should not get auto-locked while video is in play state
Device (please complete the following information):
The text was updated successfully, but these errors were encountered: