1

update: i plugged my video's information into this https://bitmovin.com/demos/drm and it played with no problems. This makes believe it's not a CORS issue

I've attempted quite a few times trying to get our DRM-ed video to play on a chromecast. It looks like it can run non-DRM videos totally fine, even when I mess with the metadata (obviously this shouldnt have an effect on the video)

const playbackConfig = new cast.framework.PlaybackConfig();

playbackConfig.licenseUrl = DRM_LICENSE
playbackConfig.protectionSystem = cast.framework.ContentProtection.WIDEVINE;
playbackConfig.licenseRequestHandler = requestInfo => {
  requestInfo.withCredentials = true;
};

and i intercepted the sent request with my actual video with:

playerManager.setMessageInterceptor(
  cast.framework.messages.MessageType.LOAD, loadRequestData => {
    loadRequestData.media.contentId = "videoUrl.m3u8"
    loadRequestData.media.contentType = 'application/x-mpegurl' 
    var metadata = new 
               cast.framework.messages.GenericMediaMetadata();
            metadata.title = 'robocop in action';
            metadata.subtitle = 'robocop';
    loadRequestData.media.metadata = metadata
    loadRequestData.media.HlsSegmentFormat = cast.framework.messages.HlsSegmentFormat.FMP4;
    loadRequestData.media.HlsVideoSegmentFormat = cast.framework.messages.HlsVideoSegmentFormat.FMP4;
    console.log(loadRequestData)
    return loadRequestData;
  });

ultimately, everything funnels into this final function:

context.start({playbackConfig : playbackConfig})

What exactly is needed to get DRM content working on Chromecast?

Thanks

turns out i needed to pass CORS header into my playback config:

const playbackConfig = new cast.framework.PlaybackConfig();
playbackConfig.licenseUrl =
  "DRM-LICENSE-URL";
playbackConfig.protectionSystem = cast.framework.ContentProtection.DRMMETHOD;
playbackConfig.licenseRequestHandler = requestInfo => {
  requestInfo.withCredentials = true;
  requestInfo.headers = [
    {
      "origin": ["*"],
      "responseHeader": ["Content-Type"],
      "method": ["GET", "HEAD"],
      "maxAgeSeconds": 86400
    }
  ];
};
  • Your license server might require additional information to return a license (eg. specific security headers). – aergistal Feb 18 '20 at 17:54

0 Answers0