Не удается разрешить символ BrightcovePlayer

Я следую краткому руководству Brightcove-native-sdk-android для реализации медиаплеера.

Синхронизация с build.gradle проходит нормально, но затем при создании моего приложения я получил ошибку:

Не удается разрешить символ "BrightcovePlayer".

Я думаю, что это связано с репозиторием, упомянутым в кратком руководстве, но не может взломать основную причину. Также последовали эти вопросы:

Сейчас мой код выглядит так:

MainActivity.java

package com.example.jchavarr.helloworld;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.R;

public class MainActivity extends BrightcovePlayer  {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        brightcoveVideoView  = (BrightcoveExoPlayerVideoView) findViewById(R.id.brightcove_video_view);
    }
}

Activity_main.xml

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout 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="com.brightcove.playvideos.MainActivity">

    <!-- Implementing the player from HLS Brightcove-->
    <!-- https://support.brightcove.com/hls-playback-native-sdk-android -->
    <com.brightcove.player.view.BrightcoveExoPlayerVideoView
        android:id="@+id/brightcove_video_view"
        android:layout_width="match_parent"
        android:layout_height="280dp"
        android:layout_gravity="center"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintBottom_toBottomOf="parent"
    />

</android.support.constraint.ConstraintLayout>

AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.jchavarr.helloworld">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
    <uses-permission android:name="android.permission.INTERNET"/>
</manifest>

build.gradle (приложение)

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.3"
    defaultConfig {
        applicationId "com.example.jchavarr.helloworld"
        minSdkVersion 23
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

repositories {
    maven {
        url 'http://repo.brightcove.com/releases'
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile "com.brightcove.player:exoplayer:4.4+" //**
    //compile 'com.brightcove.player:android-sdk:6.+'
    //compile "com.brightcove.player:android-appcompat-plugin:${anpVersion}"
    testCompile 'junit:junit:4.12'
}

Нужно ли мне загружать AAR какого-либо файла? Является ли URL-адрес http://repo.brightcove.com/releases правильным репозиторием? Нужно ли размещать пакет: package com.brightcove.playvideos; в MainActivity.java


person negrotico19    schedule 16.06.2018    source источник


Ответы (1)


Исправление импортирует некоторые необходимые пакеты, не упомянутые в кратком руководстве:

import com.brightcove.player.model.DeliveryType;
import com.brightcove.player.model.Video;
import com.brightcove.player.view.BrightcoveExoPlayerVideoView;
import com.brightcove.player.view.BrightcovePlayer;
person negrotico19    schedule 16.06.2018