[encrypted-media] Initialization Data Encountered Algorithm: 'encrypted' event should not be fired if there is no action to be taken

greg80303 has just created a new issue for 
https://github.com/w3c/encrypted-media:

== Initialization Data Encountered Algorithm: 'encrypted' event should
 not be fired if there is no action to be taken ==
The current EME spec indicates that the user agent will send the 
`MediaEncryptedEvent` every time it encounters InitializationData in 
the media data.  For adaptive bitrate protocols like MPEG-DASH this 
may cause the delivery of the `MediaEncryptedEvent` upon every 
Representation switch.  The Javascript application must then decide 
whether or not to call `MediaKeySession.generateRequest()` with that 
InitializationData based on a very limited set of information.  The 
CDM, being the only entity that can decipher the contents of the 
InitializationData, should manage this process without any 
intelligence on the part of the application.  A couple of possible 
solutions:

* All instances of InitializationData are passed to the CDM 
automatically by the user agent upon detection in the media data.  The
 `MediaEncryptedEvent` will be sent ONLY when a transaction with the 
license server is required.
* Continue to deliver `MediaEncryptedEvent` each time 
InitializationData is encountered.  The application will continue to 
call `MediaKeySession.generateRequest()` for each occurrence, but 
modify the return value of the function to be `Promise<boolean>`, 
where a value of true indicates that a license request will be 
generated, and a value of false indicates that no license request is 
necessary.

Additionally, in the case of “broadcast” delivery of content, where 
the client device does not always have an upstream data path, the 
content distributor may place InitializationData in the media data 
that contains encrypted keys.  These encrypted keys can be decrypted 
by the CDM using a “root” license that was obtained by other methods.
  This use-case relies on a solution to the previously mentioned 
problem in which the CDM automatically “handles” InitializationData 
for which no action is required by the Javascript application.  
However, in this case, you would expect `keystatuseschange` events to 
be delivered to the application when the CDM processes and installs 
these “in-band licenses”.

See https://github.com/w3c/encrypted-media/issues/121

Received on Friday, 30 October 2015 17:52:00 UTC