Android 2.1 - 视频问题
当我尝试在 Droid 2.1 设备上运行时,为什么我的视频播放应用程序崩溃,但在 myTouch 1.6 上运行良好?
谢谢 Chris
LogCat 展示
06-07 18:13:13.444: ERROR/AndroidRuntime(4252): java.lang.IllegalStateException
06-07 18:13:13.444: ERROR/AndroidRuntime(4252): at android.media.MediaPlayer.getVideoWidth(Native Method)
06-07 18:13:13.444: ERROR/AndroidRuntime(4252): at android.widget.VideoView$2.onPrepared(VideoView.java:290)
06-07 18:13:13.444: ERROR/AndroidRuntime(4252): at android.media.MediaPlayer$EventHandler.handleMessage(MediaPlayer.java:1152)
06-07 18:13:13.444: ERROR/AndroidRuntime(4252): at android.os.Handler.dispatchMessage(Handler.java:99)
06-07 18:13:13.444: ERROR/AndroidRuntime(4252): at android.os.Looper.loop(Looper.java:123)
06-07 18:13:13.444: ERROR/AndroidRuntime(4252): at android.app.ActivityThread.main(ActivityThread.java:4363)
06-07 18:13:13.444: ERROR/AndroidRuntime(4252): at java.lang.reflect.Method.invokeNative(Native Method)
06-07 18:13:13.444: ERROR/AndroidRuntime(4252): at java.lang.reflect.Method.invoke(Method.java:521)
06-07 18:13:13.444: ERROR/AndroidRuntime(4252): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
06-07 18:13:13.444: ERROR/AndroidRuntime(4252): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
06-07 18:13:13.444: ERROR/AndroidRuntime(4252): at dalvik.system.NativeStart.main(Native Method)
Why does my video playing app crash when I try to run on a Droid 2.1 device, but works fine with myTouch 1.6?
Thanks
Chris
LogCat shows
06-07 18:13:13.444: ERROR/AndroidRuntime(4252): java.lang.IllegalStateException
06-07 18:13:13.444: ERROR/AndroidRuntime(4252): at android.media.MediaPlayer.getVideoWidth(Native Method)
06-07 18:13:13.444: ERROR/AndroidRuntime(4252): at android.widget.VideoView$2.onPrepared(VideoView.java:290)
06-07 18:13:13.444: ERROR/AndroidRuntime(4252): at android.media.MediaPlayer$EventHandler.handleMessage(MediaPlayer.java:1152)
06-07 18:13:13.444: ERROR/AndroidRuntime(4252): at android.os.Handler.dispatchMessage(Handler.java:99)
06-07 18:13:13.444: ERROR/AndroidRuntime(4252): at android.os.Looper.loop(Looper.java:123)
06-07 18:13:13.444: ERROR/AndroidRuntime(4252): at android.app.ActivityThread.main(ActivityThread.java:4363)
06-07 18:13:13.444: ERROR/AndroidRuntime(4252): at java.lang.reflect.Method.invokeNative(Native Method)
06-07 18:13:13.444: ERROR/AndroidRuntime(4252): at java.lang.reflect.Method.invoke(Method.java:521)
06-07 18:13:13.444: ERROR/AndroidRuntime(4252): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
06-07 18:13:13.444: ERROR/AndroidRuntime(4252): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
06-07 18:13:13.444: ERROR/AndroidRuntime(4252): at dalvik.system.NativeStart.main(Native Method)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这个基于
VideoView
的示例 在我测试过的所有 Android 设备上运行良好,包括 Magic 和 DROID。尝试一下它和您的媒体剪辑,看看会发生什么。This
VideoView
-based sample works fine on all Android devices I have tested it upon, including the Magic and DROID. Experiment with it and your media clip and see what happens.