Vitamio VideoView を使用してアプリでストリーム ビデオを再生しようとしています。vitamio デモ アプリをダウンロードしましたが、私の URL で問題なく動作しました。しかし、アプリで使用しようとすると、「mVideoView.setVideoURI(Uri.parse(path));」の後にクラッシュします。
public void play ()
{
LinearLayout VideoView = (LinearLayout) findViewById(R.id.videoview);
VideoView.setVisibility(View.VISIBLE);
String path = "here is my url";
mVideoView = (VideoView) findViewById(R.id.surface_view1);
mVideoView.setVideoURI(Uri.parse(path));
MediaController mediaController = new MediaController(this);
mVideoView.setMediaController(mediaController);
mVideoView.requestFocus();
mVideoView.start();
mVideoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
@Override
public void onPrepared(MediaPlayer mediaPlayer) {
// optional need Vitamio 4.0
//mediaPlayer.setPlaybackSpeed(1.0f);
}
});
}
これは、main.xml の私の videoview のレイアウトです。
<LinearLayout
android:id="@+id/videoview"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#FFFFFF"
android:visibility="gone">
<io.vov.vitamio.widget.CenterLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<io.vov.vitamio.widget.VideoView
android:id="@+id/surface_view1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true" />
</io.vov.vitamio.widget.CenterLayout>
LogCat は次のことを示します。
04-12 20:00:00.241: E/Vitamio(16177): Error loading libs
04-12 20:00:00.241: E/Vitamio(16177): java.lang.UnsatisfiedLinkError: Cannot load library: load_library(linker.cpp:771): library "nulllibstlport_shared.so" not found
04-12 20:00:00.241: E/Vitamio(16177): at java.lang.Runtime.load(Runtime.java:340)
04-12 20:00:00.241: E/Vitamio(16177): at java.lang.System.load(System.java:507)
04-12 20:00:00.241: E/Vitamio(16177): at io.vov.vitamio.MediaPlayer.<init>(MediaPlayer.java:100)
04-12 20:00:00.241: E/Vitamio(16177): at io.vov.vitamio.MediaPlayer.<init>(MediaPlayer.java:78)
04-12 20:00:00.241: E/Vitamio(16177): at io.vov.vitamio.widget.VideoView.openVideo(VideoView.java:221)
04-12 20:00:00.241: E/Vitamio(16177): at io.vov.vitamio.widget.VideoView.access$29(VideoView.java:209)
04-12 20:00:00.241: E/Vitamio(16177): at io.vov.vitamio.widget.VideoView$9.surfaceCreated(VideoView.java:461)
04-12 20:00:00.241: E/Vitamio(16177): at android.view.SurfaceView.updateWindow(SurfaceView.java:569)
04-12 20:00:00.241: E/Vitamio(16177): at android.view.SurfaceView.access$000(SurfaceView.java:86)
04-12 20:00:00.241: E/Vitamio(16177): at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:174)
04-12 20:00:00.241: E/Vitamio(16177): at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:680)
04-12 20:00:00.241: E/Vitamio(16177): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1842)
04-12 20:00:00.241: E/Vitamio(16177): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:989)
04-12 20:00:00.241: E/Vitamio(16177): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4351)
04-12 20:00:00.241: E/Vitamio(16177): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749)
04-12 20:00:00.241: E/Vitamio(16177): at android.view.Choreographer.doCallbacks(Choreographer.java:562)
04-12 20:00:00.241: E/Vitamio(16177): at android.view.Choreographer.doFrame(Choreographer.java:532)
04-12 20:00:00.241: E/Vitamio(16177): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735)
04-12 20:00:00.241: E/Vitamio(16177): at android.os.Handler.handleCallback(Handler.java:725)
04-12 20:00:00.241: E/Vitamio(16177): at android.os.Handler.dispatchMessage(Handler.java:92)
04-12 20:00:00.241: E/Vitamio(16177): at android.os.Looper.loop(Looper.java:137)
04-12 20:00:00.241: E/Vitamio(16177): at android.app.ActivityThread.main(ActivityThread.java:5227)
04-12 20:00:00.241: E/Vitamio(16177): at java.lang.reflect.Method.invokeNative(Native Method)
04-12 20:00:00.241: E/Vitamio(16177): at java.lang.reflect.Method.invoke(Method.java:511)
04-12 20:00:00.241: E/Vitamio(16177): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795)
04-12 20:00:00.241: E/Vitamio(16177): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:562)
04-12 20:00:00.241: E/Vitamio(16177): at dalvik.system.NativeStart.main(Native Method)