【问题标题】:Chromecast Receiver App CookiesChromecast 接收器应用程序 Cookie
【发布时间】:2014-06-17 00:31:42
【问题描述】:

我正在尝试在我的 chromecast 自定义接收器上播放 HLS 流。但是我在获取 m3u8 文件时遇到了身份验证问题,因为我的服务器需要 cookie。

获取根 m3u8 文件的请求有一个“Set-Cookie”标头,在我的流中获取子 m3u8 文件时需要考虑该标头(以通过服务器身份验证)。我想知道当接收方应用获取媒体时是否可以设置 cookie。

【问题讨论】:

    标签: cookies chromecast google-cast


    【解决方案1】:

    尝试类似:

    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;
    };
    

    【讨论】:

    • 嘿,我现在正在研究风格化的媒体接收器,而不是自定义接收器。是否可以在样式化的媒体接收器中打开 withCredentials?
    猜你喜欢
    • 2020-05-17
    • 1970-01-01
    • 1970-01-01
    • 2014-06-26
    • 2016-07-02
    • 2014-09-03
    • 2015-04-16
    • 2018-08-16
    • 2018-10-01
    相关资源
    最近更新 更多