Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6829723
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:32:01+00:00 2026-05-26T22:32:01+00:00

I have an App that does the pretty standard operation: It plays audio (streamed

  • 0

I have an App that does the pretty standard operation:
It plays audio (streamed or in filesystem) when the app is in 1) Foreground mode, 2) Screen locked state 3)Background mode.
This was working fine in all iOS prior to iOS5.

I have been using MPMoviePlayerController (Because it can play streamed and local file system audio)
I have the following setup:

  1. info.plist has Background Mode set to “Audio”
  2. I have Audiosession setup as shown at http://developer.apple.com/library/ios/#qa/qa1668/_index.html

    NSError *activationError = nil;
    AVAudioSession *mySession = [AVAudioSession sharedInstance];
    [mySession setCategory: AVAudioSessionCategoryPlayback error: &activationError];
    if (activationError) { /* handle the error condition */ }
    [mySession setActive: YES error: &activationError];
    if (activationError) { /* handle the error condition */ }
    
  3. I have background timer enabled that gets stopped at the end of audio playback
    UIBackgroundTaskIdentifier newId = [[UIApplication sharedApplication]
    beginBackgroundTaskWithExpirationHandler:NULL];

  4. I have the Moveplayer’s useApplicationAudioSession = NO
  5. I have subscribed to the following events to detect and handle various playback state and to start a new audio file at the end of current file.
    MPMoviePlayerLoadStateDidChangeNotification
    MPMoviePlayerPlaybackDidFinishNotification
    MPMoviePlayerPlaybackStateDidChangeNotification
    MPMoviePlayerNowPlayingMovieDidChangeNotification

Problem:

With this the audio starts to play and when the application is put to background state or if the phone is locked, the audio continues to play. But, after when I start another audio file,
I start getting PlaybackDidFinishNotification immediately with the state set to Playback ended (But the file was never played)

The same code plays audio files in foreground mode (After the current audio file ends, the next file is started without any problem)

Is there anything new in iOS5 I should be doing to get this to work? I read through the MPMoviePlayerController class reference and I couldn’t see anything specific for iOS5.

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T22:32:01+00:00Added an answer on May 26, 2026 at 10:32 pm

    Finally figured out the issue. This is solved in this post in apple dev forums (needs login to see). That post was applicable to AVPlayer but also fixes the problem with MPMoviePlayerController as well.

    Basically, this is an excerpt from that post:

    your app must support remote control events! These are the audio
    controller interface prex/nex/play/pause on the left of the multitask
    switcher taskbar (not sure about the proper name of the thing). You
    to this ensuring your view becomes First Controller and then calling

    > [[UIApplication sharedApplication] beginReceivingRemoteControlEvents];
    

    in viewDidLoad. Once you do this, your Player will no longer return
    NO!!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a nice little app on the app store that does pretty well
I have a nice little app on the app store that does pretty well
I have an MVC app that does a lot of work with jQuery ajax
I have a Rails app that sets a cookie and does a redirect to
I have a small app that has a Render thread. All this thread does
If I have a STOMP/JSON AJAX app, does that mean that JSON is functioning
Does anyone have an XSLT that will take the app.config and render it into
have an app that finds your GPS location successfully, but I need to be
Have an app that has listings - think classified ads - and each listing
I have an app that needs to open a new window (in the same

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.