I'm having trouble playing a certain .3gp file (from a Dropbox link) with Android's MediaPlayer. However the file magically plays without problems from the Dropbox Android app.
I'm trying to play it using this:
Intent intent = new Intent(android.content.Intent.ACTION_VIEW);
intent.setData(Uri.parse("https://www.dropbox.com/s/zpiqwmxka6llavt/SketchyFile.3gp"));
startActivity(intent);
and my manifest contains
<uses-permission android:name="android.permission.INTERNET" />
which gives a "Can't play this video" error.
Logcat shows:
I/NuCachedSource2(89): new range: offset= 2245017
I/ChromiumHTTPDataSource(89): connect to https://dl.dropbox.com/0/view/a1crokuhpprsaeo/SketchyFile.3gp @2245017
I/NuCachedSource2(89): ERROR_END_OF_STREAM
E/MediaPlayer(3629): error (1, -2147483648)
E/MediaPlayer(3629): Error (1,-2147483648)
D/VideoView(3629): Error: 1,-2147483648
If I try to play it from the Dropbox Android app, Dropbox's video player has no problem playing it.
According to ffmpeg's ffprobe tool I could verify that the media type is not something exotic to Android.
Is Dropbox performing some weird transcoding voodoo and is there a way I can make this work in a similar way?
EDIT: Here's some more insight into DropBox's encoding voodoo.
Since I neither have the drop box app source or access to the actual file here is my best case guess that I will make on basis of a couple of assumptions.
The file is not playable by the native app because it is in a format that cannot be played there. Can you say download the file, put it in a sd card and then play it? If not, then the phone does not support this format.
Why does dropbox player play it? My guess based on same assumption is that drop box player adds its own decoding library (eg. ffmpeg ) along with it below the jni. So it can decode this.
Another possible guess: You are trying to do a streaming play of 3gp file which is not possible.HTTP pd play may be possible. Again, download it and play it from sd card, if it plays, then probably this is the issue. This file may not be hinted which it needs to be.
Drop box is playing this because perhaps the dropbox app is somehow accessing the header which is at end of file (your voodoo) through some other api?
Again both of the above are guesses from common problems i see as I neither have the dropbox app source, access to your file or know exactly how you are trying to play the video using native player.Perhaps one of the above tips help. Good luck!
EDIT: Issue seen: Nexus S does not play given file locally or from http link. Turns out remuxing to mp4 made Nexus S play it both ways. This implies 3gp support is not there in local native player in some android devices.