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 7569065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T15:04:47+00:00 2026-05-30T15:04:47+00:00

I am working with iOS5 . I am working on HTTPLivestream project .Here i

  • 0

I am working with iOS5.

I am working on HTTPLivestream project .Here i am using MPMovieplayer ,my problem is when application goes to background there is no audio . i am changing the plist in background mode is audio.But there is no result please help me .

AppDel

- (void)applicationDidEnterBackground:(UIApplication *)application {
  [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil];
  [[AVAudioSession sharedInstance] setActive: YES error: nil];

  UIApplication *app = [UIApplication sharedApplication];
  backgroundTask = [app beginBackgroundTaskWithExpirationHandler:^{
  }];

  dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{
  });
}

RadioControlView

  NSString *path =[[NSString alloc] initWithString:@"http://*******/alayam/alayam/playlist.m3u8"];

  audioUrl=[NSURL URLWithString:path];

  appDelegate.player =  [[MPMoviePlayerController alloc] initWithContentURL:audioUrl];
                                   [[NSNotificationCenter defaultCenter] addObserver:self 
                                                         selector:@selector(loadStateDidChange:) 
                                                             name:MPMoviePlayerLoadStateDidChangeNotification 
                                                           object:appDelegate.player];
                if ([appDelegate.player respondsToSelector:@selector(loadState)]) 
                {
                    [appDelegate.player setControlStyle:MPMovieControlModeVolumeOnly];
                    [appDelegate.player setFullscreen:YES];
                    [appDelegate.player prepareToPlay];
                 }

- (void)loadStateDidChange:(NSNotification *)notification
      {   
        [[NSNotificationCenter defaultCenter]removeObserver:self name:MPMoviePlayerLoadStateDidChangeNotification object:appDelegate.player];

      }

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-30T15:04:48+00:00Added an answer on May 30, 2026 at 3:04 pm

    If you are testing on simulator, then it’s doesn’t work on simulator, please use device. If you are using device and audio is not playing in background, then can you please email me your complete source code at khalid0491@gmail.com. I have also done in my Application.
    My code is given below.

    - (void)viewDidLoad 
    {
        [super viewDidLoad];
    
        NSError *setCategoryErr = nil;
        NSError *activationErr  = nil;
        [[AVAudioSession sharedInstance] setCategory: AVAudioSessionCategoryPlayback error: &setCategoryErr];
        [[AVAudioSession sharedInstance] setActive: YES error: &activationErr];
    }
    

    and in plist i made an array named “Required background mode” and insert an item in array name, “App Plays Audio”.

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

Sidebar

Related Questions

I am working on ios5 and have used NSURLConnectionDataDelegate in my application which really
Working in Eclipse on a Dynamic Web Project (using Tomcat (v5.5) as the app
I'm working on an iOS5 app using storyboard, and I have a method in
I'm working on a turn based iOS game using the new turn-based iOS5 API.
I am working on an iPad (iOS5) project on Xcode 4. I knew I
I am working on iOS5.I am new for SQLite. I have created database named
I am working on an iphone app in IOS5 that user storyboards. I have
My app is crashing using iOS5 and iOS4.3 iPhone simulators in Xcode 4.2, the
https://github.com/doubleencore/DETweetComposeViewController I followed twitter integration here for supporting twitter for both ios5 and ios4.
I’m working in a pure iOS5/ARC environment, so I can use __weak references as

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.