Android Dev - 第三方媒体播放器SDK或其他选项?

时间:2021-02-25 18:58:30

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.

在抓取视频流URL(包含在mp4容器中的h264)并尝试使用本机视频播放器播放之后,它会失败。

This is on my Moto Droid running 2.2 (BB) and 2.3 (CM7). I've tested the app on my Xoom (3.1 stock) and it works great.

这是在我的Moto Droid上运行2.2(BB)和2.3(CM7)。我已经在我的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. 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.

我还有一个朋友在她的Xperia Arc上测试它(据我所知2.3库存)它对她有效。让我觉得这是一个硬件解码器问题,因为我可以使用RockPlayer的软件解码器播放流,但不能使用硬件解码器。

So I have three things here I want to find out:

所以我想在这里找到三件事:

  1. Does the native Android player support software decoding. if so, how do I tell if it's using hardware or software and is it possible to toggle?
  2. 原生Android播放器是否支持软件解码。如果是这样,我如何判断它是否使用硬件或软件,是否可以切换?
  3. are there any 3rd part media players with readily available SDKs (free).
  4. 是否有任何第三方媒体播放器提供随时可用的SDK(免费)。
  5. How can I just open the video in another app like Rock Player since I know it works. 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?
  6. 我怎么能在Rock Player等其他应用中打开视频,因为我知道它有效。当我使用浏览器下载视频时,它会询问我想要它使用的视频播放器。如何在我的应用程序中弹出这个,然后将视频发送给它?

1 个解决方案

#1


0  

  1. Yes, Android provides software h264 decoder, but it may not be available in 2.2. You can prefer software codec, see AOSP source code for stagefright:

    是的,Android提供软件h264解码器,但它可能在2.2中不可用。您可以选择软件编解码器,请参阅stagefright的AOSP源代码:

    usage: stagefright [options] [input_filename] … -s(oftware) prefer software codec …

    用法:stagefright [options] [input_filename] ... -s(oftware)更喜欢软件编解码器...

  2. ffmpeg has many derivatives and wrappers on Android, which are available with a variety of license restrictions.

    ffmpeg在Android上有许多衍生产品和包装器,它们具有各种许可限制。

  3. It's pretty easy to launch an Intent that targets a specific app. You can use setComponent() to match exactly the Activity you need. The better and more flexible way to deal with the problem is to create a custom Chooser (see e.g. Custom filtering of intent chooser based on installed Android package name), to let the user decide which player she/he prefers. With a custom chooser, you can decide to hide some of the handlers that are registered to the Action (e.g. not use the system player on Android version below 3.0).

    启动针对特定应用程序的Intent非常容易。您可以使用setComponent()来完全匹配您需要的Activity。处理问题的更好和更灵活的方法是创建自定义选择器(参见例如基于安装的Android包名称的意图选择器的自定义过滤),以让用户决定她/他喜欢哪个玩家。使用自定义选择器,您可以决定隐藏一些注册到Action的处理程序(例如,不要在3.0以下的Android版本上使用系统播放器)。

#1


0  

  1. Yes, Android provides software h264 decoder, but it may not be available in 2.2. You can prefer software codec, see AOSP source code for stagefright:

    是的,Android提供软件h264解码器,但它可能在2.2中不可用。您可以选择软件编解码器,请参阅stagefright的AOSP源代码:

    usage: stagefright [options] [input_filename] … -s(oftware) prefer software codec …

    用法:stagefright [options] [input_filename] ... -s(oftware)更喜欢软件编解码器...

  2. ffmpeg has many derivatives and wrappers on Android, which are available with a variety of license restrictions.

    ffmpeg在Android上有许多衍生产品和包装器,它们具有各种许可限制。

  3. It's pretty easy to launch an Intent that targets a specific app. You can use setComponent() to match exactly the Activity you need. The better and more flexible way to deal with the problem is to create a custom Chooser (see e.g. Custom filtering of intent chooser based on installed Android package name), to let the user decide which player she/he prefers. With a custom chooser, you can decide to hide some of the handlers that are registered to the Action (e.g. not use the system player on Android version below 3.0).

    启动针对特定应用程序的Intent非常容易。您可以使用setComponent()来完全匹配您需要的Activity。处理问题的更好和更灵活的方法是创建自定义选择器(参见例如基于安装的Android包名称的意图选择器的自定义过滤),以让用户决定她/他喜欢哪个玩家。使用自定义选择器,您可以决定隐藏一些注册到Action的处理程序(例如,不要在3.0以下的Android版本上使用系统播放器)。