canalplus / rx-player

DASH/Smooth HTML5 Video Player
https://developers.canal-plus.com/rx-player/
Apache License 2.0
869 stars 131 forks source link

HLS drm custom contentID #988

Open wojciech-bilicki-oke opened 3 years ago

wojciech-bilicki-oke commented 3 years ago

We'd like to migrate from Bitmovin to RXPlayer. One thing we do for fairplay drm while working with bitmovin is providing custom function that creates contentId:

prepareContentId: (uri: any) => { const m = uri.match(/\bskd:\/\/([^?/]+)/); if (m == null) { throw new Error('bad contentid uri'); } const base64 = decodeURIComponent(m[1]); const s = window.atob(base64); return s; },

The question is how one can achieve this within RxPlayer. Is there an API for that?

peaBerberian commented 3 years ago

Hi,

At what EME step do you need it?

The RxPlayer should already parse the content ID found in the content's initialization data https://github.com/canalplus/rx-player/blob/4cf976cb765406300215f8531771e8636b62bc84/src/compat/eme/get_webkit_fairplay_initdata.ts#L50

which is then used when creating a session in WebKit for FairPlay contents https://github.com/canalplus/rx-player/blob/4cf976cb765406300215f8531771e8636b62bc84/src/compat/eme/custom_media_keys/webkit_media_keys.ts#L174-L176

Which then leads to a challenge given to the getLicense callback

adamtatur commented 2 years ago

Hi,

Going back to my colleague's question. We have to have decoded contentId before it will be passed with challange to getLicence callback. Are we able to achieve this using rx-player api?

peaBerberian commented 2 years ago

Just to be sure I understand the question: you want to provide a custom contentId in the encryption initialization data that will be used to create the challenge?

In the situation of the first comment, when prepareContentId would be called and where its result would be used?

m-scheepers commented 6 months ago

@peaBerberian this issue can be closed. We are using rxplayer with our license server and this ticket is not relevant anymore.