Android :: Mediaplayer To Play Live Streaming Audio
Nov 8, 2010
In my music app, i would like to play live streaming like radio broadcasting with mediaplayer as Mediaplayer mp = new Mediaplayer(); mp.setDataSource(LiveStreamingURL); mp.prepare(); mp.start(); but after playing for few seconds it is stopped. I dont know how to overcome it. Give me your suggestions for this.
View 3 Replies
Dec 27, 2009
I've been trying to stream mp3's over http using Android's built in MediaPlayer class. The documentation would suggest to me that this should be as easy as :
MediaPlayer mp = new MediaPlayer();
mp.setDataSource(URL_OF_FILE);
mp.prepare();
mp.start();
However I am getting the following repeatedly. I have tried different URLs as well. Please don't tell me that streaming doesn't work on mp3's.
E/PlayerDriver( 31): Command PLAYER_SET_DATA_SOURCE completed with an error or info PVMFErrNotSupported
W/PlayerDriver( 31): PVMFInfoErrorHandlingComplete
E/MediaPlayer( 198): error (1, -4)
E/MediaPlayer( 198): start called in state 0
E/MediaPlayer( 198): error (-38, 0)
E/MediaPlayer( 198): Error (1,-4)
E/MediaPlayer( 198): Error (-38,0)
View 8 Replies
View Related
May 27, 2010
I am having the following problem: I am using Android's MediaPlayer to play an mp3 through an HTTP connection. The audio is played correctly, but the MediaPlayer returns an incorrect duration (calling mediaPlayer.getDuration() ). Depending on the mp3 the duration is either shorter or longer. The code that plays the audio is the following:
mediaPlayer = new MediaPlayer(); mediaPlayer.setOnCompletionListener(this); mediaPlayer.setOnErrorListener(this); mediaPlayer.setOnPreparedListener(this); mediaPlayer.setOnBufferingUpdateListener(this); mediaPlayer.setDataSource("a valid URL"); mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC); mediaPlayer.prepareAsync();............................
View 2 Replies
View Related
Mar 23, 2010
Where to get streaming (live) video and audio from camera example for Android? Suppose I want to create some live video streaming service app so I'll have some cool server at the back end. And I know how to do that part. Suppose I have some stand alone app for PCs now I want to go on to mobile devices. So I want to see some sample app grabing audio and video streams from Phone, Synchronizing them, encoding somehow, and sending LIVE stream to server. I need any Open-Source sample that will do this or something like this. Where can I get such one?
View 1 Replies
View Related
Nov 1, 2010
I am new in Android. I am using android os 2.2. I am trying to play streaming audio and video from url. I don't know what to do for that. after 3 days og googling i come to know that I have to use mediaPlayer and MediaController classes.I had use different differend combination of codes found on internet but not succeed.Can anybody guide me what to do for streaming audio/video playing. What about the UI if we use MediaPlayer or Controller class. is there any thing to related these in xml file of layout.if not then even please tell me what may be the code for that.please help me.
View 2 Replies
View Related
Sep 19, 2010
My favorite TV and FM stations all have links on there websites for live streaming vidoe/audio. They all have Quicktime or Windows Media links but my Evo will not plahy them. I've tried several Radio apps on the Market but no luck with them either. Is this a planned fix or do I have to go back to to a I-phone or a windows based phone?
View 7 Replies
View Related
Mar 21, 2010
The dev guide suggests this
MediaPlayer mp = new MediaPlayer();
mp.setDataSource(this, Uri.parse("http://wamu-1.streamguys.com:80"));
mp.prepare(); mp.start();
I can't seem to get it working though.
I'm getting "java.io.IOException: Prepare failed.: status=0x1"
View 6 Replies
View Related
Apr 16, 2010
I want to develop a player on Android, which can play streaming audio and video.how should i start about?
View 1 Replies
View Related
Jul 21, 2010
I am currently new to android development I been working on the examples in the Dev Guide in the android website. I want to get a stream from a server I have to play in the emulator when I insert the url it doesn't seam to want to play. My question is there a way to get the emulator to play audio or is it all enabled also does MediaPlayer require a special kind of format like mp3 or ogg? his is the code i am running on my 'onCreate()' method.
MediaPlayer mp - new MediaPlayer();
mp.setDataSource(MY_URL_);
mp.prepare();
mp.start()
View 1 Replies
View Related
Feb 17, 2009
I am developing a media player which will download the media content from network (Shoutcast) It works fine. Problem is a small gap between players (2 players) I am using two mediaplayers to play the data while a thread downloads and stores the data and stores in to 100Kb files continuously. on first players oncompletelistener() i started the second player wise versa. I think there is a problem with mp3 frames(header sync byte) while splitting 100kb files. how to resole the gap between players.
View 2 Replies
View Related
Mar 24, 2010
I'm trying to write a light-weight HTTP server in my app to feed dynamically generated MP3 data to the built-in Android MediaPlayer. I am not permitted to store my content on the SD card. My input data is essentially of an infinite length. I tell MediaPlayer that its data source should basically be something like "http://localhost/myfile.mp3". I've a simple server set up that waits for MediaPlayer to make this request. However, MediaPlayer isn't very cooperative. At first, it makes an HTTP GET and tries to grab the whole file. It times out if we try and simply dump data into the socket so we tried using the HTTP Range header to write data in chunks. MediaPlayer doesn't like this and doesn't keep requesting the subsequent chunks.
Has anyone had any success streaming data directly into MediaPlayer? Do I need to implement an RTSP or Shoutcast server instead? Am I simply missing a critical HTTP header? What strategy should I use here?.................
View 4 Replies
View Related
Nov 17, 2010
SDK level 8 (Froyo) has introduced the native capability for the MediaPlayer to connect to a streaming source, like Shoutcast. Previous SDK versions were able to do workarounds, such as run a local proxy on the device (see NPR). I took the same approach as NPR and am using a StreamProxy. However, NPR first checks if the currently running SDK is less than 8. If so, it uses the proxy. Otherwise, it connects directly. My StreamProxy requests metadata from the Shoutcast server, so it does not simply route the data from Shoutcast to my client. Instead, it parses out metadata and uses it accordingly, and only routes the music data.
When trying to use the StreamProxy at SDK level 8 or above, the MediaPlayer fails to prepare. My StreamProxy receives the connection and accepts it, but after successfully writing out the status line and headers to the client, the next write produces "java.net.SocketException: Connection reset by peer". This results in the client's mediaplayer throwing an "Error(1,-1007)". I am trying to figure out why the MediaPlayer is unable to connect to my local proxy. It should be the same as connecting to the original source without the metadata, which does work. I am forwarding on all headers from the external source, through my proxy, which includes content-type.
View 1 Replies
View Related
Dec 18, 2009
I have an app that streams mp3's from a server, works fine on 1.5 and lower. But on the droid, for certain songs the mediaplayer buffers to like over 50% but onPrepared() is never called. These same songs work fine on 1.5 or on a 2.0 emulator but for some reason they just hang on the actual droid phone. No mediaplayer errors are thrown but if i call stop or reset it while it is hanging like this, it throws this,
12-18 19:14:05.230: ERROR/MediaPlayer(15718): stop called in state 4 12-18 19:14:05.230: ERROR/MediaPlayer(15718): error (-38, 0) 12-18 19:14:05.238: ERROR/PlayerDriver(987): Command (6) was cancelled
it is only for certain files (yes they are all mp3s) and only on the droid. Anyone have any ideas why these songs would hang? I already checked the http headers and they are correct.
View 5 Replies
View Related
Sep 17, 2010
I've got a question related to the Android MediaPlayer. Can it stream content through HTTP POST method , or do I have to write my own implementation? If so, what SDK do I have to use?
View 1 Replies
View Related
Aug 25, 2010
The company I work for is developing an Android App that plays a video file from a URL on web. The
video URL is a parameter for a PHP script that encode it properly and redirects to the encoded video as shown below:
header('Content-Type: video/'.$format);
header('Location:'.$output_video);
Where $output_video is the URL to the encoded video (it works if we use this URL in the browser) and $format is the video format. But when I try executing the MediaPlayerDemo_Video from the API Demos using the streaming mode, I get an error like this:
MediaPlayer Command PLAYER INIT completed with an error or info PVMFErrCorrupt
MediaPlayer error (1. -10)
MediaPlayer Error (1.-10)
If we hard-code the URL and format in the PHP script, it also does not work out, but with a different error:
MediaPlayer info/warning (1. 28)
MediaPlayer Info (1 .28)
View 1 Replies
View Related
Sep 22, 2010
I am trying to create a small application for streaming radio broadcast that is in video/x-ms-asf format. the url has a .asx extension at the end. I have come to know that Android does not support this format currently, what other format for streaming broadcasts does it support so I can request that from the radio?
View 2 Replies
View Related
Apr 23, 2010
I am maintaining a streaming music player, and I'm running into a similar problem as http://www.last.fm/group/Last.fm+Android/forum/114391/_/593575
My player stop after roughly 1-2 minutes, and there are no log messages except for "I/AudioHardwareQSD( 52): AudioHardware pcm playback is going to standby" just after the playback stops.
This happens when I run it on the Nexus One over 3G. It does not happen over Wifi, and it does not happen on my HTC Hero with android 1.5 over 3G.
Do you guys have any hints on how to debug this? Is it e.g. possible to monitor the memory available to the media player object?
View 5 Replies
View Related
Apr 27, 2010
Does anyone know the filepath for an Archos? I'm trying to get some media/audio to play, and it just won't find it...
public void onClick(View v1) {
final MediaPlayer mp = new MediaPlayer();
try {
mp.setDataSource("ARCHOS5:/Music/manowar.mp3");
mp.start();
Toast.makeText(Textbox.this, "Working", Toast.LENGTH_LONG).show();
mp.setLooping(true);
} catch (IllegalArgumentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalStateException e) {
// TODO Auto-generated catch block
e.printStackTrace();............................
View 1 Replies
View Related
Nov 27, 2009
I am trying to make a very simple radio player for Android and I cannot get the audio streaming to work. In my latest attempt it plays for about 1 second and stops for some streams and it doesnt work at all for some other streams. Logcat doesn't give much useful information to me. I am testing on HTC Hero (Android 1.5).
If I hook the completion and buffer events I see the audio gets a complete event but it keeps buffering. Is there anything wrong with the code below? Should I be able to stream the the audio streams below? Is there a complete example somewhere of a working radio streaming?................
View 5 Replies
View Related
Feb 8, 2010
I want to create an Android application that is a client for an Internet radio station. And I want it look native to Android? But im confused with Android API logic and documentation. What i've got is that I need MediaPlayer and MediaController classes. Am I right, and is there any good example of AUDIO player for Android?
Especially, I'm very interested how to use MediaPlayer and MediaController classes together.
UPD:
Finally I've got the code, that does exactly what I want:
CODE:..............
View 1 Replies
View Related
Aug 21, 2010
I'm trying to create a way to adjust volume settings for each of the different streams (media, notification, ringtone, etc) and have a way to preview the output sound level of each stream. I believe I have the correct implementation, but when I set the output stream type, there is no sound that plays.
Here is the code that correctly plays the user's selected alarm sound:
CODE:.................
That commented out line is what is causing me problems. I would like to hear the alarm sound at the volume levels of the different audio streams, but when I include that line for STREAM_ALARM or any other audio stream, no sound at all plays.
View 1 Replies
View Related
Apr 8, 2009
Some audio files return 0 from MediaPlayer.getDuration(), even though they're perfectly valid files that play ok and that players on Windows can find the duration of. There seem to be two different cases here: certain file types such as .wma and .wav always return 0 duration, and others only do so sometimes. I haven't been able to find any pattern in the latter case, but it does seem consistent per file. The music player displays 0:00 duration for these, so it's not just my code.
View 3 Replies
View Related
Oct 13, 2009
Is it now possible mit sdk1.6 the audio decoder to access/use without using MediaPlayer ?
I saw : New version of OpenCore
Android 1.6 includes the updated OpenCore 2 media engine, which has:
* Support for OpenMAX encoders* Support for additional audio codecs in AuthorEngine* Improved buffering model supports shared buffers allocated in the decoder. but dont know how!
View 3 Replies
View Related
Jun 16, 2009
I have the following native source code that is supposed to display video. It plays 3gp file ok and I can hear the audio, but the video is not shown.
CODE:..............
View 4 Replies
View Related
Nov 18, 2009
I have a activity which is called from another activity as an intent... This activity loads and starts playing a audio file. All is good - that much works. The activity also has a "stop" button and that stops the audio from playing - that is also fine.
But how do I stop the file from playing if the user uses the back button to leave the activity without clicking on the "Stop" button?
View 3 Replies
View Related
Jun 2, 2009
Could you please let me know how to do the audio record in android emulator and play the same recorded audio. Could you please help me in proceeding in development.I tried with MediaPlayer API's also.Its not working.
View 5 Replies
View Related
Apr 28, 2009
Could I somehow trick the player on playing something of this format? I know that there is support for AAC encoded files but just how?
View 2 Replies
View Related
Jul 3, 2009
Recent news say that flash porting is finished for android and HTC Hero has support for flash. Can I use MediaPlayer API to play flv media file? Is there such documents?
View 3 Replies
View Related
Nov 4, 2010
is there an app for streaming live TV on the Epic 4g?
View 1 Replies
View Related
Nov 14, 2009
I need help on live video streaming. I want to do the following things in live video streaming.
1. I want to broadcast the live video which is recording by camera from one android mobile directly to a particular ip address.
2. now i want to play that video to another android mobile from that ip address without storing that video.
View 4 Replies
View Related