Media readyState update when no decryption key is available is not spec compliant (3 second delay) |
||||||
Issue descriptionVersion: All OS: All Chrome currently waits 3 seconds before pausing playback due to video underflow to avoid glitching when the decoder falls slightly behind. This is also the case when video underflow when the decryption is not available. However, the spec [1] says, when "waiting for key": 7.3.4.4 Queue a task to fire a simple event named waitingforkey at the media element. 7.3.4.5 Set the readyState of media element to HAVE_METADATA. So readyState should be updated before the waitingforkey event is fired (because it is fired by a task). Currently in Chrome waitingforkey event will be fired immediately, then after 3 seconds, readyState will be updated, which is not spec compliant. In a more general context, the 3-second delay is only to combat decoding performance glitch. If we run out of decoded video frames for some other reasons that isn't likely to recover immediately, we should stop immediately rather than waiting for 3 seconds. Having no decryption key falls into this category. See related spec discussion at: https://github.com/w3c/encrypted-media/issues/339 [1] https://w3c.github.io/encrypted-media/#wait-for-key
,
Oct 31 2016
I tried one of the W3C EME tests that check readyState locally (https://web-platform.test:8443/encrypted-media/drm-mp4-playback-temporary-multikey-sequential-readyState.html). With the test changed as listed below, it passes. The change basically waits 4 seconds before checking readyState. However, there was a complication in that the test only expects 1 timeupdate event, but the video "plays" a couple of seconds before stalling (thus you get several timeupdate events). I had to disable the asserts for that part of the test as well. Once this is fixed to change the readyState immediately then this W3C test should pass as it is currently written. --- a/encrypted-media/scripts/playback-temporary-multikey-sequential.js +++ b/encrypted-media/scripts/playback-temporary-multikey-sequential.js @@ -57,13 +57,16 @@ function runTest(config,qualifier) { } function onWaitingForKey(event) { - _waitingForKey = true; if (config.checkReadyState) { // This test does not start playing until the first license has been provided, // so this event should occur when transitioning between keys. // Thus, the frame at the current playback position is available and readyState // should be HAVE_CURRENT_DATA. - assert_equals(_video.readyState, _video.HAVE_CURRENT_DATA, - "Video readyState should be HAVE_CURRENT_DATA on watingforkey event"); + test.step_timeout(function() { + _waitingForKey = true; + assert_equals(_video.readyState, _video.HAVE_CURRENT_DATA, + "Video readyState should be HAVE_CURRENT_DATA on watingforkey event"); + }, 4000); } startNewSession(); } @@ -87,13 +90,13 @@ function runTest(config,qualifier) { // the new ready state is HAVE_CURRENT_DATA or less" case of the readyState change // algorithm which requires a "timeupdate" event be fired. if (_waitingForKey) { - assert_equals(++_timeupdateWhileWaitingCount, 1, "Should only receive one timeupdate while waiting for key"); assert_equals(_video.readyState, _video.HAVE_CURRENT_DATA, "Video readyState should be HAVE_CURRENT_DATA while wating for key"); } if (_video.currentTime > config.duration) { assert_equals(_mediaKeySessions.length, config.initData.length, "It should require all keys to reach end of content"); - assert_equals(_timeupdateWhileWaitingCount, 1, "Should have only received exactly one timeupdate while waiting for key"); _video.pause(); test.done(); }
,
Nov 8 2016
,
Nov 8 2016
,
Nov 8 2017
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue. Sorry for the inconvenience if the bug really should have been left as Available. If you change it back, also remove the "Hotlist-Recharge-Cold" label. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Nov 13 2017
,
Aug 1
|
||||||
►
Sign in to add a comment |
||||||
Comment 1 by ddorwin@chromium.org
, Oct 31 2016