BrightCove视频播放器未在Android中播放DRM启用视频
我正在尝试在BrightCove视频播放器中播放视频(DRM enalbed)。 到目前为止,我所做的是。另外,我已经使用BrightCovePlayer
// Get the event emitter from the SDK
EventEmitter eventEmitter = brightcoveVideoView.getEventEmitter();
// Create a catalog request to fetch a video
String account = getString(R.string.account);
Catalog catalog = new Catalog.Builder(eventEmitter, account)
.setBaseURL(Catalog.DEFAULT_EDGE_BASE_URL)
.setPolicy(getString(R.string.policy))
.build();
// Get the video by ID
catalog.findVideoByID(getString(R.string.videoId), new VideoListener() {
@Override
public void onVideo(Video video) {
// Add video to the view
brightcoveVideoView.add(video);
// Start video playback
brightcoveVideoView.start();
}
});
XML布局
<com.brightcove.player.view.BrightcoveExoPlayerVideoView
android:id="@+id/brightcove_video_view"
android:layout_width="match_parent"
android:layout_height="280dp"
android:layout_gravity="center_horizontal|top"/>
扩展了课程
I am trying to play videos(DRM enalbed) in brightcove video player.
What I did so far is. also I have extend the class with BrightcovePlayer
// Get the event emitter from the SDK
EventEmitter eventEmitter = brightcoveVideoView.getEventEmitter();
// Create a catalog request to fetch a video
String account = getString(R.string.account);
Catalog catalog = new Catalog.Builder(eventEmitter, account)
.setBaseURL(Catalog.DEFAULT_EDGE_BASE_URL)
.setPolicy(getString(R.string.policy))
.build();
// Get the video by ID
catalog.findVideoByID(getString(R.string.videoId), new VideoListener() {
@Override
public void onVideo(Video video) {
// Add video to the view
brightcoveVideoView.add(video);
// Start video playback
brightcoveVideoView.start();
}
});
XML layout is
<com.brightcove.player.view.BrightcoveExoPlayerVideoView
android:id="@+id/brightcove_video_view"
android:layout_width="match_parent"
android:layout_height="280dp"
android:layout_gravity="center_horizontal|top"/>
This is just showing video controls only not playing the videos
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
BrightCove建议将范围内的DRM受保护的含量使用 - 在Android上,您很可能会使用宽藤DRM,因为它是Android的本机DRM。
( https://sdks.support.brightcove.com/features/content-security-drm-native-native-player-sdks.html )
上面的链接包括指向样本的链接:< =“ https://github.com/brightcoveos/android-player-samples/tree/master/master/master/brightcove-exoplayer/widevinemodularsampleapp/src/src/main” rel =“ nofollow noreflow norefloll noreferrer” -player-samples/tree/tree/master/brightcove-exoplayer/widevinemodularsampleapp/src/main
Brightcove recommend using ExoPlayer for Widevine DRM protected content - on Android you will most likely be using Widevine DRM as it is the native DRM for Android.
(https://sdks.support.brightcove.com/features/content-security-drm-native-player-sdks.html)
The link above includes a link to a sample: https://github.com/BrightcoveOS/android-player-samples/tree/master/brightcove-exoplayer/WidevineModularSampleApp/src/main