Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can not play local video stream in iOS 7 when airplane mode is on

I started a local http server to serve video streaming:

http://localhost:55736/videos/foo.m3u8

And use MPMoviePlayerController to play it. It works well in iOS6 no matter whether airplane mode is on or not.

But in iOS 7, when airplane mode is on (or turn off both WIFI and cellular data network), I got the Error:

_itemFailedToPlayToEnd: {
kind = 1;
new = 2;
old = 0;

}

In MPMoviePlayerPlaybackDidFinishNotification handler:

NSConcreteNotification 0x146c35c0 {
  name = MPMoviePlayerPlaybackDidFinishNotification; 
  object = <MPMoviePlayerController: 0x14682b90>;
  userInfo = {
    MPMoviePlayerPlaybackDidFinishReasonUserInfoKey = 1;
    error = "Error Domain=MediaPlayerErrorDomain Code=-11800....
  }
}
like image 376
freestyler Avatar asked Sep 25 '13 14:09

freestyler


1 Answers

Try to use 127.0.0.1 instead of localhost. It worked for me

like image 92
Franck Avatar answered Nov 16 '22 12:11

Franck