Android Video Streaming

元气小坏坏 提交于 2019-12-05 05:06:28

问题


I need HTTP/RTSP Video Streaming with Android. Any Ideas ? Is that possible to go with JMF with Android ? Any Working examples ?

Already tried with http://davanum.wordpress.com/2007/12/29/android-videomusic-player-sample-from-local-disk-as-well-as-remote-urls/

Its not working with my case. Are there any specific types of videos that Android can stream ? Thanks.


回答1:


You don't necessarily need JMF. Android has built in support for HTTP/RTSP video streaming.

Try this:

String LINK = "type_here_the_link";
setContentView(R.layout.mediaplayer);
VideoView videoView = (VideoView) findViewById(R.id.video);
MediaController mc = new MediaController(this);
mc.setAnchorView(videoView);
mc.setMediaPlayer(videoView);
Uri video = Uri.parse(LINK);
videoView.setMediaController(mc);
videoView.setVideoURI(video);
videoView.start();


来源:https://stackoverflow.com/questions/3332773/android-video-streaming

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!