Need help on chromecast a playlist with DRM on iOS

Hi everyone,

I’m reaching out because I’m facing a problem with casting a playlist with DRM protection to my Chromecast from my iOS device.

I’ve tried setting playerConfig.remoteControlConfig.prepareSource but it’s only work for one source.
So I tried to update remoteControlConfigSource when playlist transition to a new source on event playlistTransition but my Chromecast device still playing the same old source.

I’m hoping someone in the community might have some ideas on how to fix this. Thank you.

Hi @chheangly.prum!

So I tried to update remoteControlConfigSource when playlist transition to a new source on event playlistTransition but my Chromecast device still playing the same old source.

playerConfig.remoteControlConfig.prepareSource is called for each source when you start casting. It is not used after. So you need to configure your DRM configuration before casting is started and return the fully configured SourceConfig from prepareSource when invoked.

What do you mean by “same old source”? You mentioned you used a playlist, doesn’t the transition happen to the next source?

Note: Updating any of PlayerConfig (and RemoteControlConfig) properties after player creation is unsupported and can lead to unexpected behavior.

Hello @roland.kakonyi, Thanks for your response.

Here’s the problem we’re facing.

Context:
I have Movie1, Movie2, Movie3 all are DRM protected and I’m using playlist to load all Movies.

Steps:

  1. Create PlayerConfig then set remoteControlConfig.prepareSource to Movie1 source.
  2. Create PlaylistSource with all 3 Movies
  3. Create Player with that PlayerConfig then load playlist sources to the player

Problem:
After player started playing then I connected to Chromecast.
The content playing on chromecast device is correct (Movie1)
Then I wait until player transition to the next source of playlist which is Movie2 while my iOS device still contected to Chromecast. But on Chromecast device is still playing Movie1.

In this case can you suggest any solutions to solve this ? Thanks

I see! Thanks for the details!

What you have to do in prepareSource is to return the according SourceConfig for Movie1, 2 and 3 based on the sourceConfig parameter passed to prepareSource.

Like:

let movie1SourceConfig = ...
let movie2SourceConfig = ...
let movie3SourceConfig = ...

let movie1SourceConfigCasting = ...
let movie2SourceConfigCasting = ...
let movie3SourceConfigCasting = ...
  
remoteControlConfig.prepareSource = { _, sourceConfig in
    switch sourceConfig.url {
    case movie1SourceConfig.url:
        return movie1SourceConfigCasting
    case movie2SourceConfig.url:
        return movie2SourceConfigCasting
    case movie3SourceConfig.url:
        return movie3SourceConfigCasting
    default:
        return nil
    }
}

I hope this helps!

Thanks @roland.kakonyi, Your solution solved the problem we’re facing.

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.

For the record, we extended our related FAQ article about Casting DRM protected content with the aforementioned playlist related instructions here: How to play DRM-protected sources when casting

2 Likes