MediaPlayer can't load file from asset?

by arnouf » Fri, 22 May 2009 01:56:53 GMT


Sponsored Links
 Hi all,

I put in my assets project folder a 3GP file that I'm trying to load.
I tried to method
MediaPlayer mp = new MediaPlayer();
AssetFileDescriptor is = getAssets().openFd("video.3gp");
mp.setDataSource(is.getFileDescriptor());

and still using mp
mp.setDataSource("file:///android_assets/video.3gp");

My application is crashing with the following issue (I didn't find a
lot of help with group and Google search):
05-21 17:51:20.545: ERROR/PlayerDriver(542): Command
PLAYER_SET_DATA_SOURCE completed with an error or info
PVMFErrNotSupported
05-21 17:51:20.556: ERROR/MediaPlayer(1313): error (1, -4)

Somebody can help me?

Regards


--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. MyLocationOverlay and orientation change

Is there a relatively easy way to make sure a MyLocationOverlay gets
preserved with an orientation shift (or any other relevant
configuration change)?

The quick story is that I'm designing a somewhat simple app that maps
out the user's current location in relation to some non-moving final
destination.  I'm trying to make sure that if/when the user flips open
the phone (on the G1, at least; replace that with whatever would cause
an orientation change on any other device), the map view stays almost
the same as it was before, albeit rotated, with the same
MyLocationOverlay in place.  However, whenever I rebuild the Activity
from scratch, the blue dot has to find a fresh fix before it will
appear again (this makes sense; after all, it IS a new
MyLocationOverlay).  And I don't think I can preserve the old object,
as it takes the MapView as a part of its constructor so it knows where
to draw itself on updates, and destroying the Activity makes a new
MapView.

I already have it re-centering the map and zoom level on
reconstruction by passing such data back through the Bundle in
onSaveInstanceState.  But is there a kinda-sorta easy way to make sure
the overlay stays the way it was without having to get a new fix?
Hopefully without having the activity handle the orientation shift
itself?

Or am I going about this entirely wrong?

--~--~---------~--~----~------------~-------~--~----~

2. using main.xml and additional things?

Hi.
I have some things do draw on the screen.
So i use the main.xml file.
I start it with the command setContentView(R.layout.main) to draw the
screen.
But for some other code parts, i would need the drawString function.
I order to use it i need to use
setContentView(new SampleView(this));
to draw the screen.
My problem is now, that i cant combine setContentView(new SampleView
(this));  and setContentView(R.layout.main.
Is there an option to use both or do i have to use the one, or the
other?
Thanks

--~--~---------~--~----~------------~-------~--~----~

3. combining two view options

4. how to print foreign language font -- hebrew?

5. Utterly simple app keeps giving me "ActivityManager: [1] Killed"

6. cross compile libc for android

7. Changing size of AlertDialog