Chromecast receiver application cannot play widevine drm protected content from Android sender application

Viewed 3777

I'm using receiver application from Expressplay's site for chromecast. https://www.expressplay.com/developer/test-apps/#ccplayer.

I've tested it from the browser by passing license URL along with the widevine stream path. It played the video, means that the receiver is working fine.

The problem appears when I try to play content from an android sender application. I'm passing the license URL in a json object.

My android sender code is as follows.

private MediaInfo buildMediaInfo() {
    MediaMetadata movieMetadata = new MediaMetadata(MediaMetadata.MEDIA_TYPE_MOVIE);
    movieMetadata.putString(MediaMetadata.KEY_SUBTITLE, "Subtitle");
    movieMetadata.putString(MediaMetadata.KEY_TITLE, "Title");
    jsonObj = new JSONObject();
    try{
       jsonObj.put("licenseUrl","https://wv.test.expressplay.com/hms/wv/rights/?ExpressPlatToken=****");
    }catch (JSONException e){
        Log.e(null,"Failed to add description to the json object", e);
    }
    return new MediaInfo.Builder("stream path.mpd")
            .setStreamType(MediaInfo.STREAM_TYPE_BUFFERED)
            .setContentType("video/mp4")
            .setMetadata(movieMetadata)
            .setCustomData(jsonObj)
            //.setStreamDuration(player.getDuration())
            .build();
}

I'm guessing that the problem maybe with recevier's code for the case of playing from android in setting the licenseUrl.

My receiver code setting license URL is as following.

if (event.data.customData && event.data.customData.licenseUrl) {
                    console.log('setting license URL');
                    host.licenseUrl = event.data.customData.licenseUrl;
                }

event.data.customData.licenseUrl license URL is not getting set in case of android.

  • Result while playing from android sender is Black screen.

  • When playing from browser sender is plays the video.

  • CORS is enabled on the S3 server which is hosting the video contents.

Can Anyone tell what am I doing wrong?

Does the JSON object passed from android not setting license URL ? If yes then how to resolve it?

Thank you in advance for your kind interest and worthy time to my problem. :)

2 Answers
Related