Orange-OpenSource / hasplayer.js

Http Adaptive Streaming javascript player based on HTML5 premium extensions (MSE/EME)
Other
197 stars 67 forks source link

Prevent multiple license requests #209

Open onotole opened 6 years ago

bbert commented 6 years ago

I don't understand the need for this PR. The generateKeyRequest() should be called when creating MediaKeySession.

onotole commented 6 years ago

There are few issues here:

  1. According to https://dvcs.w3.org/hg/html-media/raw-file/eme-v0.1b/encrypted-media/encrypted-media.html, there is no such thing as KeySession (explicit drm session management was introduced in later specs).
  2. There is a race condition in initial license request generation approach - if we would do it ASAP then, according to algorithm https://dvcs.w3.org/hg/html-media/raw-file/eme-v0.1b/encrypted-media/encrypted-media.html#dom-generatekeyrequest, step 2, we will fail because video tag isn't ready yet (to be safe here we need to wait until needkey event). It is quite strange limitation but webkit follows this recommended algorithm precisely. And, as I can imagine, IE is more permissive here.
bbert commented 6 years ago

The point is that I do not have any terminal/browser that implements this EME version in order to test. On IE11, the ProtectionModel_3Feb2014 is used. Does anyone is able to check also this PR?