NoSleep.js
NoSleep.js copied to clipboard
Breaking media playback on WebOS
- Device Name: WebOS emulator v3.0.0 / some LG smart TVs
- Device Version: 3.0.0
- Browser Name: WebOS Browser / SmartTV
- Browser Version: 6
- NoSleep.js Version: f7a6122f5d6700f18a68bff2c4114b81fdf6fa55 [ViRPo:master]
Expected Behavior
Media Playback is not disabled.
Actual Behavior
Cannot start HTML5 audio playback.
How Do We Reproduce?
- Install and run LG WebOS emulator, run builtin Browser.
- Set up a page with any HTML5 media and NoSleep.
- Enable NoSleep and after that try playing the media.
I think there is an issue related to the number of media streams enabled in LG WebOS browser. So far I tried disabling NoSleep and the media playback worked there. I don't think the issue is fixable in the scope of this library, but putting it here for reference. If anyone has a workaround for it, that would be great.
For what it's worth, there is a webcomponent WakeLock repo here. Disclaimer: I am the author.
Thanks for creating this topic as reference. I am also using a LG TV and disabled energy saver settings and timer, but after 45 minutes the screensaver comes on.
I was testing and it seems that the navigator.wakeLock.request('screen')
just hangs. It doesn't throw.
I then tried playing the video always (not just if wakeLock
not available), but I'm not sure if I'm doing things correct, it seems to have improved that the screensaver comes on. However my page page needs to reload every hour. And after the reload, within a couple minutes, the screen turned black. Pressing any button the remote woke it.
I'm still researching it, would be awesome to hear if anyone else comes up with a solution.
@madeInLagny did you verify if your method works on LG browser? I'll try to use it now.
@madeInLagny I don't think yours works, its not playing the video on load. It requires user interaction.