1

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();
Noaman Akram
  • 3,680
  • 4
  • 20
  • 37
  • May be mp4 video not supported.. – Piyush Dec 12 '13 at 08:05
  • you can refer this: http://stackoverflow.com/questions/19587880/sorry-this-video-is-not-valid-for-streaming-to-this-device-in-http-streaming-an/19632271#19632271 – Piyush Dec 12 '13 at 08:26

2 Answers2

1

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

user3106818
  • 198
  • 1
  • 2
  • 17
0

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

Behnam
  • 6,510
  • 6
  • 35
  • 65