tumtumtum / StreamingKit

A fast and extensible gapless AudioPlayer/AudioStreamer for OSX and iOS (iPhone, iPad)
Other
2.43k stars 525 forks source link

Problem with playing the next song #353

Open philippbatura opened 7 years ago

philippbatura commented 7 years ago

I have a trouble with playing queue of local (saved on device) song. I'm using this cocoapod - https://github.com/tumtumtum/StreamingKit. My first item in queue starts to play one more time after its finished. It has stopReason status NONE . Other elements has statuses .eof or .pendingNext and this is correct behaviour. What should I do in that case? All remote urls are playing correctly. Thanks!

`func audioPlayer(_ audioPlayer: STKAudioPlayer, didFinishPlayingQueueItemId queueItemId: NSObject, with stopReason: STKAudioPlayerStopReason, andProgress progress: Double, andDuration duration: Double) {

if stopReason == .eof || stopReason == .pendingNext {
    checkNextTrack()
}

if stopReason == .none {
    print("NONE")
}

if stopReason == .error || stopReason == .userAction || stopReason == .disposed {
    stop()
    resetAudioPlayer()
}`
doriansgithub commented 7 years ago

The only thing we did on that was log the error code.

NSLog(@"Error = %ld", (long)errorCode);

diegostamigni commented 5 years ago

Hi @philippbatura Is this issue this pending?