0

I'm trying to implement a version of Kaltura player for my website. The problem is that when I tried to execute one of the demos that they provide on my Android device didn't worked.

http://html5video.org/kaltura-player/modules/KalturaSupport/tests/SeekApi.qunit.html

How can I make this example works on my Android phone?

4

1 回答 1

0

试试这个代码:

把它放在你的 MainActivity 中:

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


    final PlayerViewController mPlayerView = (PlayerViewController) findViewById( R.id.custom_player );
    mPlayerView.setActivity(this);
    mPlayerView.addComponents(String partnerId, String entryId,this);

}

把它放在你的 xml 文件中:

<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" >

<com.kaltura.playersdk.PlayerViewController
    android:id="@+id/custom_player"
    android:layout_width="match_parent"
    android:layout_height="200dp" 
   />

在 Manifest 文件中启用 Internet 连接:

 <uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

不要忘记将以下项目导入到您的项目中:1.google-play-services_lib 2.PlayerSDK 3.CastCompanionLibrary-android。

于 2014-09-09T09:07:20.530 回答