0

I use MPMoviePlayerController to play m3u8 stream. But it doesn't support me a method to check if the m3u8 link is working, so if the link is dead I must waiting for MPMoviePlayerController playing a while to make sure that it's not working. In this situation, I want to show an AlertView if the link is dead to keep user from not waiting before send the link to MPMoviePlayerController. Is there any way to do it ?

Suhail kalathil
  • 2,673
  • 1
  • 13
  • 12
tommy
  • 302
  • 4
  • 15

1 Answers1

1

Try this once..

Normally we check this after some time, for that we can set a time delay

[self performSelector:@selector(movieTimedOut) withObject:nil afterDelay:20.f];

-(void)movieTimedOut
{
     if (!(self.loadState & MPMovieLoadStatePlayable) || !(self.loadState & MPMovieLoadStatePlaythroughOK))
      {
           //AlertView
      }
}
Suhail kalathil
  • 2,673
  • 1
  • 13
  • 12
  • This way need to waiting for delay time, is there any way that I can check immediately if the url is alive. Something like checking the internet connection of AFNetworking?? – tommy Nov 07 '14 at 14:34