微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

适用于 Android 的 Brightcove Native SDK 提供 NoClassDefFoundError

如何解决适用于 Android 的 Brightcove Native SDK 提供 NoClassDefFoundError

我的 Android 应用程序在使用适用于 Android 的 Brightcove Native SDK 时崩溃。 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>

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。