cordova-android
cordova-android copied to clipboard
Video does not keep Android device awake when playing in full screen
Bug Report
HTML5 videos fail to keep a device awake if playing in full screen
Problem
Command or Code
Rerpro:
- Create a new Cordova project using
cordova create testVideo - Add Android platform:
cordova platform add android - Add this code to index.html, inside
bodytag:
<video controls width="300" src="https://d2zihajmogu5jn.cloudfront.net/big-buck-bunny/bbb.mp4"></video>
- Run project on physical device using
cordova run android - Start playing video
- Switch video to full screen
- Wait for some time
What is expected to happen?
Video should play keeping the device awake.
What does actually happen?
The screen goes dark after some time and then the device falls asleep (you can change display timeout in settings).
Information
If you do not switch to full screen the device stays awake as expected.
If you reverse steps 5 and 6 (switch to full screen first then start playing video) then the device stays awake as expected. 😕
Environment, Platform, Device
I tested on a tablet with Android version 9 and on a phone with Android version 8.
Version information
Cordova CLI: 11.1.0 Cordova Android Platform: 10.1.2
Checklist
- [x] I searched for existing GitHub issues
- [x] I updated all Cordova tooling to most recent version
- [x] I included all the necessary information above
@chuchuva Please assign it to me I'll work on it
@dcode333 Thank you! Unfortunately I don't have permissions to assign this issue to you but I believe you can still work on it and then submit a pull request, see Get involved in Open Source today - How to contribute a patch to a GitHub hosted Open Source project