I am trying to play an internet radio, given by its url. Unfortunately, it looks like sounds must be embedded into the projetct, as caf files.
Is there any solution, like the one used to play video, for example ?
This is a complete GUESS because I’m a very new Corona user (still using the trial version), but at least one way might be to use one of the Web Popups to open a page where you use the HTML5 audio tag to play your audio file.
I’m trying to do the same, and the only solution I’ve found so far is to use a native webpopup to load an html using the audio tag pointing to the streaming source.
You could also point directly to the streaming source, without html, but doing that will result in opening the media player interface (not sure if that’s the name, but basically the same interface of media.playVideo).
The main problems in this approach are:
you can have only one webpopup open, so if you need to open a webpopup to show a webpage or do something you’ll interrupt the streaming
there are no way to control the playback (play/pause) or change volume
you can’t move or change opacity to a webpopup without closing and reopening it… so if you want to move it somewhere or hide it, it will stop the streaming
when you open a webpopup in Corona, even setting a transparent background, it shows as a gray block at the beginning before loading the page… I’m not sure if it’s the same in xcode, but kinda sucks because you can “feel” is something not really integrated with your app
So probably the only way to do something with streaming radio is to create a html interface to play/pause the streaming and open it with a webpopup.
By the way, I’ve tried using media.playVideo, since it can load from remote sources, and it works… but you’re stuck with the fullscreen media player interface.
It would be great if media.playSound or audio.loadStream could use remote sources. That would be the perfect solution for streaming internet radio…
Any advice? [import]uid: 9158 topic_id: 2185 reply_id: 15687[/import]
This is the html that used to work.
I changed my radio address with the one in your example and in mobile Safari it works. Haven’t tried on xcode simulator (but if it works in mobile safari I guess it should also work in a corona webview).
I really wanted to add a streaming radio, but this solution (even if it works) is quite not pro…
[html]
Radio
html { -webkit-text-size-adjust: none; } body {margin: 3px 3px 3px 3px;}
the source that i want is from this stream: www.radiosines.com
by the way…
using this method playing in webview what happens if the phone rings?
will the sound be automaticly stopped? our will continue playing?
Regards,
B
[import]uid: 17035 topic_id: 2185 reply_id: 25433[/import]
I was looking for the same (play a shoutcast radio station) and reading your posts it seems there isn’t still a good solution
I wonder if Corona developers have any plans to make something like