Chromecast receiver app cannot play widespread protected content using Android sender app

I am using the destination application from the Expressplay website for chrome plating. https://www.expressplay.com/developer/test-apps/#ccplayer .

I tested it in a browser by passing the URL of the license along with the broadcast stream . He played the video, it means that the receiver is working fine.

The problem occurs when I try to play content from an Android sender application. I am passing the license url in 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 assume that the problem may be with the recipient code in case of playing with android when installing the Url license .

My license URL to configure my recipient code is as follows.

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

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

  • The result when playing from the sender android is a black screen.

  • When playing back from the browser sender, the video plays.

  • CORS is enabled on the S3 server that hosts the video content.

Can anyone tell me what I'm doing wrong?

JSON object transferred from android without setting license url? If so, how to solve it?

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

+6
source share
2 answers

I realized that in my receiver application event.data.customData was undefined when connected using the Android sender application.

So I used event.data.media.customData

And access to the following key:

 if(event.data.media.customData['licenseUrl'] !== null){ console.log('setting license URL from mobile'); host.licenseUrl = event.data.media.customData.licenseUrl; } 

That's all!:)

+1
source

If you havenโ€™t already done so, check for DRM support , which indicated that

In order to fully support DRM protected content, you need to implement a custom receiver . With a custom receiver, you can configure authentication and customize the application to meet your DRM requirements.

Please note that your recipient application accesses the recipient API using the following link:

 //www.gstatic.com/cast/sdk/libs/receiver/2.0.0/cast_receiver.js 

In addition, to develop a custom recipient application, you need to register your application with the Google Cast SDK Developer Console .

Then for the Android Sender app, check the following:

+1
source

Source: https://habr.com/ru/post/1270517/


All Articles