有关android中加载MP4,3gp等视频文件,无法播放问题的解决
2010-06-27 10:15
811 查看
释怀,总算还是把这个问题给解决掉了。
在android的模拟器中加载视频文件的时候,它会提示:视频无法播放!于是,我在logcat下面找错误的日志,它有如下几行错误显示:
ERROR/PlayerDriver(31): Command PLAYER_PREPARE completed with an error or info
PVMFErrResource
: ERROR/MediaPlayer(19049): error (1, -17)
:ERROR/MediaPlayer(19049): Error (1,-17)
昨天,我反复查找,代码没有错,一时半会,陷入了死角。 我选择了暂时放弃,把它搁置在了一旁。在网上查了一些资料,没有能够找到解决问题的办法。今天,我又打开看了看,同时找了一些源码看了看,我试着在layout文件夹下的main.xml配置信息里面添加了如下的代码:
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
可以了,解决掉了。由于能力有限,我只能做如下的理解和解释,大家如果有什么不同的或更好的见解,希望予以提出,以下是我的main.xml配置文件:
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
<VideoView
android:id="@+id/video"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_gravity="center" />
</FrameLayout>
由于我是使用的FrameLayout布局的,所以我们不妨把FrameLayout当作画布canvas,固定从屏幕的左上角开始填充图片,文字等。比如说我的程序,是让视频文件显示出来,我先让文本文件显示,然后把我的视频文件填充上去,覆盖前者,去显示给客户端。
在android的模拟器中加载视频文件的时候,它会提示:视频无法播放!于是,我在logcat下面找错误的日志,它有如下几行错误显示:
ERROR/PlayerDriver(31): Command PLAYER_PREPARE completed with an error or info
PVMFErrResource
: ERROR/MediaPlayer(19049): error (1, -17)
:ERROR/MediaPlayer(19049): Error (1,-17)
昨天,我反复查找,代码没有错,一时半会,陷入了死角。 我选择了暂时放弃,把它搁置在了一旁。在网上查了一些资料,没有能够找到解决问题的办法。今天,我又打开看了看,同时找了一些源码看了看,我试着在layout文件夹下的main.xml配置信息里面添加了如下的代码:
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
可以了,解决掉了。由于能力有限,我只能做如下的理解和解释,大家如果有什么不同的或更好的见解,希望予以提出,以下是我的main.xml配置文件:
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
<VideoView
android:id="@+id/video"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_gravity="center" />
</FrameLayout>
由于我是使用的FrameLayout布局的,所以我们不妨把FrameLayout当作画布canvas,固定从屏幕的左上角开始填充图片,文字等。比如说我的程序,是让视频文件显示出来,我先让文本文件显示,然后把我的视频文件填充上去,覆盖前者,去显示给客户端。
相关文章推荐
- 解决CentOS-6下totem无法播放MP4视频文件的问题
- Android 录制的mp4视频文件在IOS中无法播放问题
- Android 录制的mp4视频文件在IOS中无法播放问题
- 解决IOS无法播放3gp视频, 出现无法编码问题
- 一个使用FFmpeg库读取3gp视频的例子-Android中使用FFmpeg媒体库(三).so文件编译过程问题的解决
- 解决FLV视频文件在服务器上无法播放的问题
- ANDROID webview解决视频无法播放问题
- 解决FLV视频文件在IIS6.0上无法播放的问题
- 关于加载flv,mp4视频文件拖动播放问题
- 解决FLV视频文件在服务器上无法播放的问题
- 解决暴风影音2012无法播放rmvb视频文件的问题
- Android WebView 无法播放视频 加载不出来等问题
- android、电脑可以播放.mp4的视频,ios无法播放解决办法
- android通过webView加载第三方h5应用,无法加载图片和播放视频的解决方法
- 解决Android中WebView视频无法播放的问题
- Android Webview完美支持播放各种视频。(解决无法播放优酷视频的问题以及周末无法播放优酷视频的问题)
- 解决Chromium浏览器Shockwave Flash无法加载播放视频的问题
- 解决FLV视频文件在IIS6.0上无法播放的问题
- Android 使用Webview无法播放视频问题的解决办法
- Android使用VideoView出现无法播放此视频问题的解决方法