DRM播放问题

时间:2019-01-11 07:29:18

标签: android exoplayer drm

我尝试播放DRM文件,但未播放,但显示一些错误,请您提示我集成方式。我只是想传递DRM Media URL和WideVine Licence,它显示了电影的播放时长,但是内容没有播放。

正在使用的ExoPlayer版本 'com.google.android.exoplayer:exoplayer:2.7.3'

注意:没有特定的设备。

玩家整合

 DefaultBandwidthMeter bandwidthMeter = new DefaultBandwidthMeter();
 TrackSelection.Factory videoTrackSelectionFactory =
  new AdaptiveTrackSelection.Factory(bandwidthMeter);
   trackSelector = new 
 DefaultTrackSelector(videoTrackSelectionFactory);

    int errorStringId = R.string.error_drm_unknown;
        DefaultDrmSessionManager<FrameworkMediaCrypto> drmSessionManager = null;
        try {
            String drmSchemeExtra = DRM_SCHEME;
            UUID drmSchemeUuid = Util.getDrmUuid(drmSchemeExtra);
            if (drmSchemeUuid == null) {
                errorStringId = R.string.error_drm_unsupported_scheme;
            } else {
                String[] keyRequestPropertiesArray = new String[]{};
                drmSessionManager =
                        buildDrmSessionManagerV18(
                                drmSchemeUuid, movie.getDrmLicence(), keyRequestPropertiesArray,false);
            }
        } catch (UnsupportedDrmException e) {
            errorStringId = e.reason == UnsupportedDrmException.REASON_UNSUPPORTED_SCHEME
                    ? R.string.error_drm_unsupported_scheme : R.string.error_drm_unknown;
        }

        if (drmSessionManager == null) {
            showToast(activity.getString(errorStringId));
            //activity.finish();
            return;
        }

        boolean preferExtensionDecoders = false;
        @DefaultRenderersFactory.ExtensionRendererMode int extensionRendererMode =
                ((IdeaApplication) activity.getApplication()).useExtensionRenderers()
                        ? (preferExtensionDecoders ? DefaultRenderersFactory.EXTENSION_RENDERER_MODE_PREFER
                        : DefaultRenderersFactory.EXTENSION_RENDERER_MODE_ON)
                        : DefaultRenderersFactory.EXTENSION_RENDERER_MODE_OFF;
        DefaultRenderersFactory renderersFactory = new DefaultRenderersFactory(context, drmSessionManager,extensionRendererMode);

        // Create a player instance.
        player =  ExoPlayerFactory.newSimpleInstance(context,trackSelector,new DefaultLoadControl(),drmSessionManager);

测试DRM:

“ uri”:“ https://storage.googleapis.com/wvmedia/cenc/h264/tears/tears.mpd”, “ drm_scheme”:“ widevine”, “ drm_license_url”:“ https://proxy.uat.widevine.com/proxy?video_id=0894c7c8719b28a0&provider=widevine_test

对于错误日志,请检查以下具有错误报告的问题

https://github.com/google/ExoPlayer/issues/5359

0 个答案:

没有答案