MPMoviePlayerController iOS stream m3u8 file not working

384 Views Asked by At

im trying to play a m3u8 live streaming file by using this code:

       NSURL *movieURL = [NSURL URLWithString:@"http://www.streaming507.com:1935/TVBlast/TVBlast/playlist.m3u8"];



    MPMoviePlayerController *mp = [[MPMoviePlayerController alloc] initWithContentURL:movieURL];

        [self.view addSubview:mp.view];

        [mp setFullscreen:YES animated:YES];
    mp.movieSourceType = MPMovieSourceTypeStreaming;

        [mp play];


}

when i copy/paste streaming507.com:1935/TVBlast/TVBlast/playlist.m3u8 in my device in safari browser it plays perfect and it works good how i can fix this?

I dont know what im doing wrong

thank you

1

There are 1 best solutions below

3
alexistkd On

i fix the problem by copy/paste this in my info.plist:

<key>NSAppTransportSecurity</key>
<dict>
  <!--Include to allow all connections (DANGER)-->
  <key>NSAllowsArbitraryLoads</key>
      <true/>
</dict>