Android :: MediaPlayer Streaming From PHP Redirect Does Not Work

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)

Android :: MediaPlayer Streaming from PHP Redirect does not work


Android :: MediaPlayer.start - Doesnot Work Fine After Calling MediaPlayer.seekTo - 0

Apr 27, 2009

I have a requirement to play several sounds many times in my game so instead of creating the MediaPlayer again and again I have called mp.seekTo(0) in onCompletion(mp) so that it will restart. Sometimes the sound is not audible from the device when I call mp.start () after setting mp.seekTo(0); but the player calls onCompletion() without playing any sound, this is observed randomly on most of the sounds

My sounds are of short duration mostly less than a second.

I am using a separate MediaPlayer for each sound (as I need this) -

There are almost 28 sounds in my game so i will be creating 28 MediaPlayers.

Below is the attached code for player

Also If I try to play many sounds one after the other in a short period of time i get an error saying "no more track names available". can u tell Why this is happening...?

check the below code:

CODE:........

View 9 Replies View Related

Android :: Mediaplayer With Streaming

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

Android :: Streaming To The MediaPlayer

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

Android :: Streaming With MediaPlayer In SDK 8

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

Android :: Streaming With Mediaplayer On 2.0

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

Android :: Streaming Audio From URL Using MediaPlayer?

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

Android :: MediaPlayer Streaming MP3 Over POST

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

Android :: Mediaplayer Online Streaming Formats

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

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 View Related

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 View Related

Android :: MediaPlayer Provides Wrong Duration On Audio Streaming

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

HTC Droid Eris :: How Streaming Music Applications Work?

Dec 9, 2009

I was wondering how these apps work. I was looking into Pandora. Seems pretty cool but then I saw that in order for these "streaming" apps to work, you're basically paying for internet time the whole time you're listening to the music, right? If this is the case, why use this type of app vs. simply downloading the music files to the phone?

View 3 Replies View Related

Media :: How To Get Streaming Audio Browser Links To Work

Sep 18, 2010

I'm a subscriber to a show which I listen to on the PC while I work. I'd like to be able to listen to it on my new Droid X.There are three links on the site. The first one streams to windows media player. The second link streams to real audio. The third link downloads a podcast in mp3 format. So far I haven't figured out how to get any of them to work.The windows media link brings up a video player that says the file can not be displayed or played.The RA link downloads an .ra file. Selecting the file brings up the stock music player, which says it can't play the file. (I do have the RA beta installed but it doesn't appear to be associated with .ra files and I don't know how to fix that. Are there mime types in android?)The mp3 link gives the error "Cannot download. The content is not supported on this phone." Now that's just wrong. It's an MP3 file. The stock player should be able to play it.I'm not greedy -- I'd be happy if any one of these three possibilities worked.

View 2 Replies View Related

Android :: RTSP Streaming Video Files - Fail To Work On Android Device

Jul 10, 2010

I've Set up wowza streaming server in my ubuntu box for RTSP streaming video files. The video gets stream perfectly when I've Totem video player at client side. The same URL or video is failing to work on android device and the application that tries to access that RTSP URL breaks with Mediaplayer error (1,-1).

View 1 Replies View Related

Android :: RTSP Live Streaming Not Work On Android 1.5 / 1.6?

Jul 27, 2010

My main dev phone is a Nexus 1 running 2.2. I have successfully been streaming live video to this device from a Wowza server for several weeks now. I have now taken my application (without modifications) and put it on a Sony Ericsson Xperia running 1.6. The video will not play. I get the following errors:

MediaPlayer: Couldn't open file on client side, trying server side
... MediaPlayer: info/warning (1/26)
PlayerDriver: Command PLAYER_INIT completed with an error or info PVMFFailure
MediaPlayer: Error: (1,-1)
VideoView: Error: 1,-1

I've been googling around, but just can't seem to get a clear answer. Does anyone know if live streaming just doesn't work on some versions of Android?

View 1 Replies View Related

Motorola Droid X :: Bluetooth Audio Streaming - Steering Wheel Controls Randomly Work

Sep 1, 2010

So I use my X to stream pandora/slacker and the droid media player through my ford sync bluetooth system. I am having two separate issues I am hoping someone can comment on.

The first is that pretty much every other time I try to stream music I do not get any sound. I have to reboot my phone for it to work. Everything is paired correctly and volume it turned up etc. This is my 2nd X and they both did the same thing. Happens on 2.1 and 2.2 leak

Second is that my steering wheel controls randomly work. Sometimes the music player doesn't skip sometimes it does. Also recently if I have pandora or slacker playing and I press the skip forward button on my steering wheel the droid music player starts and I get both slacker/pandora and the droid music player playing at the same time. I should also mention i am on the 2.2 leak.

View 9 Replies View Related

Android :: Redirect In WebView

Jan 5, 2010

I am trying to open a URL using a webview. This URL redirects itself to another page. For some reason the redirect doesnot open up inside the webview. It just opens up into a new browser. Is there some setting in the webview control that can prevent this from happening?

View 3 Replies View Related

Android :: VideoView Uri Redirect?

Aug 3, 2010

I have a VideoView and I set a VideoURI that is basically http://foo.com/videoName?authentication=xyz When the url is hit, some authentication is processed, then the url gets redirected to rtsp://foo2.com/videoName.3gp for example.

The VideoView seems to not be able to follow the redirect to play the video. If I use the rtsp directly I can play the video though.

View 3 Replies View Related

Android :: Limit In Rtsp Redirect

Nov 4, 2009

I am seeing an issue when using rtsp based URLs on a wap site. If the rstp link has one redirect, then it works and default video player plays the stream. If the rtsp link redirects to another rtsp server and that server redirects to the final destination, then it does not play. Is there a limit in the # of rtsp redirects?

View 4 Replies View Related

Android :: Httpclient Redirect Handler

Nov 9, 2010

I'm trying to call a web server that is using relative URL redirects for some of the calls. This of course isn't working with DefaultHttpClient as it isn't treating it as a relative URL. I've gotten as far as implementing a RedirectHandler in an attempt to catch the redirect and add in the base call but I can't work out how to get the location of the redirect.

With the following method how do I go about finding out where I am being redirected to? I can't find any fields on either response or context that have what I need and I don't know where else to look.

public URI getLocationURI(HttpResponse response, HttpContext context)

View 1 Replies View Related

Android :: How To Redirect The Logs Into An File

Oct 16, 2009

I want to redirect the Logs into an file. How should i proceed ....?

View 2 Replies View Related

Android : How To Redirect BroadcastReceiver OnReceive?

Oct 13, 2010

What's the correct way (if any) to redirect a received Intent to another BroadcastReceiver? I have two BroadcastReceivers set to listen to the same intent. It works in development, but in production, only the first one registered in the manifest gets the intent. Can I call the other one's onReceive() method directly, passing the same context and intent? Is there a better way to pass the intent along once the first receiver is done with it?

View 1 Replies View Related

Android : How To Redirect To Particular URL While Clicking On Button

Feb 10, 2010

I want to redirect to particular URL while clicking on button

View 2 Replies View Related

Android :: How To Redirect Audio To Bluetooth Headset?

May 20, 2009

I met a problem of bluetooth headset. I want to switch audio playing to bluetooth headset when bluetooth headset is paired. I found BluetoothDevice in android sources which can control bluetooth. However it is not contained in android.jar. So I used AudioManager.setBluetoothScoOn(true)
But it still can't work.

View 16 Replies View Related

Android :: Redirect To Market Is Causing A 404 Error

Nov 24, 2010

For one of my clients they want to redirect customers who are viewing their mobile site from their android to the android market. The url is something like http://market.android.com/search?q=com.company_name , which when clicked on as a link functions correctly but if done as a redirect via php header('location : http://market.android.com/search?q=com.company_name'); will resolve to 404 page not found.

From a pc the link will never resolved, it will only work from an Android phone and only when the link is clicked on via an a href.

Summary

a href='http://market.android.com/search?q=com.company_name' - Works when clicked

header('location: http://market.android.com/search?q=com.company_name'); - Does not work: 404 error

View 1 Replies View Related

Android :: How To Redirect Users To Amazon MP3 Store?

Jul 20, 2009

I searched around but found no info on how Shazam works with Amazon MP3 Store. I would like to allow user to click on my mp3 titles and redirect this users to Amazon MP3 Store and make a revenue of clicks or purchases.

View 2 Replies View Related

Android :: Redirect Call To Voice Mail

Aug 19, 2009

I would like to automatically redirect some incoming call to voice mail. i use a "Broadcast Receiver" to cach call, it works nicely , but how to redirect to voice mail ? is it possible.

View 2 Replies View Related

Android :: Open Market - How To Redirect Users To Applications?

Sep 17, 2010

I have upload some apps in android market. Now I want to show or redirect users to my other apps. They can easily see and download other apps. Please how to open other apps or how to redirect my app in application. If any sample code that is good for me.swan

View 1 Replies View Related

Android :: How To Redirect Log Output From Logcat To SD Card On Device?

Jul 29, 2010

I'm trying to redirect the log of my app to the sdcard file. But i failed to do so. I'm trying something like this. String cmd= "logcat -v time ActivityManager:W myapp:D *:* >""+file.getAbsolutePath()+"""; Runtime. get Runtime ().exec(cmd);I tried the -f option also but it is not working either.

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved