Android 中的视频无法使用 VideoView 或 MediaPlayer 启动(在 res/raw 文件夹中)
首先,我尝试了网上能找到的所有方法,但没有成功。
我正在尝试在 AVD 模拟器(版本 2.3.3)上重现视频。我使用过 VideoView 和 MediaPlayer。主要问题如下:
如果我将一些视频文件(mp4 格式)放在 res/raw 目录中,并且尝试在控制台中运行某些内容(也是一个仅带有 Hello World TextView 的避免程序),则正在运行的进程会阻止它这条线
Uploading Test.apk onto device 'emulator-5554'
我认为这是一个空间问题(视频是139MB),而且还有一个小的wmv格式(大约6MB)我也遇到了同样的问题。
我也使用过这个解决方案但它仅适用于 mp3 文件(即使只有一次)。
最后我将 RAM 设备升级到 1024MB。还是什么都没有。
onCreate方法中使用的代码是
MediaPlayer mPlayer = MediaPlayer.create(this, R.raw.video_file);
mPlayer.start();
我在Windows 7 x64中使用eclipse IDE。
感谢您的关注。
Ps logcat (仅警告和错误)
编辑:23 分钟后应用程序启动但我只听音频但看不到视频。
[2011-10-20 18:29:10 - TestActiveQoE] Uploading TestActiveQoE.apk onto device 'emulator-5554'
[2011-10-20 18:53:08 - TestActiveQoE] Installing TestActiveQoE.apk...
[2011-10-20 18:53:59 - TestActiveQoE] Success!
[2011-10-20 18:54:00 - TestActiveQoE] Starting activity qoe.test.TestActiveQoEActivity on device emulator-5554
[2011-10-20 18:54:01 - TestActiveQoE] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=qoe.test/.TestActiveQoEActivity }
First of all I have tried everything I could find on the web, but without success.
I'm trying to reproduce a video on AVD emulator (version 2.3.3). I've used both VideoView and MediaPlayer. The main problem is the following:
If I put some video file (mp4 format) on the directory res/raw and I try to run something (also an avoid program with only an Hello World TextView) in the console the running process blocks it on this line
Uploading Test.apk onto device 'emulator-5554'
I think that is a space problem (the video is 139MB) but also with a small wmv format (about 6MB) I've had the same issue.
I also have used this solution but it works only with mp3 file (even if only once).
Finally I've upgrade the RAM device up to 1024MB. Still nothing.
The code use in the onCreate method is
MediaPlayer mPlayer = MediaPlayer.create(this, R.raw.video_file);
mPlayer.start();
I use eclipse IDE in Windows 7 x64.
Thanks for your attention.
P.s. The logcat (only warns and errors)
Edit: After 23 minutes the application is started but i listen only the audio but i don't see the video.
[2011-10-20 18:29:10 - TestActiveQoE] Uploading TestActiveQoE.apk onto device 'emulator-5554'
[2011-10-20 18:53:08 - TestActiveQoE] Installing TestActiveQoE.apk...
[2011-10-20 18:53:59 - TestActiveQoE] Success!
[2011-10-20 18:54:00 - TestActiveQoE] Starting activity qoe.test.TestActiveQoEActivity on device emulator-5554
[2011-10-20 18:54:01 - TestActiveQoE] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=qoe.test/.TestActiveQoEActivity }
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论