문제

I am trying to play an HLS stream on my chromecast custom receiver. However i'm having authentication issues fetching the m3u8 files because my server requires a cookie.

The request to get the root m3u8 file has a 'Set-Cookie' header which needs to be considered when fetching the sub-m3u8 files in my stream (to pass server authentication). I would like to know if its possible to have cookies set when the receiver app fetches the media.

도움이 되었습니까?

해결책

Try something like:

window.mediaHost = new cast.player.api.Host({
  'mediaElement': window.mediaElement,
  'url': url
});

window.mediaHost.updateManifestRequestInfo = function(requestInfo) {
  if (!requestInfo.url) {
      requestInfo.url = this.url;
  }
  requestInfo.withCredentials = true;
};

window.mediaHost.updateLicenseRequestInfo = function(requestInfo) {
  requestInfo.withCredentials = true;
};

window.mediaHost.updateSegmentRequestInfo = function(requestInfo) {
  requestInfo.withCredentials = true;
};
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top