gpt4 book ai didi

java - Vitamio VideView 崩溃

转载 作者:太空狗 更新时间:2023-10-29 15:04:50 24 4
gpt4 key购买 nike

我正在尝试使用 Vitamio VideoView 在我的应用程序中播放流媒体视频。我已经下载了 vitamio 演示应用程序,它在我的网址上运行良好。但是,当我尝试在我的应用程序中使用它时,它会在“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);
}
});

}

这是我的 videoview 在 main.xml 中的布局:

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

最佳答案

我已经解决了这个问题! :)

首先我已经添加到 list 中

 <activity
android:name="io.vov.vitamio.activity.InitActivity"
android:configChanges="orientation|keyboardHidden|navigation"
android:launchMode="singleTop"
android:theme="@android:style/Theme.NoTitleBar"
android:windowSoftInputMode="stateAlwaysHidden" />

这是我的 onCreate():

     new AsyncTask<Object, Object, Boolean>() {
@Override
protected void onPreExecute() {
// mPD = new ProgressDialog(InitActivity.this);
// mPD.setCancelable(false);
// PD.setMessage(getString(R.string.vitamio_init_decoders));
// mPD.show();
}

@Override
protected Boolean doInBackground(Object... params) {
return Vitamio.initialize(MyMapActivity.this);
}

@Override
protected void onPostExecute(Boolean inited) {
// if (inited) {
// uiHandler.sendEmptyMessage(0);
// }
}

}.execute();

关于java - Vitamio VideView 崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23033385/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com