문제

hi i want to stream live channels using android app i have done lots of search but i couldn't find any solution

i am playing live stream using this code but it is not playing and giving error "sorry this video can not be played".

my code is

          String  link="http://cdn.livestream.com/grid/LSPlayer.swf?channel=ontveg&clip=&time=&showMoreVideos=false&hideInfo=true&autoPlay=true&lschannel=true&browseMode=false&textLines=2&hideChannelBranding=true&mode=false&allowchat=false&t=99398";

          VideoView  view1 = (VideoView) findViewById(R.id.video_view); 
          getWindow().setFormat(PixelFormat.TRANSLUCENT);

          MediaController mc = new MediaController(this); 
          mc.setMediaPlayer(view1); 

          view1.setMediaController(mc); 
          view1.setVideoURI(Uri.parse(link)); 
          view1.requestFocus(); 
          view1.start();
도움이 되었습니까?

해결책

you should use vitamio library for this issue vitamio library from here http://www.vitamio.org/en/docs/Basic/2013/0509/4.html

다른 팁

You just have to:

  1. Call prepareAsync() on the VideoView object.
  2. setOnPreparedLsitener() to your VideoView.
  3. In onPrepared() callback, requestFocus and start() the VideoView.

Good Luck

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top