webOS 25: Widevine MediaKeySession.closed never resolves; after ~170 channel changes, MediaSource never fires 'sourceopen' until the app is restarted

Title: webOS 25: Widevine MediaKeySession.closed never resolves; after ~170 channel changes, MediaSource never fires ‘sourceopen’ until the app is restarted

Summary

In our live-TV web app (MSE + EME, Widevine, DASH), webOS 25 never resolves MediaKeySession.closed after close(). Every channel change leaves an unreleased Widevine session. After roughly 170 channel changes (~10 minutes of zapping), the TV stops opening new streams: a newly attached MediaSource never fires sourceopen, with no error. A page reload does not recover; only exiting and relaunching the app does. The same app on webOS 22 resolves closed for every session and rarely shows the problem.

Environment

Affected Comparison (works)
TV model [model] [model]
Firmware [firmware] [firmware]
Web engine (UA) Chrome/120.0.6099.270 (webOS 25) Chrome/87.0.4280.88 (webOS 22)
  • App: “TV by e&” (ae.etisalat.eand.com), packaged web app
  • Player: Shaka Player 4.16.9 (also reproduced with 4.16.52)
  • MSE + EME, com.widevine.alpha, temporary sessions, DASH live
  • Tested with Widevine video robustness SW_SECURE_DECODE (default) and HW_SECURE_ALL: same result

Steps to reproduce

  1. Play a Widevine-protected DASH live stream through MSE/EME.
  2. Change channel repeatedly (one change every ~2–4 s). Each change: MediaKeySession.close() on the old session → video.setMediaKeys(null) → detach the old MediaSource (remove <source>, video.load()) → createMediaKeys() → attach a new MediaSource to the same <video> → setMediaKeys() → generateRequest().
  3. Watch MediaKeySession.closed (snippet below), and continue for ~10 minutes.

Observed

  1. close() resolves within milliseconds, but MediaKeySession.closed never resolves: 0 of 37 sessions across three runs, observed for minutes.
  2. MediaKeySession.remove() before close() rejects with InvalidStateError (14 of 14).
  3. After ~170 channel changes, a new MediaSource attached to the <video> never fires sourceopen. video.readyState = 0, networkState = 2, no error event, no network activity. It stays like this indefinitely.
  4. In that state, nothing inside the app recovers playback: a new player with a new MediaSource on the same <video> does not open, and location.reload() does not help. Only exiting the app and relaunching it restores playback.

Timeline of the change that got stuck (ms since app start):

+576944  load of next channel starts
+576948  MediaKeySession.close() called
+576960  close() resolved (12 ms)        -> session.closed never resolves
+577949  setMediaKeys(null) resolved     (player gave up waiting for session.closed after 1 s)
+578074  new MediaSource attached
+578108  createMediaKeys() resolved (32 ms)
         ... 'sourceopen' never fires (still waiting at +587086 and beyond)

Expected

Per the EME spec, MediaKeySession.closed should resolve once the session is closed and its resources are released, and a newly attached MediaSource should open.

Comparison: same app, same code, same streams

MediaKeySession.closed resolved Freeze
webOS 22 (Chrome 87) 8 of 8, in 20–2415 ms rare
webOS 25 (Chrome 120) 0 of 37 after ~170 channel changes
Samsung Tizen n/a never

Diagnostic snippet used

var unclosed = 0, close = MediaKeySession.prototype.close;
MediaKeySession.prototype.close = function () {
    var start = Date.now(); unclosed++;
    console.warn("close() called, unclosed=" + unclosed);
    this.closed.then(function () {
        unclosed--;
        console.warn("closed resolved after " + (Date.now() - start) + "ms, unclosed=" + unclosed);
    });
    return close.apply(this, arguments);
};

On webOS 25 only the “close() called” lines appear, and unclosed keeps increasing.

Questions

  1. Is this a known issue in the webOS 25 Widevine CDM or media pipeline? Is a firmware fix available or planned?
  2. Is there a supported way on webOS 25 to make sure a Widevine session and its resources are released, other than close()?
  3. Is there a limit on unreleased DRM sessions or media pipelines per app that would explain sourceopen never firing after ~170 channel changes?

We can provide full logs and a test build on request.

webOS TV uses different web engines depending on the webOS version. Please check compatibility with the web engine first. And we support HTML5 MSE/EME, not DASH. (See Streaming Protocol and DRM.)
If your player supports DASH, you can use DASH. But this means that DASH is processed by the player, not webOS TV. Therefore, in most cases, we cannot help you. Please contact Shaka Player support.
Thank you.

Hello,

Thank you for your reply. This issue is not about DASH or the player. It is in the EME API, which webOS 25 supports: after MediaKeySession.close(), the MediaKeySession.closed promise never resolves.

We checked engine compatibility. webOS 25 uses Chrome 120, which supports MediaKeySession.closed as a standard EME feature. The same calls work on webOS 22 (Chrome 87).

To take the player and DASH out of the picture, we attached a small test app (com.etisalat.emeclosetest_1.0.0_all.ipk; the source is index.html inside it). It plays no stream, loads no library and needs no licence server. It only calls the EME API, 20 times in a row:

requestMediaKeySystemAccess("com.widevine.alpha") → createMediaKeys() → video.setMediaKeys(keys) → createSession("temporary") → generateRequest("cenc", …) → close() → wait 5 s for session.closed → video.setMediaKeys(null)

Results with the same test app:

  • webOS 25 (OLED55C46LA, firmware 33.31.68, Chrome 120.0.6099.270): close() resolves in 4–10 ms, but session.closed resolved 0 of 20.
  • webOS 22 (50NANO846QA, firmware 04.60.91, Chrome 87.0.4280.88): session.closed resolved 20 of 20, in 1–50 ms.

Under the EME specification, closed resolves once the session has closed. On webOS 25 it never does, so the sessions are never released. In our app, after many channel changes, the TV then stops opening new MediaSource objects (sourceopen never fires) until the app is restarted.

Could you please forward this test app to the webOS media/DRM team? We can provide more logs or a remote session if needed.

Best regards,

EME close test body { margin: 0; padding: 40px 60px; background: #000; color: #fff; font: 26px/1.4 monospace; } #summary { font-size: 40px; margin: 20px 0; } .bad { color: #ff6b6b; } .good { color: #6bff8a; }
EME close test: no Shaka Player, no DASH, no stream. Only the browser EME API.
Running...

this the script "session.closed resolved: " + resolved + " of " + ROUNDS; meanwhile in lg webos 25 its never closed

If you are having an issue with a specific TV, please send the following information regarding the TV that is not working and the TV that is working to developer@lge.com.

  • TV model name: (You can check this in the Settings > Support > TV Information menu.)
  • TV software version: (You can check this in the Settings > Support > Software Update menu.)
  • webOS TV version: (You can check this in the Settings > Support > TV Information menu.)
  • Region:

To check the issue, it must be reproducible. Please also send the following information.

  • Test video showing the issue
  • Sample app
  • Steps to reproduce the issue