fethica / FRadioPlayer

A simple radio player framework for iOS, macOS, tvOS.
https://fethica.github.io/FRadioPlayer/
MIT License
283 stars 59 forks source link

playerDidFinishPlaying method not called when song is changed #70

Closed ralspatel closed 3 years ago

ralspatel commented 3 years ago

Hi, I need to call playerDidFinishPlaying method once each song playing finish. I have a couple of songs comes from my server, need to get closure or some delegate method that can be called when a new song started playing or finished playing.

And also once the song is playing finished it will automatically start playing the next song in sequence when new songs is in queue or playlist.

is it possible?

fethica commented 3 years ago

Hi @ralspatel

The current version supports only live streams, check the FS branch it has the delegate you are looking for, I will update the main branch soon with audio file support.

ralspatel commented 3 years ago

hi @fethica

Yes, I check all the delegate methods, in my case, this method doesn't work because I got a song URL from my server so I need it to call after each song will complete.

but right now it supports only live stream, so they have multiple songs in each station. so once song will change your delegate will not called.

fethica commented 3 years ago

@ralspatel ah yes if it's a live stream, the player won't be able to detect the track duration coming from the stream, it will either return a CMTime == .zero or a CMTIME_IS_INDEFINITE

ralspatel commented 3 years ago

@fethica

Thanks for your response, this is really great library but not useful in my case. once this will update with audio file support it will be great.