Comments (9)
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.
@kevinrenskers Just curious if you ever devised a workaround to address this?
from streamingkit.
Nope :(
from streamingkit.
Not sure why I didn't notice this issue before. I'll look into it soon.
from streamingkit.
I believe this is now fixed?
from streamingkit.
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.
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.
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.
@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)
- StreamingKit stopped working in iOS. HOT 1
- After seeking, PlayerState becomes "buffering" when a song finished playing. HOT 2
- Can I play MPEG-2 Transport Stream?
- Deadlock with playerMutex
- Weird bleeps and no metadata available when playing a SHOUTcast stream HOT 17
- cannot play .m4a files from remote url HOT 1
- play after seek time
- AUGraphStart crashes on simulator below iOS 14 HOT 1
- the player can't start use the network HOT 3
- didFinishPlayingQueueItemId never called sometimes HOT 3
- Crash HOT 5
- Just a question… HighRes audio
- 可以播放本地文件的音频吗 HOT 1
- Can I sync the StreamingKit player with lock screen player?
- Dose it support pitch ? HOT 1
- DSD Playback? HOT 5
- Very beginning of audio cut off [UPDATED with examples] HOT 2
- Failed to play audio url
- https://github.com/tumtumtum/StreamingKit
- Player cache issue HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from streamingkit.