I am working on an app which is intended to play life radio by using TuneIn URLs. In TuneIn, there is an http get request in the API which provides a JSON with all the URL and its bitrates.
So http://opml.radiotime.com/Tune.ashx?id=s150147&formats=aac,mp3&render=json
will return
{ "head": { "status": "200"}, "body": [
{ "element" : "audio",
"url": "http://player.absoluteradio.co.uk/tunein.php?i=a664.aac",
"reliability": 95,
"bitrate": 64,
"media_type": "aac",
"position": 0,
"player_width": 529,
"player_height": 716,
"guide_id": "e89279187",
"is_direct": false }, { "element" : "audio",
"url": "http://player.absoluteradio.co.uk/tunein.php?i=a6low.mp3",
"reliability": 78,
"bitrate": 48,
"media_type": "mp3",
"position": 0,
"player_width": 529,
"player_height": 716,
"guide_id": "e89279188",
"is_direct": false }, { "element" : "audio",
"url": "http://player.absoluteradio.co.uk/tunein.php?i=a624.aac",
"reliability": 29,
"bitrate": 24,
"media_type": "aac",
"position": 0,
"player_width": 529,
"player_height": 716,
"guide_id": "e89279186",
"is_direct": false }] }
My first approach was to setup an AVPlayer with one of the URLs given but it didn't play.
Furthermore, If you copy and paste a URL in a chrome browser it starts downloading a file that takes forever.
Inspecting with wireshark, I finally found that the streaming URL is a different one and it is provided with the Header on the first time you request a file.
I know that has been done on android by intercepting the headers but, Is is possible to do the same on iOS?
I have been looking some libraries and MobileVLCKit seems a candidate but not sure how I am risking the possibility of my app getting rejected.
Since, streaming is very popular action nowadays, Can I achieve that in an "Apple way"
Thank you