Cannot playback video from internal storage (/data/data/com.myapp/some/folders/video.mp4)

by Mathias Lin » Wed, 04 Aug 2010 17:22:12 GMT


Sponsored Links
 tt>I have an application with a lot of media data (images and videos) that 
were previously stored on the sdcard. With that, images and videos are
displayed fine in my app.


Now, in order to secure the content more, I wanted to move the content
to the internal storage / data dir of the app, which I did. I copied all
media with a routine within my app to the data folder
(/data/data/com.myapp/some/folders/video.mp4) and adjusted the path in
my app so that it would look for the media in the internal storage data
directory and not the sdcard anymore.


Everything works fine, images are being displayed (decoded) properly,
but videos don't play. They files do exist though - I do not get a
FileNotFound exception. But an IOException:

java.io.IOException: Prepare failed.: status=0xFFFFFFFC

Why is that? Everything is handled within my one app and the videos have
been copied with the same routine as the images, thus having the same
permission settings. Looking at the stack trace, it all runs in process
id 18060).


Why I cannot playback the video from internal storage? Or how can I? Thanks.


V/MediaPlayer(18060): message received msg=100, ext1=-4, ext2=-4
E/MediaPlayer(18060): SISO TEST MEDIA_ERROR
E/MediaPlayer(18060): error (-4, -4)
V/MediaPlayer(18060): signal application thread
V/MediaPlayer(18060): callback application
V/MediaPlayer(18060): back from callback
V/MediaPlayer(18060): prepare complete - status=-4
E/MyApp(18060): vp Exception in btnVideoPause prep
E/MyApp(18060): java.io.IOException: Prepare failed.: status=0xFFFFFFFC
E/MyApp(18060): at android.media.MediaPlayer.prepare(Native Method)
E/MyApp(18060): at
com.myapp.android.activity.videoplayer.VideoPlayer.playVideo(VideoPlayer.java:302)
E/MyApp(18060): at
com.myapp.android.activity.videoplayer.VideoPlayer.surfaceCreated(VideoPlayer.java:432)


E/MyApp(18060): at
android.view.SurfaceView.updateWindow(SurfaceView.java:532)
E/MyApp(18060): at
android.view.SurfaceView.dispatchDraw(SurfaceView.java:339)

E/MyApp(18060): at android.view.ViewGroup.drawChild(ViewGroup.java:1638)
E/MyApp(18060): at
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)

E/MyApp(18060): at android.view.ViewGroup.drawChild(ViewGroup.java:1638)
E/MyApp(18060): at
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)

E/MyApp(18060): at android.view.View.draw(View.java:6796)
E/MyApp(18060): at android.widget.FrameLayout.draw(FrameLayout.java:352)
E/MyApp(18060): at android.view.ViewGroup.drawChild(ViewGroup.java:1640)
E/MyApp(18060): at
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)

E/MyApp(18060): at android.view.View.draw(View.java:6796)
E/MyApp(18060): at android.widget.FrameLayout.draw(FrameLayout.java:352)
E/MyApp(18060): at
com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1901)

E/MyApp(18060): at android.view.ViewRoot.draw(ViewRoot.java:1407)
E/MyApp(18060): at
android.view.ViewRoot.performTraversals(ViewRoot.java:1163)

E/MyApp(18060): at android.view.ViewRoot.handleMessage(ViewRoot.java:1727)
E/MyApp(18060): at android.os.Handler



Cannot playback video from internal storage (/data/data/com.myapp/some/folders/video.mp4)

by Mathias Lin » Thu, 05 Aug 2010 09:35:42 GMT


 i,

if any of the android/sdk developer team is reading this - could one
of you please briefly state whether it's generally possible to play
videos from internal storage folder (i.e. /data/data/com.mypackage.app/
files/)?
I googled for the problem I'm having and found that same question
without any reply/solution yet at

http://stackoverflow.com/questions/3038474/can-a-videoview-play-a-video-stored-on-internal-storage
http://groups.google.com/group/android-beginners/browse_thread/thread/69c6a19898bd73ae

and also tried to look at the mediaplayer source code and android dev
docs to find any hint but didn't find anything there either.

Any hint on this is much appreciated.

Thanks a lot!
Mathias


On Aug 4, 5:21pm, Mathias Lin <m...@mathiaslin.com> wrote:

--


Sponsored Links


Other Threads

1. VPN Client for Androi

Our company, Mocana, is a small embedded security company located in
San Francisco.  We've recently developed a VPN client for Android (via
a developer phone), and have it successfully connecting to Nortel and
Cisco IPSEC VPNs.  Our web site is being bombarded by users looking
for a VPN client, so they can connected securely to their company
networks.

Obviously we can't provide this to end users due to lack of kernel
access on production phones, and we don't have the necessary
relationships with the handset manufacturers to modify their distros.

Can you help us understand how you plan to move forward here, and if
we can assist or play a role?  We have many years of experience in
embedded security, and are willing to help with the project.  We'd
love to get this client out on the market to drive adoption of Android
phones and applications.

We're located in San Francisco, so not far from the Googleplex...

Phil Montgomery
Mocana Corporation

2. Unable to get members of playlist

Hello,

I am trying to get members of music playlist by following query to
content resolver on Android 1.5.

Uri s = Uri.withAppendedPath(ContentUris.withAppendedId
(Playlists.EXTERNAL_CONTENT_URI, id), Members.CONTENT_DIRECTORY);
Cursor songsCursor = cr.query(s, new String[]{}, null, null, "");

where "id" is id of existing playlist which I retrieve in previous
step and uri in "s" looks like  
content://media/external/audio/playlists/1/members

This snippet fails on some NPE deep in MediaProvider.query(...) method
as following stacktrace shows

Writing exception to parcel
java.lang.NullPointerException
        at com.android.providers.media.MediaProvider.query(MediaProvider.java:
804)
        at android.content.ContentProvider$Transport.bulkQuery
(ContentProvider.java:112)
        at android.content.ContentProviderNative.onTransact
(ContentProviderNative.java:97)
        at android.os.Binder.execTransact(Binder.java:287)
        at dalvik.system.NativeStart.run(Native Method)

I do similar thing with members of Genre and everything works as
expected.

I am about to fire bug do Android but I would like to be sure that
nobody knows what can be wrong.

Thank you.

Ondra Zahradnik
--~--~---------~--~----~------------~-------~--~----~

3. where the media decoder is figured out for playback

4. How to force an activity to display the soft keyboard?

5. Android Web browser - How is Text wrap feature implemented ?

6. touchscreen tsc2102 on I.mx27

7. Query : Mouse event codes on Android