w3c / encrypted-media

Encrypted Media Extensions
https://w3c.github.io/encrypted-media/
Other
180 stars 80 forks source link

Internal waiting for key and encrypted block queue values must be cleared on seek #347

Closed ddorwin closed 7 years ago

ddorwin commented 7 years ago

The internal waiting for key and encrypted block queue values are initialized when the HTMLMediaElement is created:

When a HTMLMediaElement is created, its internal waiting for key value shall be initialized to false and its _encrypted block queue val_ue shall be empty.

But they are not cleared in other conditions. Seeking is the most obvious. Are there others?

@cpearce @foolip

cpearce commented 7 years ago

We would need to reset those when load() is called as well, in case the video element is reused.

ddorwin commented 7 years ago

I'll use the following language copied from https://html.spec.whatwg.org/multipage/embedded-content.html#video:

When the current playback position changes such that the last frame rendered is no longer the frame corresponding to the current playback position...

followed by the text:

the user agent shall set the waiting for key value to false and make the encrypted block queue value empty.

I'll follow that with a note that this applies to the load and seeking algorithms.

ddorwin commented 7 years ago

PR #348.

I ended up using different text since the text above was specific to video and would also trigger on normal playback.