Note that there are some explanatory texts on larger screens.

plurals
  1. POMPMoviePlayerController play background
    primarykey
    data
    text
    <p>I want to play video's sound in the background with MPMoviePlayerController. Past the video is running, but the background sound stops. I want to continue to sound and background (in background only sound). info.plist has Background Mode set to "Audio"</p> <pre><code> - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; [[UIApplication sharedApplication] beginReceivingRemoteControlEvents]; [self becomeFirstResponder]; } - (void)viewWillDisappear:(BOOL)animated { [super viewWillDisappear:animated]; [[UIApplication sharedApplication] endReceivingRemoteControlEvents]; [self resignFirstResponder]; } - (void)Play_Video{ [[AVAudioSession sharedInstance] setDelegate: self]; [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil]; [[AVAudioSession sharedInstance] setActive: YES error: nil]; self.movieController = [[MPMoviePlayerController alloc] init]; self.movieController.view.frame = self.view.bounds; self.movieController.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin; self.movieController.backgroundView.backgroundColor = [UIColor clearColor]; self.movieController.view.hidden = NO; self.movieController.controlStyle = MPMovieControlStyleEmbedded; [self.view addSubview:self.movieController.view]; self.movieController.useApplicationAudioSession = NO; [UrlBlock VideoURL:url success:^(NSURL *URL) { if (self.movieController) self.movieController.contentURL = URL; else self.movieController = [[MPMoviePlayerController alloc] initWithContentURL:URL]; } failure:^(NSError *error) { [self performSelectorOnMainThread:@selector(Alert:) withObject:error waitUntilDone:NO]; }]; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload