rx-player
rx-player copied to clipboard
eme: add `formatInitializationData` keySystems option
This is a very very simple implementation of #1017, which basically adds a formatInitializationData
callback to the keySystems
loadVideo option.
This callback will allow an application to generate its own encrytion initialization data, for when the right one is not in the content.
I'm still unsure if this is the right way to do it though:
-
By putting its logic only in the
EMEManager
(for simplicity reason), the new initialization data will not be known from any other module.This may be dangerous for future evolutions if we're not careful. E.g., another module could presume that the wanted keySystem's data is unavailable and thus bypass completely the EMEManager logic.
-
formatInitializationData
takes anUint8Array
as argument and outputs anUint8Array
.This makes sense in the current code, yet we may also prefer a more generic
ArrayBuffer
type here. -
It takes as argument every initialization data concatenated and return what should be fed to
MediaKeySession.generateRequest
. As such, it is kind-of a low-level very specialized callback, without the notion of a "pssh" nor of a "key system".This can both be good or bad.