【发布时间】:2021-10-06 02:40:40
【问题描述】:
使用适用于 Android 的 Brightcove Native SDK 时,我的 Android 应用程序崩溃了。 Android Studio 日志显示-
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/exoplayer2/drm/DefaultDrmSessionEventListener;
活动类-
public class SetActivity extends BrightcovePlayer {
@Override
protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_set);
BrightcoveExoPlayerVideoView brightcoveVideoView = (BrightcoveExoPlayerVideoView) findViewById(R.id.brightcove_video_view);
super.onCreate(savedInstanceState);
// Define a video from a remote server
Video video = Video.createVideo("https://learning-services-media.brightcove.com/videos/hls/greatblueheron/greatblueheron.m3u8", DeliveryType.HLS);
// Load a remote poster image
try {
java.net.URI myposterImage = new java.net.URI("https://solutions.brightcove.com/bcls/assets/images/Great-Blue-Heron.png");
video.getProperties().put(Video.Fields.STILL_IMAGE_URI, myposterImage);
} catch (URISyntaxException e) {
e.printStackTrace();
}
// Add video to the view
brightcoveVideoView.add(video);
// Start video playback
brightcoveVideoView.start();
}
}
XML
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".general_activities.SetActivity">
<com.brightcove.player.view.BrightcoveExoPlayerVideoView
android:id="@+id/brightcove_video_view"
android:layout_width="match_parent"
android:layout_height="280dp"
/>
</RelativeLayout>
【问题讨论】:
标签: android brightcove