Giter Club home page Giter Club logo

Comments (6)

zliuva avatar zliuva commented on July 1, 2024

it comes out of the box (there's an background-enabled iPhone example in this fork: http://github.com/jfricker/AudioStreamer), just add "audio" key in Info.plist, also you have to have the playback started at least once before your app enters background for it to work

from audiostreamer.

mbrucedogs avatar mbrucedogs commented on July 1, 2024

The one issue I have found with the AudioStreamer and this project also would have the problem is implementing a "Pause" function instead of using the Stop. The issue I have found with using pause is that in iOS4 if you pause the stream and have the app in the background this will affect other applications audio sessions.

Try to add pause to this app instead of using Stop and you will see what I am talking about. Pandora is the only app that I have seen that has solved this issue. Other Streaming apps are just doing a Stop which doesn't work if you are listening to a individual stream of a song and not a station. Example streaming a .mp3 file from a website.

from audiostreamer.

loic-prieto avatar loic-prieto commented on July 1, 2024

I don't know where else to look. I'm using the audio streamer to play a radio in my app. It all works fine until i go to background mode. There it still plays for some random time (from 1 minute to 10) and then it stops. If i resume my app, the stream is also resumed and continues to play.
Why should this happen? i've set nslogs everywhere in the audio streamer. I've put audio as an item in the UIBackgroundModes plist array, as instructed here. I think the problem has something to do with a network condition that happens wich causes the stream to pause, and then it doesn't resume. Perhaps buffering is not allowed in background? I don't know how to check what happens.

edit: i've run more tests. If i upgrade my wifi connection to a better one (the first connection i tested was somewhat poor) the background streaming lasts a lot more. I'm starting to think that this issue appears when a buffering occurs while in background mode. In foreground mode buffering works by just pausing sound until the buffer is complete again and then resumes. When in background mode, buffering stops completely until i get to foreground again.
Also, one of the last times i got the sound in the background stopped, the last nslog in the console window was showing a call to setState with a value of 6 (buffering).

from audiostreamer.

jocull avatar jocull commented on July 1, 2024

Is this background stream supposed to work on the simulator with your fork? I can't seem to get it to work. The app is clearly running in the background, but the audio stops playing (pauses) when the app is put away. It resumes where it left off when bringing the app back up.

from audiostreamer.

jocull avatar jocull commented on July 1, 2024

My mistake, it appears that background audio doesn't work on the simulator. It does work on a real device, however. I just tested it.

from audiostreamer.

genzeb avatar genzeb commented on July 1, 2024

@mbrucedogs take a look at #26 for your pause/audio-interruption issue.

from audiostreamer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.