简体   繁体   English

3rd 方媒体播放器 SDK 或其他选项

[英]3rd Party Media Player SDKs or other options

I'm writing an app for a multimedia website I frequent and I've run into a problem.我正在为我经常访问的多媒体网站编写应用程序,但遇到了问题。

After grabbing a video stream URL (h264 wrapped in an mp4 container) and attempting to play it with the native video player, it fails.在抓取视频 stream URL(h264 封装在 mp4 容器中)并尝试使用本机视频播放器播放后,它失败了。 This is on my Moto Droid running 2.2 (BB) and 2.3 (CM7).这是在我运行 2.2 (BB) 和 2.3 (CM7) 的 Moto Droid 上。 I've tested the app on my Xoom (3.1 stock) and it works great.我已经在我的 Xoom(3.1 股票)上测试了该应用程序,它运行良好。 I've also had a friend test it on her Xperia Arc (2.3 stock as far as i know) and it worked for her.我也有一个朋友在她的 Xperia Arc 上测试过(据我所知是 2.3 股票),它对她有用。 Makes me think it's a hardware decoder issue since I can play the stream fine using RockPlayer's software decoder but can't using the hardware one.让我认为这是硬件解码器问题,因为我可以使用 RockPlayer 的软件解码器很好地播放 stream 但不能使用硬件解码器。

So I have three things here I want to find out:所以我想在这里找出三件事:

  1. Does the native Android player support software decoding?原生Android播放器支持软件解码吗? If so, how do I tell if it's using hardware or software, and is it possible to toggle?如果是这样,我如何判断它使用的是硬件还是软件,是否可以切换?

  2. Are there any third party media players with readily available SDKs (free)?是否有任何具有现成 SDK(免费)的第三方媒体播放器?

  3. How can I just open the video in another app like Rock Player since I know it works?既然我知道它可以工作,我怎么能在另一个应用程序(如 Rock Player)中打开视频? When I download a video using the browser, it asks me what video player I want it to use.当我使用浏览器下载视频时,它会询问我希望它使用哪个视频播放器。 How can I get this to pop up within my app and then send the video to it?我怎样才能让它在我的应用程序中弹出,然后将视频发送给它?

1) Does the native Android player support software decoding. 1)原生Android播放器是否支持软件解码。 if so, how do I tell if it's using hardware or software and is it possible to toggle?如果是这样,我如何判断它是使用硬件还是软件,是否可以切换?

All you have is the default codecs.您所拥有的只是默认编解码器。 You can't "toggle" anything.你不能“切换”任何东西。 The only alternative is to provide your own software codecs, built with the Android NDK and bundled in the APK.唯一的选择是提供您自己的软件编解码器,使用 Android NDK 构建并捆绑在 APK 中。

2) are there any 3rd part media players with readily available SDKs (free). 2)是否有任何带有现成 SDK(免费)的第 3 部分媒体播放器。

The authors of MP4Box at GPAC provide Osmo4 for Android , an alternative video player built from scratch, software codecs included. GPAC的 MP4Box 的作者为 Android 提供Osmo4 ,这是一种从头开始构建的替代视频播放器,包括软件编解码器。 It's open source: http://sourceforge.net/apps/trac/gpac/browser/trunk/gpac/applications/osmo4_android它是开源的: http://sourceforge.net/apps/trac/gpac/browser/trunk/gpac/applications/osmo4_android

3) How can I just open the video in another app like Rock Player since I know it works. 3)我知道它可以工作,我怎么能在另一个应用程序中打开视频,比如 Rock Player。 When I download a video using the browser, it asks me what video player I want it to use.当我使用浏览器下载视频时,它会询问我希望它使用哪个视频播放器。 How can I get this to pop up within my app and then send the video to it?我怎样才能让它在我的应用程序中弹出,然后将视频发送给它?

This kind of "popup" is called a chooser and can be created with an ACTION_VIEW intent , using something like:这种“弹出”称为选择器,可以使用ACTION_VIEW 意图创建,使用类似:

Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(uri, "video/mp4");
startActivity(Intent.createChooser(intent, "View with:"));

1) Does the native Android player support software decoding. 1)原生Android播放器是否支持软件解码。 if so, how do I tell if it's using hardware or software and is it possible to toggle?如果是这样,我如何判断它是使用硬件还是软件,是否可以切换?

It most likely uses hardware decoders by default.默认情况下,它很可能使用硬件解码器。 There is default support for software decoder but you can't toggle them from the app level.默认支持软件解码器,但您无法从应用程序级别切换它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM