适用于Android的Brightcove SDK,示例无法正常工作 [英] Brightcove sdk for android, example not working

查看:104
本文介绍了适用于Android的Brightcove SDK,示例无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将Brightcove sdk用于android。

I am using Brightcove sdk for android.

我将sdk添加到了libs文件夹中,并将其也添加到了依赖项中。

I added the sdk in libs folder and added it in the dependencies also.

而我使用的代码是

public class MainActivity extends BrightcovePlayer {
//private final String TAG = this.getClass().getSimpleName();

private EventEmitter eventEmitter;
// BrightcoveVideoView brightcoveVideoView;
//private GoogleIMAComponent googleIMAComponent;
private String adRulesURL = "http://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=%2F15018773%2Feverything2&ciu_szs=300x250%2C468x60%2C728x90&impl=s&gdfp_req=1&env=vp&output=xml_vast2&unviewed_position_start=1&url=dummy&correlator=[timestamp]&cmsid=133&vid=10XWSh7W4so&ad_rule=1";

@Override
protected void onCreate(Bundle savedInstanceState) {
    // When extending the BrightcovePlayer, we must assign the BrightcoveVideoView before
    // entering the superclass. This allows for some stock video player lifecycle
    // management.

    setContentView(R.layout.activity_main);
    BrightcoveVideoView brightcoveVideoView = (BrightcoveVideoView) findViewById(R.id.brightcove_video_view);
    super.onCreate(savedInstanceState);
    brightcoveVideoView.add(Video.createVideo("http://solutions.brightcove.com/bcls/assets/videos/Bird_Titmouse.mp4", DeliveryType.MP4));
    brightcoveVideoView.start();

和布局文件

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".MainActivity">

<com.brightcove.player.view.BrightcoveVideoView
    android:id="@+id/brightcove_video_view"
    android:layout_width="match_parent"
    android:layout_height="280dp"
    android:layout_gravity="center_horizontal|center_vertical" />

我得到的错误是

6366-6366/E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.NoClassDefFoundError: com.brightcove.player.R$layout
        at com.brightcove.player.controller.BrightcoveClosedCaptioningController.makeCaptionsDialog(BrightcoveClosedCaptioningController.java:114)
        at com.brightcove.player.controller.BrightcoveClosedCaptioningController.<init>(BrightcoveClosedCaptioningController.java:102)
        at com.brightcove.player.view.BaseVideoView.setEventEmitter(BaseVideoView.java:298)
        at com.brightcove.player.view.BrightcoveVideoView.setEventEmitter(BrightcoveVideoView.java:149)
        at com.brightcove.player.view.BaseVideoView.onFinishInflate(BaseVideoView.java:255)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:747)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:742)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
        at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:274)
        at android.app.Activity.setContentView(Activity.java:1835)
        at com.testproject.myapplication.MainActivity.onCreate(MainActivity.java:50)
        at android.app.Activity.performCreate(Activity.java:4470)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1053)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1934)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1995)
        at android.app.ActivityThread.access$600(ActivityThread.java:128)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1161)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:137)
        at android.app.ActivityThread.main(ActivityThread.java:4517)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:511)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:993)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:760)
        at dalvik.system.NativeStart.main(Native Method)

什么是错误。我无法理解。

What is the error. I couldn't understand.

推荐答案

我们最近在Kitkat之前增加了对自定义隐藏式字幕样式的支持,该对话框需要一些资源,如布局。这些资源包含在.aar文件中,在使用gradle和Android Studio进行编译时应使用这些资源。 Android Studio已达到1.0,因此我们建议在命令行上使用该工具或gradle进行Brightcove SDK的开发。对于旧版Eclipse开发,我们附带了旧版jar,但由于现在需要资源,因此您还必须使用apklib文件。 4.3.0发行版中缺少SDK apklib文件,但它将包含在下一发行版中。如果您无法摆脱Eclipse的困扰,那么请重新使用4.2.7版本,直到4.3.1发布为止。

We recently added support for customizing closed captioning styles on pre-Kitkat and the dialog requires some resources, like the layout. These resources are included in the .aar file, which should be used when compiling with gradle and Android Studio. Android Studio has reached 1.0, so we recommend using that or gradle on the command line for development with the Brightcove SDK. For legacy Eclipse development, we ship legacy jars, but now that resources are required, you'll also have to use apklib files. The SDK apklib file was missing from the 4.3.0 release, but it will be included in the next release. If you can't get off Eclipse, to get unblocked, you should go back to using the 4.2.7 release until 4.3.1 comes out.

这篇关于适用于Android的Brightcove SDK,示例无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆