我有一组视频剪辑,用户应该可以在我的应用程序内部播放(而不是外部视频播放器).我正在使用带有MediaController的VideoView.在我的Desire HD和Nexus S(都运行 Android 2.3.3)上,一切都按预期工作.但
所有视频均为mp4,采用H.264,720w / 480h,25fps编码.我也使用过H.263(3gp),但没有运气.
我想支持尽可能多的Android设备.至少从2.1开始
有没有人有同样的问题?您在应用中使用了哪些视频?感谢帮助!
您可以使用某些第三方媒体库扩展您的应用程序支持的格式,这里是一个很好的一个 Vitamio:Media formats
Many audio and video codecs are packed into Vitamio beside the default media format built in Android platform, some of them are listed below.divx/xvid
wmv
flv
ts
rmvb
mkv
mov
m4v
avi
mp4
3gp
不应该太难以集成并将其用于您的项目,虽然我不知道它在2.1之类的旧Android设备上运行的性能:
Vitamio provides the similiar interfaces with Android default MediaPlayer framework. If you’re using android.media.MediaPlayer in your project, just grab the vitamio.jar from above, then add it to your project’s libs, and replace the import of android.media.MediaPlayer with io.vov.vitamio.MediaPlayer.
希望这有帮助.