analogcode / Swift-Radio-Pro

Professional Radio Station App for iOS!
MIT License
2.88k stars 710 forks source link

How to play the data got from CachingPlayerItem #146

Closed satyres closed 4 years ago

satyres commented 4 years ago

Hi thanks for your awesome work . i don't understand why using another AVPlayer to play sound and CachingPlayerItem can get the data cached, play it smoothly and refill the data and so on. is there a way to play the data from CachingPlayerItem ? i've tried using AVAudioPlayer with data as parameter but i don't know how to play the data , remove it from the buffer and then play the new data and so on. i didn't find a way to append Data to AVAudioPlayer without creating another instance. Thanks for your help

fethica commented 4 years ago

Hey @satyres

Good point, we are recreating the an AVPlayer instance for each stop and reload, since the radio stations need to be always in a live stream mode, but we are thinking of making it just one instance in the FRadioPlayer library to handle this type of use cases. Thanks!

satyres commented 4 years ago

@fethica Thanks so much , it would be amazing if we can cache and play simultaneously. Best regards