Android media player can't play ogg files - android

I'm using MediaPlayer library to stream some audio files from my server. The problem is when I want to play ogg audio file with media player in android version 4.2.2 and it's ok when I play it in android nougat. It gives me this error while preparing ogg audio file:
E/Tag: Prepare failed.: status=0x106
E/MediaPlayer: error (1, -2147483648)
E/MediaPlayer: Error (1,-2147483648)
E/MediaPlayer: stop called in state 0
Is there any alternative way to stream ogg format in all devices?
by the way there is no problem with playing mp3 files in all android versions I'v tested.
Thank you ...

First you should add <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
Then set data source, maybe:
mp = new MediaPlayer();
mp.setAudioStreamType(AudioManager.STREAM_RING); will help;
And of course prepare file before start:
mp.prepare();
mp.start();

Related

Convert CipherInputStream to FileInputStream

I am using nano-httpd to play encrypted mp3 file. I want to play encrypted file on the fly. I apply decryption AES-256 and send the CipherInputStream file to NanoHttpd but it throws exception. Actually it requires FileInputStream. Errors are stated below
return new NanoHTTPD.Response(Response.Status.OK, "audio/mpeg", CipherInputStreamFile); // here it requires FileInputStream File
**Exception**
D/MediaPlayer: Couldn't open file on client side, trying server side
E/MediaPlayer: error (1, -2147483648)
E/MediaPlayer: Error (1,-2147483648)

Error from MediaPlayer playing HLS live stream in Android 5.1

I'm getting an odd error from MediaPlayer while playing a live stream. The code was working perfectly before I upgraded my Nexus 10 to 5.1 from 5.0.x.
I get the error: error (-2147483648, 0) in the onError handler and have to stop the video. If I put a breakpoint in the error handler, the video plays perfectly on the device, so I don't know why it throws the error nor what it means.
I've tried debugging the MediaPlayer sources, but for some reason the binary on the device does not match the sources I have for 5.1. Either way it seems the error is coming up from the Native code.
I am able to play other media sources with he same code, it seems only the media with no duration information causes the error.
Here is the only useful info I get out of the log:
03-21 23:02:22.365: W/MediaPlayer(26062): info/warning (801, 0)
03-21 23:02:22.401: D/MediaPlayer(26062): getMetadata
03-21 23:02:22.416: W/MediaPlayer(26062): Stream has no duration and is therefore not seekable.
03-21 23:02:22.416: E/MediaPlayer(26062): error (-2147483648, 0)
03-21 23:02:22.427: E/MediaPlayer(26062): Error (-2147483648,0)
03-21 23:02:22.443: D/VideoView(26062): Error: -2147483648,0
03-21 23:02:22.446: W/Tag(26062): Playback error in -2147483648 info: 0
03-21 23:02:22.492: W/MediaPlayer(26062): info/warning (3, 0)
Figured it out. I was calling seekTo() with a zero value on a stream with no duration (live stream). Why it worked before, the 5.1 upgrade, I don't know.

Exception in HTML 5 audio tag in android

My eclipse android emulator throws error when I run the html5 audio tag to play a mp3 file.
My code is
<audio controls="controls" autoplay >
<source src= "audios/test.mp3" />
</audio>
and here is my error in eclipse console window is
error (1, -2147483648)
.
I could not find a solution. The code works in chrome. Please advice.
Vinod I tried the same, but the android emulator donĀ“t support until now Audio/Video reproduction when you embbed the media into the audio tag.

Gstreamer sdk media player tutorial error

I am able to successfully build and compile all the gstreamer tutorials.In case of the 5th tutorial, I gave the default uri as file://C:/users/abc/desktop/one.mp4. After building and compiling the application successfully, the output screen displays no such resource found.
Addtionally, in the same tutorial, if I fetch the file from sd card, in the case of .mp4 file, the error written is "Error received from armvideodec-omxgoogleh 264 decoder: Internal data stream error" and in case of .ts file the error is error received from element decodebin21 : Your Gstreamer installation is missing a plugin.
The logcat displays GStreamer+basesrc error. gst_base_src_activate_pull :Failed to start pull mode.Please help

Prepare failed.: status=0xFFFFFF8E

when i use MediaPlayer playing .mp3 file,the system will report error log:
Prepare failed.: status=0xFFFFFF8E
but the playing music is normal,there is not exception.
And according to my observations,as if it come out only in relatively high ROM version,such as 4.0,in 2.3 there is no error.
What is the reason, how to solve?

Categories

Resources