just simple open the mediaplayer intent

All your problems with Audio, Video and Images.

just simple open the mediaplayer intent

Postby guruk » Sun Mar 08, 2009 8:17 pm

Hi,
i have a video on: http://192.168.0.179/2.mp4

when i just call:

Uri myUrl = Uri.parse("http://192.168.0.179/2.mp4");
Intent intent = new Intent(Intent.ACTION_VIEW, myUrl);
startActivity(intent);

it opens the browser and than the mediaplayer.
ok...

but how to open the mediaplayer direct, without the need of the browser
and the result just the same (you know this autorotating and standart controls as it is)

cant be so hard.. looked in so many codes, but most try own streaming and embed the
video in there page etc.

i just like to call the mediaplayer, give him the url and done.

thanks
chris
guruk
Junior Developer
Junior Developer
 
Posts: 24
Joined: Sun Mar 08, 2009 8:05 pm

Top

Re: just simple open the mediaplayer intent

Postby DeveloperAmit » Fri Mar 13, 2009 12:34 pm

May be this can help u.....
Observe the properties of intent in the log when a media file is played....
Then accordingly set the properties of your intent to directly open the mediaplayer.
DeveloperAmit
Junior Developer
Junior Developer
 
Posts: 20
Joined: Wed Mar 04, 2009 1:26 pm

Postby guruk » Tue Mar 17, 2009 8:52 pm

ok...
had a problem written here bevor (latly i changed it with this text)

It was about .. opening RTSP via INTENT

I had:

Intent i = new Intent(Intent.ACTION_VIEW);
Uri u = Uri.parse(xpath);
i.setDataAndType(u, "video/*");
startActivity(i);

and it just crashed.

But when u use:

Intent i = new Intent(Intent.ACTION_VIEW);
Uri u = Uri.parse(xpath);
i.setData(u);
startActivity(i);

it works fine for me :)

Greets
Chris
guruk
Junior Developer
Junior Developer
 
Posts: 24
Joined: Sun Mar 08, 2009 8:05 pm

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: Yahoo [Bot] and 17 guests