0
votes

I have file-based media (MP4) in a server (this server is not mine, I just used it to store a mp4 file). In order to stream this media from this server, I need to provide cookies which are collected by my Android sender app (I can play this media stream on my Android app already) for this server.

I am finding a way to provide cookies for the server by Chromecast CAF receiver app (for file-based media). I have checked guides documents of Google cast and searched information online but I can only find some ways to support for other protocol like (DASH, HLS,...)


Source: https://developers.google.com/cast/v2/mpl_player#cors <- this is for old version (v2) of receiver app

If your server requires CORS and cookie information in order to access the media, set the property withCredentials to true and set the header information as needed.

host.updateSegmentRequestInfo = function(requestInfo) {
  // example of setting CORS withCredentials
  requestInfo.withCredentials = true;
  // example of setting headers
  requestInfo.headers = {};
  requestInfo.headers['content-type'] = 'text/xml;charset=utf-8';
};

Source: Authentication in Chromecast CAF Receiver application <- this is for other protocol (DASH, HLS,.. not file-base media)

playbackConfig.manifestRequestHandler = requestInfo => {
    requestInfo.withCredentials = true;
};

playbackConfig.segmentRequestHandler = requestInfo => {
    requestInfo.withCredentials = true;
  };

playbackConfig.licenseRequestHandler = requestInfo => {
    requestInfo.withCredentials = true;
};

And I cannot find a way to providing cookies for file-based media. So, I would like to ask your help, answers and recommendations. Thanks,

1

1 Answers

0
votes

After researching online documents and inspecting Chromecast device session. It looks that Chromecast device does not allow provide cookie (cookie not activated in Chromecast) to authenticate due to security purpose.