如何知道哪些Android设备支持视频播放? [英] How to know which android devices support video playback?

查看:129
本文介绍了如何知道哪些Android设备支持视频播放?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我制作了一个应用程序,可以在Android设备上查看葡萄藤视频.这些基本上是.mp4视频,它们正在加载到VideoView中.根据以下文档( http://developer.android.com/guide/appendix/media-formats.html ),Android 3+设备上支持mp4视频播放.

I've made an app to view vine videos on Android devices. These are basically .mp4 videos being loaded into a VideoView. From the following documentation (http://developer.android.com/guide/appendix/media-formats.html), mp4 video playback is supported on Android version 3+ devices.

我已经在清单文件中添加了android:minSdkVersion="11",以从下载应用程序中过滤掉较旧的android版本,但是我仍然收到运行较新版本Android(例如4.1、4.2)的用户的反馈,这些用户抱怨有关获取无法播放视频"错误消息.

I've already added a android:minSdkVersion="11" to the manifest file to filter out older android versions from downloading the app, but I'm still getting feedback from users running newer versions of Android (eg. 4.1, 4.2) that complain about getting a "Video cannot be played" error message.

由于没有办法(我知道,如果我错了,请更正我)使用模拟器测试视频播放,所以我真的不知道发生了什么.

Since there's no way (that I know of, please correct me if I'm wrong) to test video playback using the emulator, I can't really know what's going on.

是否有任何方法可以检查设备的视频播放能力或至少让模拟器播放视频,所以我可以正确解决此问题?

Is there any way to check for a device's ability to do video playback or at least get the emulator to play videos, so I can correctly fix this issue?

pd.对于那些感兴趣的人,这里是我在Google Play中的应用的链接.如您所见,我被负面评论迷住了: https ://play.google.com/store/apps/details?id = com.thirtymatches.vineflow

pd. for those interested, here's a link to my app in Google Play. As you can see, I'm being crushed by negative reviews: https://play.google.com/store/apps/details?id=com.thirtymatches.vineflow

推荐答案

如果仔细查看Google兼容性矩阵,您会发现对MP4/H264 encoding 的支持始于Android 3.0释放.早于Android 1.0的所有Android设备都支持MP4/H.264的播放,因此无需将可用性限制为较新的Android版本(除非您具有其他API兼容性要求).

If you look at the Google compatibility matrix closely, you'll see that support for MP4/H264 encoding started with the Android 3.0 release. Playback of MP4/H.264 has been supported by all Android devices back to Android 1.0, so there's no need for you to limit availability to newer releases of Android (unless you have other API compatibility needs).

通过VideoView,所有这些设备上的视频播放都是使用手机芯片组提供的硬件解码器完成的.因此,为了保证兼容性,必须将视频编码为最低公分母. Google在您链接的页面底部提供了视频编码建议"; 我还写了一个答案描述我们如何将其转码为可在所有Android设备上播放的MP4/H264格式.

Via VideoView, the video playback on all these devices is done using the hardware decoder provided by the phone's chipset. So to guarantee compatibility, the video has to be encoded to lowest-common denominator. Google provides "Video Encoding Recommendations" at the bottom of the page you linked; I also wrote an answer describing how we transcoded to a form of MP4/H264 that plays across all Android devices.

不知道Vine对它们的视频剪辑做什么,可能是不是所有视频都没有使用统一的编码器参数进行编码.他们可能会直接从手机上拿走视频并进行流式传输,而无需任何其他服务器端处理来确保广泛的兼容性.我不知道.如果是这样,您可能会发现开发一个无需显示以下内容即可显示内容的Android应用程序具有挑战性:a)实现自己的软件编解码器(例如RockPlayer,MX Player或VLC之类的应用程序)或b)在服务器上对视频进行转码(可能会违反Vine的服务条款.

Not knowing what Vine is doing with their video clips, it might be that the videos aren't all encoded with uniform encoder parameters. They might be taking the videos straight off handsets and streaming them without any additional server-side processing to ensure wide compatibility; I don't know. If that's the case, you might find it challenging to develop an Android app that can show the content without a) implementing your own software codec (as apps like RockPlayer, MX Player or VLC do) or b) transcoding the videos on a server (which probably will run afoul of Vine's terms of service).

这篇关于如何知道哪些Android设备支持视频播放?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆