小编Ibr*_*bal的帖子

DRM WideVine视频无法从Android演员发送器应用程序播放

我正在使用以下演员接收器

当我将我的Android发送者连接到chromecast设备时,它显示黑屏并且从不播放视频.

https://github.com/googlecast/CastReferencePlayer

我在接收器中为broadvine设置licenseUrl如下:

sampleplayer.CastPlayer.prototype.preloadVideo_ = function(mediaInformation) {
  this.log_('preloadVideo_');
  var self = this;
  var url = mediaInformation.contentId;
  var protocolFunc = sampleplayer.getProtocolFunction_(mediaInformation);
  if (!protocolFunc) {
    this.log_('No protocol found for preload');
    return false;
  }
  var host = new cast.player.api.Host({
    'url': url,
    'mediaElement': self.mediaElement_
  });
  host.onError = function() {
    self.preloadPlayer_.unload();
    self.preloadPlayer_ = null;
    self.showPreviewModeMetadata(false);
    self.displayPreviewMode_ = false;
    self.log_('Error during preload');
  };
      host.licenseUrl = event.data.customData.licenseUrl;
      self.preloadPlayer_ = new cast.player.api.Player(host);
      self.preloadPlayer_.preload(protocolFunc(host));
      return true;
    };
Run Code Online (Sandbox Code Playgroud)

host.licenseUrl = event.data.customData.licenseUrl;

我把它托管在https服务器上,该服务器在开发者控制台上注册.

我将自定义数据作为licenseUrl …

android chromecast widevine custom-receiver

11
推荐指数
1
解决办法
612
查看次数

Chromecast接收器应用程序无法播放来自Android发送者应用程序的广泛受drm保护的内容

我正在使用Expressplay网站上的接收器应用程序进行chromecast.https://www.expressplay.com/developer/test-apps/#ccplayer.

我已经通过传递许可URL宽流路径从浏览器中测试了它.它播放视频,意味着接收器工作正常.

当我尝试从Android发送器应用程序播放内容时出现问题.我经过许可URLJSON对象.

我的android发送者代码如下.

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();
}
Run Code Online (Sandbox Code Playgroud)

我猜这个问题可能与在设置licenseUrl时从android播放的情况下的recevier代码有关.

我的接收者代码设置许可证URL如下.

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

event.data.customData.licenseUrl 如果是android,则不会设置许可URL.

  • 从Android发送者播放时的结果是黑屏.

  • 从浏览器发件人播放时播放视频.

  • 在托管视频内容的S3服务器上启用 …

android chromecast widevine custom-receiver

8
推荐指数
1
解决办法
1751
查看次数

标签 统计

android ×2

chromecast ×2

custom-receiver ×2

widevine ×2