apache / apache/cordova-android
Video does not keep Android device awake when playing in full screen
- Dominant language
- JavaScript
- Stars
- 3.8k
- Forks
- 1.6k
- Avg merge
- 16h 18m
- Merged PRs (30d)
- 11
Description
# Bug Report
HTML5 videos fail to keep a device awake if playing in full screen
## Problem
### Command or Code
Rerpro:
1. Create a new Cordova project using `cordova create testVideo`
2. Add Android platform: `cordova platform add android`
3. Add this code to index.html, inside `body` tag:
```
```
4. Run project on physical device using `cordova run android`
5. Start playing video
6. Switch video to full screen
7. 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
Contributor guide
Research direction
Start by reproducing the behavior with the video markup in index.html on Android, following the reported order of starting playback and entering full screen. Compare it with entering full screen before playback and with windowed playback; done means the device remains awake while the full-screen video is playing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, javascript
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100