How to play Live Streaming video in Android

别等时光非礼了梦想. 提交于 2019-12-01 08:16:14
 String SrcPath="http://akamedia2.lsops.net/live/smil:cnbc_en.smil/playlist.m3u8";
        myVideoView = new VideoView(this);
        myVideoView.setVideoURI(Uri.parse(SrcPath));
        setContentView(myVideoView);
        myVideoView.setMediaController(new MediaController(this));
        myVideoView.requestFocus();

Remove this line.

myVideoView.requestFocus();
vida

According to some threads, you should use httplive:// scheme for version 2.3 and 3.0 and the http:// scheme for 3.0+: How to play m3u8 on Android?

It worked on my 2.3 device but I'm not sure if it wold work on an emulator. Moreover, I made it work using the m3u8 test URI ( http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8 ) of apple. I can't still make it work using the my own URI.

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