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) andHW_SECURE_ALL: same result
Steps to reproduce
- Play a Widevine-protected DASH live stream through MSE/EME.
- Change channel repeatedly (one change every ~2–4 s). Each change:
MediaKeySession.close()on the old session →video.setMediaKeys(null)→ detach the oldMediaSource(remove<source>,video.load()) →createMediaKeys()→ attach a newMediaSourceto the same<video>→setMediaKeys()→generateRequest(). - Watch
MediaKeySession.closed(snippet below), and continue for ~10 minutes.
Observed
close()resolves within milliseconds, butMediaKeySession.closednever resolves: 0 of 37 sessions across three runs, observed for minutes.MediaKeySession.remove()beforeclose()rejects withInvalidStateError(14 of 14).- After ~170 channel changes, a new
MediaSourceattached to the<video>never firessourceopen.video.readyState= 0,networkState= 2, noerrorevent, no network activity. It stays like this indefinitely. - In that state, nothing inside the app recovers playback: a new player with a new
MediaSourceon the same<video>does not open, andlocation.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
- Is this a known issue in the webOS 25 Widevine CDM or media pipeline? Is a firmware fix available or planned?
- Is there a supported way on webOS 25 to make sure a Widevine session and its resources are released, other than
close()? - Is there a limit on unreleased DRM sessions or media pipelines per app that would explain
sourceopennever firing after ~170 channel changes?
We can provide full logs and a test build on request.