But if non-streamable video?

On 2009年12月14日, 下午5�r13分, YaushiIizuka <vse5...@gmail.com> wrote:
> Hi.
>
> String url = "http://your.url";;
> MediaPlayer mp = new MediaPlayer();
> mp.setDataSource(url);
> mp.setAudioStreamType(AudioManager.STREAM_MUSIC);
> mp.prepare();
> mp.start();
>
> On 10月23日, 午後3:28, dede <dede830...@126.com> wrote:
>
> > Hi,
> > In 1.6,I also try to play stream through setDataSource(http://
> > xxxxxxxxxxx/xxxx.mp3),
> > but also it return IOException: prepare failed, status=0x1.
> > If set the url into windows media player, it can play correctly, I
> > wanna know your problem whether be resolved?
> > If yes, can u tell me the solution,thanks very much.
>
> > On 10月7日, 上午5时41分, iwhoyt <wallace...@hotmail.com> wrote:
>
> > > In 1.5 I was able to stream an mp3 over http by passing the url to
> > > setDataSource(). However I started gettingPVMFFailures in 1.6. For
> > > me the issue was the Content-Type http header. If the header was set
> > > correctly (Content-Type: audio/mpeg), the stream played. Otherwise if
> > > failed during PLAYER_INIT.
>
> > > On Sep 2, 2:32 am, siliconeagle <rrmu...@gmail.com> wrote:
>
> > > > Also the URl is a http (MP3) stream URL - as opposed tioo other opost
> > > > where RTSP is being tried. It looks like it should just work. Has
> > > > anyone else got streaming working via a streaming URL?
>
> > > > On Sep 1, 1:24 pm, siliconeagle <rrmu...@gmail.com> wrote:
>
> > > > > I am trying to build streaming radio into my app, which works fines
> > > > > streaming files over the internet, but when i try to use a shoutcast
> > > > > url in get the error below, which from the soruce code looks liek the
> > > > > mediaPlayer is looking for the duration in the header. Does anyone
> > > > > know if shoutcast urls will work withthe default media player? Or do i
> > > > > have to download chunks into a ping-pong buffer sor something? The url
> > > > > has no porblems downloading via the browser.
>
> > > > > the error is:-
>
> > > > > 09-01 11:53:25.634 E/MediaPlayer(16972): stop called in state 1
> > > > > 09-01 11:53:27.324 D/BatteryWidget(15623): Updating Views
> > > > > 09-01 11:53:30.445 E/PlayerDriver(   35): Command PLAYER_INIT
> > > > > completed with an error or infoPVMFFailure
> > > > > 09-01 11:53:30.445 E/MediaPlayer(16972): error (1, -1)
> > > > > 09-01 11:53:30.504 I/NotificationService(   55): enqueueToast
> > > > > pkg=net.robmunro.mypod 
> > > > > callback=android.app.ITransientNotification$Stub
> > > > > $pr...@4323b8f8 duration=1000
> > > > > 09-01 11:53:30.514 W/System.err(16972): java.io.IOException: Prepare
> > > > > failed.: status=0x1
> > > > > 09-01 11:53:30.644 W/System.err(16972): at
> > > > > android.media.MediaPlayer.prepare(Native Method)
> > > > > 09-01 11:53:30.644 W/System.err(16972): at
> > > > > net.robmunro.mypod.util.MediaPlayerWrapper.playMedia
> > > > > (MediaPlayerWrapper.java:111)
>
> > > > > the code i use is:-
> > > > > try {
> > > > >         mPlayer.stop();
> > > > >         mPlayer.reset();} catch (Exception e) {
>
> > > > >         e.printStackTrace();}
>
> > > > > this.source=source;
> > > > > if (source.equals(Globals.SOURCE_LOCAL)) {
> > > > >          mPlayer.setDataSource(f.path);
> > > > >          buffered = 0;} else if 
> > > > > (source.equals(Globals.SOURCE_STREAM)) {
>
> > > > >         mPlayer.setDataSource(f.remoteUrl);
> > > > >          buffered = 100;}
>
> > > > > mPlayer.prepare();
> > > > > mPlayer.start();
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to