How to broadcast online radio using Phonegap?

It's hard for me to find an iphone app built on top of phone mail to broadcast an online radio station. It should be possible, but do

try { var myaudio = new Media('http://domain.com:8000/ices',function(e) {alert(e);},function(e){alert(e);}); myaudio.play(); } catch (e) { alert('no audio support!'); } 

does not play a stream. And there are no errors. The application just freezes and there are no errors in the Xcode log console.

How do I approach this?

+4
source share
2 answers

I did this using HTML5 ... Just create an AUDIO instance and use SRC to call the STREAM URL. The music player will be visible, but you can hide it easily!

+4
source

It appears that in iOS Media api, streaming is not supported.

https://github.com/phonegap/phonegap-iphone/issues/55

If you are ready to work with code that is still under development (not sure if I have any flaws from it yet), then I wrote a plugin using the Matt Gallagher AudioStreamer classes, which so far work fine on iOS

https://github.com/devgeeks/phonegap-plugins/tree/AudioStreamer/iPhone/AudioStream

If you try it and find any errors, be sure to let me know :)

EDIT: This plugin has never been fully completed and is probably NOT the best solution. I worry that people still support this, hehe. For streaming on PhoneGap and iOS, it's probably best to use HTML5 live audio. It works.

+3
source

All Articles