4

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.

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.

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.

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. are there any 3rd part media players with readily available SDKs (free).
  3. 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?
prem30488
  • 2,828
  • 2
  • 25
  • 57
Scott
  • 493
  • 1
  • 5
  • 17

1 Answers1

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:

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

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

  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).

Community
  • 1
  • 1
Alex Cohn
  • 56,089
  • 9
  • 113
  • 307