3
NSURL *url = [NSURL URLWithString:@"http://yyyyy.com/radio.m3u"];
  moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:url];

   // Register to receive a notification when the movie has finished playing.
   [[NSNotificationCenter defaultCenter] addObserver:self
                                            selector:@selector(moviePlayBackDidFinish:)
                                                name:MPMoviePlayerPlaybackDidFinishNotification
                                              object:moviePlayer];
   NSLog(@"start");
   if ([moviePlayer respondsToSelector:@selector(setFullscreen:animated:)]) {


       NSLog(@"IF");
       // Use the new 3.2 style API
       moviePlayer.controlStyle = MPMovieControlStyleNone;
       moviePlayer.shouldAutoplay = YES;
       [self.view addSubview:moviePlayer.view];
       [moviePlayer setFullscreen:YES animated:YES];
   } else {
       // Use the old 2.0 style API
      // moviePlayer.movie = MPMovieControlModeHidden;
       NSLog(@"else");
       [moviePlayer play];  
   }

上記のコードは iOS 開発で使用されていますが、m3u を 20 秒しか再生できませんが、m3u を unstoppable で完全に再生する方法については、いくつかのチュートリアルを提供してください。

4

0 に答える 0