Comments (4)
I can confirm that parsing of dashif:laurl is broken.
The code to iterate over prefixes was removed from CommonEncryption.js (Dash-Industry-Forum/dash.js#4406 - 6.Feb.2024). Specifically, it now uses contentProtection.laUrl != null to test for presence of a valid license-server url, which relies on the manifest parser to do case conversion to DashConstants.LA_URL in CodeProtection::init(). This isn't happening so dashif:laurl is not handled.
The code discussed in Ticket Dash-Industry-Forum/dash.js#3343 is never executed now.
See https://content.media24.link/Leaf/stream.mpd
This patch fixed it for me:
`--- a/src/dash/vo/ContentProtection.js
+++ b/src/dash/vo/ContentProtection.js
@@ -59,6 +59,7 @@ class ContentProtection extends DescriptorType {
this.pssh = data.hasOwnProperty(DashConstants.PSSH) ? data[DashConstants.PSSH] : null;
this.pro = data.hasOwnProperty(DashConstants.PRO) ? data[DashConstants.PRO] : null;
this.laUrl = data.hasOwnProperty(DashConstants.LA_URL) ? data[DashConstants.LA_URL] : null;
-
this.laUrl = this.laUrl || (data.hasOwnProperty('laurl') && data['laurl'])
`
from rx-player.
Hi, attempting access to above DASH manifests through the URLs you provide yields 403 HTTP status.
from rx-player.
Hi, attempting access to above DASH manifests through the URLs you provide yields 403 HTTP status.
I think you have to be in Sweden or use a VPN service simulating being in Sweden.
from rx-player.
Hi @stephanterning,
I guess this is a new feature though it could be interesting, at least to better handle clear-key contents.
It looks like we may (not sure!) need to do two things here:
- generate the initialization data ourselves (potentially? there are several clearkey key systems defined in https://dashif.org/identifiers/content_protection/, and the dash.js code talks about a potential pssh, so maybe this is not even needed here, we would have to look at the MPD and/or segments - is there a
<cenc:pssh>
element in the MPD? Is there a PSSH box in the MP4? "pssh" is encoded as an ASCII value in a ".mp4" so can be seen in the binary data, it is most likely in the initialization segment) - Rely on the license server url announced in the MPD (even here, is it always required? You don't know it in advance?)
Its specification (https://www.w3.org/TR/encrypted-media/#clear-key) mainly talk about a "Licence Request Format" and of a "License Format", which is nice but looks like browser matters, what would most likely interest us here is how to format what's called the "init data" that is communicated to the browser so it communicates back to us the "License Request Format" (though it can be known from the beginning here, but I don't think we're supposed to skip the generateRequest
call so let's play along and act surprised when data comes back).
Though the dash.js implementation here is clear (https://github.com/fraunhoferfokus/dash.js/blob/fbc786ae6177537a03820ef8326fddbe86dd1ba4/src/streaming/protection/drm/KeySystemClearKey.js#L82) and seems to indicate that it is roughly the same than the "Licence Request Format" (only it omitted the type
property from it):
It's a JSON (UTF-8 encoded) with a kids
property set to an array of the Base64Url representation of the key ids of all wanted keys.
In the MPD, key ids are represented in the cenc:default_KID
attribute on the <ContentProtection>
element, as hexadecimal hyphen-separated values. Here we would have to decode that value and then switch them to the equivalent base64Url encoding before putting them in the kids
array.
dash.js seems to do hex-> JS string (through String.fromCharCode
) -> Base64 (through btoa
) here (which is strange because they are here generating Base64 and not Base64Url - they remove =
padding but do not replace +
by -
and /
by _
. I don't know if it's a bug or if it's unnecessary here).
I cannot see your MPD, but they also prefer to rely on the `ContentProtection's pssh instead of that generated JSON if there's one also in the MPD (what I get from https://github.com/fraunhoferfokus/dash.js/blob/fbc786ae6177537a03820ef8326fddbe86dd1ba4/src/streaming/protection/drm/KeySystemClearKey.js#L84).
As for the second part of that implementation which would be to rely on the license server URL found in the MPD, it doesn't look too hard either and could be communicated if found through a third getLicense
argument (how it gets to there inside the RxPlayer code is another subject, but it still looks doable). We could also be doing the license request ourselves but for those matters I prefer to let the application in control.
So in conclusion, this is a new feature for the RxPlayer but it seems doable and standard enough to be integrated.
from rx-player.
Related Issues (20)
- DISCONTINUITY_ENCOUNTERED errors after consecutive audio track switches, for DASH live content, result in an endless loop HOT 2
- KEY_GENERATE_REQUEST_ERROR - The initDataType parameter is empty (observed on Tizen 2017) HOT 7
- Video playback issues on Android Mobile in Chrome HOT 9
- Check Dolby Atmos and Dolby Vision in current stream HOT 3
- Unable to play some streams in Edge browser on RxPlayer v3.30.0 HOT 11
- Streams freeze on first frame with audio only playback on Edge browser (and probably Chrome) HOT 6
- Safari 17 brings MSE to iOS HOT 10
- Some DASH/Widevine streams are looping on a Vestel MB130 HOT 3
- First playback of PlayReady content fails on EDGE browsers HOT 3
- PIPELINE_ERROR_DECODE error observed in Edge browser when zapping live channels HOT 2
- Safari 17.1 issue with playback DRM content HOT 3
- playing MKV VOD with multi Audio track HOT 7
- Infinity loading state on Safari Mobile when autoplay is false HOT 17
- Arrêt brutal du player en Replay sur le mycanal sur HOT 4
- PIPELINE_ERROR_INVALID_STATE error when using Playready/Dash stream (mixed encrypted/unecrypted content) HOT 4
- fromFirstPosition does not start from actual first position in live DASH manifest (multi period live with SSAI) HOT 2
- Freezed VOD stream and lot of audio discontinuities on Samsung Tizen 2017 HOT 11
- Pre-fetching DRM licenses for current and future content
- Widevine LD fallback not triggering in RxPlayer HOT 7
- dashif:laurl not parsed after recent changes
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rx-player.