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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:03:12+00:00 2026-06-14T18:03:12+00:00

I wanted to stream a song from a server, which seems to work just

  • 0

I wanted to stream a song from a server, which seems to work just fine with the way that I have done it, but there are some things that don’t seem possible with this approach.

I’ve currently instantiated an AVPlayer

player = [[AVPlayer alloc] initWithURL:[NSURL URLWithString:@"http://media.soundcloud.com/stream/songID?stream_token=myToken"]];

And called play on it when my application deems the buffer to be sufficient.

This plays the sound perfectly fine, but I’m finding that if I stop pointing to the AVPlayer instance, the player stops and if I push the application to the background, the sound fades and pauses until the application comes back to the foreground.

Is it possible to have the song keep playing in the background with AVPlayer?

If not, should I be looking at HTTP Live Streaming instead?

I’m very new to this side of iOS and I would greatly appreciate any guidance my fellow SO-ers can give me!

  • 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-06-14T18:03:13+00:00Added an answer on June 14, 2026 at 6:03 pm

    You should explicitly enable your app to play audio in the background. Insert the following key into the Info.plist file:

    <key>UIBackgroundModes</key>
    <array>
        <string>audio</string>
    </array>
    

    (reference)

    Also add the following line before you start playing the audio:

    [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:NULL];
    

    (reference)

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

Sidebar

Related Questions

I am just messing around with an app that streams audio and I wanted
Wanted to know if there was a way one could query shelveset details from
just wanted to ask where I define initial class properties? From other languages I
I wanted to perform http streaming from red5 server so as to use it
I wanted to write a server that a client could connect to and receive
I have been researching for this and read different opinions but i wanted to
This works but I wanted to use the using keyword. Stream st = null;
A colleague just told me that this code: std::ifstream stream(filename.c_str()); if (!stream) { throw
I'm using the cerr stream for my error output, but I also wanted to
I wanted a script that automatically generates thumbnails when from a folder full of

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.