NoSleep.js icon indicating copy to clipboard operation
NoSleep.js copied to clipboard

Breaking media playback on WebOS

Open beshur opened this issue 5 years ago • 3 comments

  • 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?

  1. Install and run LG WebOS emulator, run builtin Browser.
  2. Set up a page with any HTML5 media and NoSleep.
  3. 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.

beshur avatar Sep 10 '19 10:09 beshur

For what it's worth, there is a webcomponent WakeLock repo here. Disclaimer: I am the author.

madeInLagny avatar Dec 01 '19 22:12 madeInLagny

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.

Noitidart avatar Oct 23 '22 18:10 Noitidart

@madeInLagny I don't think yours works, its not playing the video on load. It requires user interaction.

Noitidart avatar Oct 23 '22 18:10 Noitidart