Pregunta

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();
¿Fue útil?

Solución

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

Otros consejos

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

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top