New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MSS] Widevine pssh generation #2397
[MSS] Widevine pssh generation #2397
Conversation
- do not use ProtectionController do get key systems string value and scheme ID URI - generate (minimal) Widevine pssh with KID extracted from PlayReady ProtectionHeader
… only, pssh now generated in MssParser)
Nice! This simplifies life. Do I understand it right that this feature activates automatically for any MSS stream with a ProtectionHeader? No activation needed by app developer? I imagine hand-rolling the Widevine header object using byte manipulation (as is done for the PSSH box) would enable the size increase to be avoided. It is a rather tiny structure, so as long as nothing more involved is needed, perhaps this enables the feature to reach a wider set of users? |
Yes, I confirm no activation needed by app developer, except of course providing license url. 2 options: Personally, for the time being, option 1 is sufficient and acceptable. |
What is the rationale behind the "SD" track type? Will hardcoding this value satisfy all expected use cases? I guess the same question can be raised for the algorithm but this can likely be deferred until DASH-IF IOP defines something that talks about how to properly signal non-CTR content (I think there is no such signaling defined there now). |
src/mss/parser/MssParser.js
Outdated
ksWidevine = keySystems[i]; | ||
break; | ||
// Set box length value | ||
pssh[i++] = (length & 0xFF000000) >> 32; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this probably be '>>> 24;' ? Move three bytes right and fill with zeros?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes of course! Thanks for pointing out. I will correct.
Hi @sandersaares, |
Now the question is: do we inlude protobufjs dependency of do we simply provide the Widevine header with byte manipulation? I am in favor of the simplest solution without increasing file, as long as nobody expresses the need for manipulating/overrinding the pssh. |
"+ 1" for the simplest solution. I also prefer keeping the solution as simpler as possible and don't add complexity because something that is still not a real use case. |
OK. I have committed changes for simplest solution. |
This goal of this PR is to synthesize the Widevine pssh for MSS+PR streams on-the-fly with KID value extracted from PlayReady manifest's ProtectionHeader field.
With the help of this PR, this is no more required to provide pssh as an input parameter in protectionData.
The source code to build the Widevine pssh according to Google Protocol Buffer has been generated using the protobuf.js project (https://github.com/dcodeIO/ProtoBuf.js).
The source for manipulating/generating Widevine pssh has been introduced only in MSS package, to avoid increasing the build/minified file size of dash.js (dash.all). Only the MSS package (dash.mss) is increased about around 18kB (due to protobufjs package dependency).
If afterwards there is some need for adding the option to override some field values of original pssh for any stream, we could then integrate this protobufjs library into protection package. This could be generalized for all key systems.