Streaming Audo Player?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

cmhjon
Posts: 175
Joined: Tue Aug 04, 2015 11:55 am

Streaming Audo Player?

Post by cmhjon » Wed Dec 26, 2018 8:52 pm

Hi everyone,

I have a friend who owns operates an internet radio station. The stream is shoutcast-based. I'd like to build a simple app for iOS and Android that can stream his station only to make it easy to access. The stream can be accessed using an HTTP:port address. The app would just need to play the stream when the app is opened, have a play and stop button, and if possible, show song and artist name (maybe even show album art?) of the song being played.

Can this be done? If so, are there any app/code examples out there? Although I have built a few apps for Mac and Windows, I have never built an app for iOS/Android and don't know anything about it.

Any help would be immensely appreciated!

Thank you in advance,
Jon :)

capellan
Posts: 654
Joined: Wed Aug 15, 2007 11:09 pm

Re: Streaming Audo Player?

Post by capellan » Fri Dec 28, 2018 2:46 am

Hi Jon,

Could you use a Javascript player
inside the browser widget?

Check this HTML media player:
http://www.mediaelementjs.com/

Al

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7237
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Streaming Audo Player?

Post by jacque » Fri Dec 28, 2018 9:18 pm

I've done something similar with streaming audio using a player control. I imagine it should work just as well with a podcast, though I've never tried it. Testing would be easy, just assign the URL (including the port number) as the URL of a player and see what happens.

If it works in the IDE, then the next step is set up a mobile player and try it there.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Streaming Audo Player?

Post by Klaus » Fri Dec 28, 2018 9:26 pm

Hi friends,

FYI, I deleted the double posting from the "Rich Media" forum.


Best

Klaus

cmhjon
Posts: 175
Joined: Tue Aug 04, 2015 11:55 am

Re: Streaming Audo Player?

Post by cmhjon » Sat Dec 29, 2018 5:36 pm

Hi Jacque,

I tried adding a player object and set its source to: http://IP Address:Port Number but it does not play.

I know I have the IP and port correct as it will stream in iTunes.

Thanks,
Jon :)

cmhjon
Posts: 175
Joined: Tue Aug 04, 2015 11:55 am

Re: Streaming Audo Player?

Post by cmhjon » Sat Dec 29, 2018 5:37 pm

Sorry Klaus. I discovered the Rich Media forum after making this post and thought it was worth a try as the Rich Media forum seemed a better suited to post my question.

Best regards,
Jon

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7237
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Streaming Audo Player?

Post by jacque » Sat Dec 29, 2018 10:40 pm

cmhjon wrote:
Sat Dec 29, 2018 5:36 pm
Hi Jacque,

I tried adding a player object and set its source to: http://IP Address:Port Number but it does not play.

I know I have the IP and port correct as it will stream in iTunes.
Can you get it to work in a browser? There may be some particular format you need to use. You might try looking at the shoutcast web site and see what format their links use to play back content in a browser. I'm just guessing though, I've never needed to play streaming radio.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

cmhjon
Posts: 175
Joined: Tue Aug 04, 2015 11:55 am

Re: Streaming Audo Player?

Post by cmhjon » Mon Dec 31, 2018 7:38 pm

Hi Jacque,

I'm just not getting anywhere. This seems like it should be extremely easy to do and so far it hasn't been.

There is so much I don't understand about LC and some of the suggestions are over my head. One person asked if a JavaScript element in a widget could be used. Huh?! Yes, I know what javascript and a widget are...after that, I got nothing ha ha

Others have suggested trying it in a browser. If I try: http://IP:port/listen.pls, this works on my Android phone (if you have a player (luckily I had the VLC player app installed)) but not in Safari on a Mac. Don't know why. Firefox insists on opening it in iTunes which I suppose would be ok but not everyone has iTunes. If I try http://IP:port, this works in iTunes (via its Open Stream feature) but not a browser (this will take you to the necessary site but you must click a link to get the first URL I mentioned above to come up).

I also found this thread: https://forums.livecode.com/viewtopic.php?t=27878

That thread seems to contain code that might work (at least for mobile devices anyway) but doesn't work within native LC and I've never compiled for Android or iOS.

I've emailed LC directly.

Thank you,
Jon :)

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7237
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Streaming Audo Player?

Post by jacque » Tue Jan 01, 2019 12:07 am

Sorry I couldn't help more but you did the right thing asking the team. If they have an answer, it would be great if you could post it here for future users with the same question.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

cmhjon
Posts: 175
Joined: Tue Aug 04, 2015 11:55 am

Re: Streaming Audo Player?

Post by cmhjon » Tue Jan 01, 2019 2:01 am

Hi Jacque,

No apologies needed. I very much appreciate everyones help and I absolutely will post any solutions provided :)

Thanks,
Jon :)

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Streaming Audo Player?

Post by bogs » Tue Jan 01, 2019 12:18 pm

If I try: http://IP:port/listen.pls, this works on my Android phone (if you have a player (luckily I had the VLC player app installed)) but not in Safari on a Mac. Don't know why.
The 'why' part is easily answerable.

It works on your android phone because the VLC player app is associated in your system with playing streaming music (among other things), and it has the translation for the stream format your playing.

On your Mac, the association is to a different program, if it is there at all. It looks like this in FF -
Selection_001.png
The file association...
Image

LiveCode_Panos
Livecode Staff Member
Livecode Staff Member
Posts: 818
Joined: Fri Feb 06, 2015 4:03 pm

Re: Streaming Audo Player?

Post by LiveCode_Panos » Fri Jan 04, 2019 11:39 am

Hello Jon,

As other people have suggested, I believe either a browser widget or (preferably) a native mobile player would be the best solution here. In the other forum thread you linked, it seems that using a native mobile player has worked for another user, so I was wondering if the URL of the audio stream you set is not the one the native player expects.

What is the URL you use?

Kind regards,
Panos
--

PS: If you don't want to share the URL here, you can send it to support@livecode.com

cmhjon
Posts: 175
Joined: Tue Aug 04, 2015 11:55 am

Re: Streaming Audo Player?

Post by cmhjon » Mon Jan 07, 2019 9:24 pm

Hi Panos,

IP and port are below.

I have tried:

http://162.210.196.140:5465 (this one works in iTunes)
http://162.210.196.140:5465/Listen.pls (discovered this by doing some digging).

I get no sound using either of the above with the Player object.

Thanks,
Jon

capellan
Posts: 654
Joined: Wed Aug 15, 2007 11:09 pm

Re: Streaming Audo Player?

Post by capellan » Tue Jan 08, 2019 3:30 pm

Looks like all recent web browsers are not allowing
to play Audio Streams in "non-standards ports" and
requires an external application to handle the
audio stream playlist:

https://bugs.chromium.org/p/chromium/is ... ?id=669800

Al

cmhjon
Posts: 175
Joined: Tue Aug 04, 2015 11:55 am

Re: Streaming Audo Player?

Post by cmhjon » Thu Jan 17, 2019 4:10 pm

Hi Al,

Thank you for the info. I am sad that with all the technology out there, the only way to do this is with a browser....but it is what it is.

This seemed like it would be a simple thing to do.

Thanks again,
Jon

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”