Skip to content
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

HOWTO: Use DRM with CastPlayer #1562

Open
Soft-Buddy opened this issue Jul 24, 2024 · 1 comment
Open

HOWTO: Use DRM with CastPlayer #1562

Soft-Buddy opened this issue Jul 24, 2024 · 1 comment
Assignees
Labels

Comments

@Soft-Buddy
Copy link

I'm using ExoPlayer and CastPlayer in my app. I managed to configure ClearKey drm for my Dash stream and got it working in ExoPlayer. I want to ask if there's any way to configure ClearKey drm for CastPlayer?

@marcbaechinger
Copy link
Contributor

Thanks for your question. I'm not talking from experience in the sense that I'd have done this myself. The follwoing is kust about the APIs as far as I understand it from the documentation. Somereaders may be much better informaed about how the Cast SDK or devices on which cast is running support Dash with DRM.

As far as I understand from the Cast documentation there are two types of DASH streams with DRM that are supported.

The first type has all the information in the manifest and just works.

The second type need a licence URI that need to be passed from the sender (the Android app with CastPlayer) to the receivever. The receiver then needs to get the licence URI from the load request and set it accordingly with a PlaybackRequest updated accordingly. Latter is something that needs to be done on your receiver side, I can't help you with this due to lack of knowledge and experience.

As the snippet in [1] shows, you can pass the licence in any way your receiver understands. DefaultMeidItemConverter adds any DRM information that are part of the Media3 MediaItem in the JSON document that it writes to the custom data of the cast media item. You can reuse that and get the DRM info from that JSON. As an altarnative, you can write your own MediaItemConverter and pass it to the constructor of CastPlayer. There you can then convert the DRM linces into the cast item in a diffeent way if this is required.

It' important to note that your receiver needs to understand this, get the data from the load request (like from the JSON do in the custom data ) and do what's documented in [1].

I hope this helps as a starting point. There are users here that read this that have more experience with DRM on cast devices I guess. If you are lucky someone shares with you from their DASH with DRM on cast devices. Else [1] and [2] are the Cast/DASH/DRM resources I was using to respond to your question.

[1] https://developers.google.com/cast/docs/media/streaming_protocols#drm
[2] https://developers.google.com/cast/docs/media/streaming_protocols#dynamic_adaptive_streaming_over_http_dash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants