I am developing an app that have to stream live audio (from a m3u distant file) and I am looking for a way to check if the live-stream is “On air” or “Off air”. The audio player uses AVPlayer.
I made my homeworks, but did’nt find anything on that subject…
Thanks a lot…
When you are using a AVPlayer and AVPlayerItem, add observers like this method below:
Please don’t forget to remove these observers when stops the streaming, or in the dealloc method.
At the methods below you will manage the audio streaming:
All the variables used in the methods not declared in the scope of the method are global.
I hope this helps!