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. 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 sup开发者_运维技巧port 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?
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?
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.
2) are there any 3rd part media players with readily available SDKs (free).
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
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?
This kind of "popup" is called a chooser and can be created with an ACTION_VIEW intent, using something like:
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. 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.
精彩评论