开发者

Use Android MediaPlayer class to play a video from a URL

开发者 https://www.devze.com 2022-12-13 00:19 出处:网络
Can anyone 开发者_StackOverflow中文版tell me if the Android MediaPlayer class is able to play a video stored in a remote URL?

Can anyone 开发者_StackOverflow中文版tell me if the Android MediaPlayer class is able to play a video stored in a remote URL?

Just for testing purposes, can I use the URL http://localhost/video-name.3gp.


Can anyone tell me if the Android MediaPlayer class is able to play a video stored in a remoted URL?

Yes, if the video is safe for streaming.

Just for testing purposes, can I use the URL http://localhost/video-name.3gp

No. localhost is going to be the emulator itself.

Another question is if the MediaPlayer works well on the emulator?

Only if you have a fairly fast machine, and not for streaming. You absolutely need hardware to test streaming video.


Ans:- Yes

create a media player object

Mediaplayer ob=mediaplayer.Create(mediaplayerActivity.this,file);
ob.start();
ob.play()
0

精彩评论

暂无评论...
验证码 换一张
取 消