google / google/ExoPlayer

Can't play video with DRM in custom web receiver app cast

Open
#9,258 1 comment 0 reactions 1 assignee Claimed by @marcbaechinger View on GitHub
question
Dominant language
Java
Stars
21.9k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

I'm trying casting video with exoplayer cast to my web receiver app. In Exoplayer Default Receiver APP ID, video can play, but my custom receiver cant play. In CacTool, [ERROR] Detailed Error Code - 201. This is my receiver.js code

`context.getPlayerManager().setMessageInterceptor(
cast.framework.messages.MessageType.LOAD,
loadInterceptor);

function loadInterceptor(loadRequestData) {
if (loadRequestData.media && loadRequestData.media.customData &&
loadRequestData.media.customData['exoPlayerConfig']) {
exoPlayerConfig = loadRequestData.media.customData['exoPlayerConfig'];

if (exoPlayerConfig.licenseUrl) {
playerManager.setMediaPlaybackInfoHandler((loadRequest, playbackConfig) => {
playbackConfig.protectionSystem = exoPlayerConfig.protectionSystem;
playbackConfig.licenseUrl = exoPlayerConfig.licenseUrl;
playbackConfig.licenseRequestHandler = requestInfo => {
requestInfo.withCredentials = true;
requestInfo.headers = {
'origin': 'https://gstatic.com',
'access-control-allow-origin': 'https://gstatic.com'
};
return requestInfo;
};

return playbackConfig;
});
}
}

return loadRequestData;
}

context.start({playbackConfig: playbackConfig});
`

How to solve this? Thanks.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.