3

Ive been reading up on getting widevine playback to happen on the chromecast after a device has connected to it. Ive already got widevine working for movie titles in both android and ios and Im not sure where to begin as far as what I should pass as my custom data to the player. Ive had a brief look at the sample at

https://github.com/googlecast/CastMediaPlayerStreamingDRM

but I have yet to try to implement it as I dont want to be spinning my wheels trying to pass random keys and things into the receiver. Since I have all the necessary authentications taking place on the device already what would I need to send to the receiver.

James andresakis
  • 5,335
  • 9
  • 53
  • 88
  • The sample project supports Widevine as well, so you should look at that project. – Ali Naddaf Aug 28 '14 at 05:12
  • @AliNaddaf thanks for commenting on my question. Is it possible to get the drm receiver working for dev purposes if I just host it on google drive for the time being? – James andresakis Aug 28 '14 at 15:59
  • Hosting on Google Drive is fine; we just don't recommend it for production otherwise there is not technical reason to stop you from using it. Instructions are here: https://support.google.com/drive/answer/2881970?hl=en – Ali Naddaf Aug 28 '14 at 16:51
  • 1
    @AliNaddaf - i am trying to play WV content with this receiver: https://github.com/googlecast/CastReferencePlayer .. it's working for me with my Player Ready streams but it's not working with the WV streams .. i am trying to understand what parameters i need to send to the receiver in order to play .. for example: licenseCustomData and licenseUrl is needed in the host ? i need to send only the mediaElement and the url ? right now when i am trying to do that the CC is downloading 1 chunk and fails after 30000ms, and then tries agin to download the same chunk. – Sosily Feb 04 '16 at 08:32

1 Answers1

1

I know this is late, but for others that need help, all you really need to do is pass the license url in the custom data.

    JSONObject jsonObject = new JSONObject();
    try{
        jsonObject.put("licenseUrl", licenseUrl);
    } catch (JSONException e){
        Utils.log("Failed to add license to Json object.");
    }

    MediaInfo mediaInfo =
            new MediaInfo.Builder(videoUrl)
                    .setStreamType(MediaInfo.STREAM_TYPE_BUFFERED)
                    .setContentType("video/mp4")
                    .setMetadata(movieMetadata)
                    .setStreamDuration(currentPosition)
                    .setCustomData(jsonObject)
                    .build();
    return new MediaQueueItem.Builder(mediaInfo).build();

For the receiver, be sure to create a CAF (not a Receiver v2) and refer to this guide for the Widevine setup. The server will need to read the license and allow it for Widevine playback using Javascript on the receiving end.

6rchid
  • 1,074
  • 14
  • 19