I'm testing the demo at,
http://docs.gstreamer.com/display/GstSDK/Android+tutorial+5%3A+A+Complete+media+player
I only changed the permissions to allow reading from the SD card, and when I try to play a MP3 file, it says, amcaudiodec-omxgooglemp3decoder0: Internal data stream error. Any idea how to fix this?
Thanks!
Edit: Ogg files work fine.
Related
We want to play m3u8 with ts files stored locally on SD card in Android 4.0 and above devices.
I tried using video TAG inside HTML residing locally on the SD card and android native media player.
Both the codes are failing with the error. The same set of ts and m3u8 files are working fine when played from online when served from a webserver connected through http.
Can we play m3u8 using native support for files stored offline or do we need to use 3rd party libraries. I searched in internet and didn’t find article about not supporting the same.
Any help or recommendation would help my work.
Thanks a lot
Issue Solved
we used nano http server to serve m3u8 file to with all videos parts. Very simple and easy way to play m3u8 video file.
I have my android app where data is packed using FileWrap. The thing is I want to wrap the mp3 data into the android file and play from that memory. I have checked the nativeaudio example in NDK which shows how to play MP3 as an asset or as a filesystem file, but it does not show how I can play an MP3 that is embedded into memory.
Please help. Thanks.
I don't think that is possible... yet.
AFAIK android opensl only supports MP3 decode & playback from a stream...
I have not seen the latest ndk release (r9b) yet, but if the opensl example app does not support in-memory, on-the-fly decoding, I doubt it is available.
Perhaps having a look here may clear things up:
https://groups.google.com/forum/#!searchin/android-ndk/opensl|sort:date/android-ndk/cMHlkyQkFU0/vMkyO2201yYJ
Or you could just dump your MP3 files in the "assets" folder and play them using the AAssetManager as per usual.
Hosting the video online is not possible nor is using an SD card a realistic solution to my issue... Due to several factors such as the likely hood that the SD cards would disappear.
So I found this, and this says it's possible: https://stackoverflow.com/a/5475436/584994
But I can't seem to get the FileInputStream correct... Under the package explorer my file is located under AppName->res->drawable->overview_animatic.mp4
and the string I am passing to FileInputStream is "/res/drawable/overview_animatic.mp4" am I doing this incorrectly?
Does the solution in the above link no longer work?
Is there a better way to play an internal video?
See the top answer for How to play videos in android from assets folder or raw folder? for an explanation of how to play a video from an application resource.
I am trying to play an .pls file (available at http://stream.radiosai.net:8002/listen.pls) in android 2.2. But it isn't working. Playing MP3 works fine.
A pls or a playlist file is basically a text file with the path of each track in each entry. Kind of like an .ini file. Take a look at the WP entry.
I don't think the inbuilt MediaPlayer supports these formats, so you'll have to download the file and parse the file and play the actual mp3's one by one.
Android doesn't support the .pls format. Link
1.how do we build our own video player in android,it will be helpful if ull can give me some code related to it.
other than the sd card where else can we place a video file and paly it.
thank you.
I tried to play a video from internal storage (i.e. /data/data/com.yourapp/files) as well but failed; I looked for this question before as well.
But it should work when using a FileDescriptor.
See the following links and discussions:
http://groups.google.com/group/android-developers/browse_thread/thread/a01d415c8e48e0d3
and a solution with code sample here:
http://www.anddev.org/multimedia-problems-f28/videoview-cannot-play-video-from-internal-storage-t16636.html#p52373