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:
-
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?
-
Are there any third party media players with readily available SDKs (free)?
-
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?
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.
The authors of MP4Box at GPAC provide Osmo4 for Android, an alternative video player built from scratch, software codecs included. It’s open source:
http://sourceforge.net/apps/trac/gpac/browser/trunk/gpac/applications/osmo4_android
This kind of “popup” is called a chooser and can be created with an ACTION_VIEW intent, using something like: