Code Monkey home page Code Monkey logo

Comments (9)

kevinrenskers avatar kevinrenskers commented on July 27, 2024

I've created a sample project showing the problem: https://github.com/kevinrenskers/AudjustableTest

As you can see in the viewcontroller, I have multiple datasources, when a source fails I want to fail over to the next one. When I kill the internet connection while playing datasource one, it doesn't fail over, it doesn't reach the end ("Reached last stream"). Instead it's forever stuck in AudioPlayerInternalStateWaitingForData.

from streamingkit.

DarthNerdus avatar DarthNerdus commented on July 27, 2024

@kevinrenskers Just curious if you ever devised a workaround to address this?

from streamingkit.

kevinrenskers avatar kevinrenskers commented on July 27, 2024

Nope :(

from streamingkit.

tumtumtum avatar tumtumtum commented on July 27, 2024

Not sure why I didn't notice this issue before. I'll look into it soon.

from streamingkit.

tumtumtum avatar tumtumtum commented on July 27, 2024

I believe this is now fixed?

from streamingkit.

kevinrenskers avatar kevinrenskers commented on July 27, 2024

Not really. I do sometimes get the AudioPlayerErrorDataNotFound when starting a stream when there's no internet, but not always. Sometimes it's still stuck in AudioPlayerInternalStateWaitingForData.

Also, when you loose the internet connection in the middle of the stream, you do get a AudioPlayerInternalStateError (via audioPlayer:internalStateChanged:), but NOT the AudioPlayerErrorDataNotFound (via audioPlayer:didEncounterError:). Not sure why an internal error isn't also made public?

Now my delegate has to implement both methods and listen to both error codes (AudioPlayerInternalStateError and AudioPlayerErrorDataNotFound) and handle fallbacks for both. Strange.

And like I said, the AudioPlayerErrorDataNotFound is not reliable, attempting to start a stream with no internet still often results in the audio player waiting forever.

I've updated the example app to use StreamingKit. If you could just play around with it, kill your internet connection at random times during/before a stream, you'll see the inconsistencies.

from streamingkit.

tumtumtum avatar tumtumtum commented on July 27, 2024

Things are a bit complicated because of the async/gapless nature of the player. audioPlayerDidEncounterError is not a great callback because errors need to be associated with a specific queue item. It's currently only used for "critical" errors (like unable to allocate memory for the AudioQueue buffers etc) rather than errors related to playback. I'll have a think about how better to support error conditions.

from streamingkit.

kojilab avatar kojilab commented on July 27, 2024

Is there a way to see if it's a networking problem using the library or should we just capture the error and then maybe see if there's a connection? Thanks

from streamingkit.

alexfoxy avatar alexfoxy commented on July 27, 2024

@tumtumtum Did you work out a way to notify the user that there's no internet connection when they start playback?

from streamingkit.

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.