How to play Live Streaming video in Android

前端 未结 2 375
孤街浪徒
孤街浪徒 2021-01-14 05:31

In my project I have a requirement to play live streaming video. I have seen many comments that \"live streaming is supported only from 3.0\" so that I have to use emulator

相关标签:
2条回答
  • 2021-01-14 05:54

    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.

    0 讨论(0)
  • 2021-01-14 05:56
     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();
    
    0 讨论(0)
提交回复
热议问题