Android :: MediaPlayer Stops Playing When Streaming Over 3G On The Nexus One
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
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
Oct 12, 2010
I have Acvtivity that creates view and mediaplayer. I want to use OnCompletion event to make that view clickable. But it throws exception, I don't know why. Probably, mediaplayer runs in another thread and cannot access elements from main ui thread?
View 1 Replies
View Related
Jan 6, 2010
Why does my MediaPlayer
MediaPlayer mp = MediaPlayer.create(this, R.raw.somemusic); mp.setLooping(true); mp.start();
stop, wenn I change the layout?
setContentView(R.layout.screenoptions);
and also suddenly in my game, the sound stops. What could be the reason?
And which one is better? MediaPlayer or SoundPool?
View 2 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
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
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
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
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
Aug 9, 2010
I have followed the steps to create my media player object but I cant understand why it is not playing the music track. I used the following code...
but no sound is playing through the emulator, and furthermore when i check the method mp.isPlaying() it returns false. What have I missed?
View 2 Replies
View Related
Oct 31, 2010
How do I get the default ringtone to play? I've tried using SoundPool (preferred method) and MediaPlayer to play it but I'm getting nowhere. I've done so many dumb things, I'll just include the last fail. In the following snippet: String ringtone = Settings.System.DEFAULT_RINGTONE_URI.getPath(); SoundPool ringPhone = new SoundPool(1, AudioManager.STREAM_RING, 0); int soundID = ringPhone.load Settings.System.DEFAULT_RINGTONE_URI.getPath(), 1); ringPhone.play(soundID, 0.99f, 0.99f, 1, 0, 1.0f);
loads but plays nothing. When I display Settings.System.DEFAULT_RINGTONE_URI.getPath(), it's returning /system/ ringtone
View 2 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
Jul 19, 2010
is there a way to find the 'noise produced' by a currently playing sound (MediaPlayer) -Like in many music editor software you import a song and it does a graphical layout of the song -like a graph with it higher up at louder bits. Hard to explain. But there must be a way to do this on android...
View 1 Replies
View Related
Jul 16, 2010
Getting reports that mp3 files <= 0.34 secs in length, are not played (or, at least, inaudible) on the Droid X. Works fine on other devices I've tried (e.g. Nexus One, Hero, G1)
All files longer than 0.34 secs are working fine. I've tested this with about 100 files (mixture of short and long) and the correlation is 100%.
View 4 Replies
View Related
Nov 20, 2009
I know other Hero users are having the same problem, and so far Slacker support has not fixed. One the screen sleeps it will finish the current song but not play a next song until you unlock the screen. I even have an app that keeps the screen from locking but allows it to go black and that causes the same issue. Anyone have a suggestion? This makes it where I can only use Slacker with the screen on which make the app almost worthless.
View 1 Replies
View Related
May 3, 2010
For those of you using Pandora have you experienced an issue that after two to three songs Pandora just stops playing as long as your phone is stationary. If you have a phone and use Pandora can you do a test that you turn up Pandora put it down on the table and let it play for at least three songs and let me know if you have an issue. Now it needs to be on the network and not WIFI and the phone MUST be stationary.
View 24 Replies
View Related
Aug 1, 2010
When I am listening to the music app, or btunes, or mix zing; about one in four times I turn the screen off, the music stops playing. I've tried turning of my task killer, but to no avail. At first, I had a second issue as well: the music would play for only about 15 mins then stop, however, I managed to figure out that that was the 'Data-Off' timer I had set for the battery's 'Smart Mode' (though I'm not sure what data has to do with playing music stored locally). Nevertheless, swapping to 'Performance Mode' solved that. But for the life of me, I cannot figure out why a quarter of the time I turn the screen off, it kills the music.
View 2 Replies
View Related
Jun 15, 2010
So I was doing a bunch of tricks for the battery and now when ever my phone locks pandora will not play until I unlock it again.. Any Ideas? Seems like some setting I turned off doesn't allow data to flow when its locked or something.
View 4 Replies
View Related
Sep 20, 2010
Just installed froyo on my T-Mobile Desire, and have been using flash to watch iplayer stuff. The problem is, if you want to listen to iplayer radio it stops playing when the screen is turned off, or if you switch to a different window. This is obviously to stop flash playing when its not used, but is there a way to maybe add Safe websites, or just turn that function off completely.
View 1 Replies
View Related
Jul 16, 2010
This doesn't always happen but when it does, Slacker stops playing after every 2 or so songs. I get a message box that reads "Warning! Unable to find active data or WiFi connection. Would you like to quit the application?" and gives me Yes or No options. Clicking No returns me to the Stations list where selecting any station returns me to the one previously playing and starts the next song when I hit Play.
View 4 Replies
View Related
Mar 17, 2013
When playing music with the stock Music Player application on my phone and turning the phone screen off or multitasking, the music is still able to play in the background. Is it possible to do the same with the stock YouTube app? I want to let the audio of the YouTube video I am watching to keep playing when I either exit out of the app or when I press the power button on my phone to turn off the screen to save battery. Although I can just set my phone screen to not go off when idle for a certain amount of time, but then again, that is battery consuming.
Phone information:
-Samsung Galaxy S Relay 4G from T-Mobile
-Ice Cream Sandwich 4.0.4
-Rooted
-No Custom Rom Installed
View 3 Replies
View Related
Nov 23, 2009
When I'm using my DROID to listening to music, after a minute the phone goes to sleep to save battery and it just cuts of the music. Is there a way to change it so even though its sleeping it'll still play? I'm going on a long trip soon and I don't want to have to take my iPod too.. I just want one music device so I have less chords.
View 4 Replies
View Related
Aug 22, 2010
If I am listening to music on the stock HTC player, and at the same time am running navigation, the voice prompts in navigation are causing the music to stop playing. Usually the music would fade back in after the voice prompt, but the music is completely stopping and has to be restarted manually. Not fun on an 8 hour drive...
View 11 Replies
View Related
Mar 27, 2012
youtube videos play for 5 minutes then stop suddenly. my wifi connection is constant and fast.
View 2 Replies
View Related
Mar 26, 2012
I got Absolution 3.7 on my htc inspire. youtube videos play for 5 minutes then stop suddenly. My wifi connection is constant and fast.
View 1 Replies
View Related