Old 17th February 2003, 20:23   #1
ace_mcdeaf
Junior Member
 
Join Date: Feb 2003
Posts: 2
macromedia flash/shoutcast

OK.

How to stream a Shoutcast station from a Flash movie
Is anyone in the know?

If so, you'll be 4-ever in my heart!
- Ace
ace_mcdeaf is offline   Reply With Quote
Old 18th February 2003, 02:48   #2
GeraghtyJa
Senior Member
 
GeraghtyJa's Avatar
 
Join Date: Feb 2003
Location: NYC Metro
Posts: 209
? what do you mean exactly? do you mean? do you want to use flash to play the stream? is this for a web page?
GeraghtyJa is offline   Reply With Quote
Old 18th February 2003, 10:31   #3
ace_mcdeaf
Junior Member
 
Join Date: Feb 2003
Posts: 2
exactly.

first of all I wanna know if it can be done, it ought to. then I just need something to start with.. then I'll be fine..

thankx
ace
ace_mcdeaf is offline   Reply With Quote
Old 25th March 2003, 22:47   #4
leolodreamland
Junior Member
 
Join Date: Feb 2002
Location: Birmingham, England.
Posts: 3
Send a message via Yahoo to leolodreamland
do this... (and it still won't work) :'o(

attach this to a movie clip:
Quote:
onClipEvent (load) {mysound=new Sound(this);mysound.loadSound("http://masala.hopto.org:8000/",true);
now, when you preview the clip or publish a standalone projector or even just export the movie and double click it off your hard drive... it will stream the music from the shoutcast server...
but when you view it in a web page, it won't make any sound. can anyone tell us why???
leolodreamland is offline   Reply With Quote
Old 25th March 2003, 22:49   #5
leolodreamland
Junior Member
 
Join Date: Feb 2002
Location: Birmingham, England.
Posts: 3
Send a message via Yahoo to leolodreamland
or even this (OOPS):
Quote:
onClipEvent (load) {mysound=new Sound(this);mysound.loadSound("http://masala.hopto.org:8000/",true);
}
leolodreamland is offline   Reply With Quote
Old 26th March 2003, 18:47   #6
PureDJ.com
Junior Member
 
Join Date: Mar 2003
Location: NL
Posts: 19
Headers

In a standalone player it works cause you computer knows how to handle the shoutcast headers or something like that..

the solution mentioned before works on icecast servers.. it only supports HTTP headers... and with http headers it will work on a webpage.. unfortunatly SC uses custom ICY headers in this case...
PureDJ.com is offline   Reply With Quote
Old 26th March 2003, 20:14   #7
bill.davies
Junior Member
 
Join Date: Mar 2003
Posts: 4
Macromedia have prevented streaming content from one server through web pages hosted on another under the guise of security. In reality, they just want to boost take up of their own streaming media server which costs a fortune and is crap.

Check this guy out:

http://www.jessewarden.com/

He'll tell you all about it.
bill.davies is offline   Reply With Quote
Old 15th July 2003, 19:39   #8
Nebulus
Member
 
Join Date: Jul 2003
Posts: 70
If you use a serverside script (php or ASP) to get the playlist from another server, then that script can dish up the playlist to your flash app sitting on your site. Then the Flash can stream the audio into your app.

I've got a basic test file working, so email with any questions: pfriedl@nebulus.org
Nebulus is offline   Reply With Quote
Old 16th July 2003, 00:10   #9
SorceryKid
Senior Member
 
Join Date: Nov 2000
Posts: 294
There's no way to access content across domains. This is a very common in-browser security restriction and also applies to JavaScript/JScript/VBScript.

One possible workaround (altho, quite unlikely to work) is to request a 403 redirect to the SHOUTcast server. Another option (and I'm not very familiar with the Sound object in ActionScript), but try to load a PLS file that points to the stream instead of the stream itself.

--Randall

Executive Director, SWCI
www.smallwebcaster.org // Redefining Music Royalties for Small Webcasters

Legal Disclaimer: The information hereinbefore is not intended to constitute legal advice or consultation nor does it form a legally binding contract.
SorceryKid is offline   Reply With Quote
Old 16th July 2003, 00:47   #10
Nebulus
Member
 
Join Date: Jul 2003
Posts: 70
Well, in both standalone SWF and in a page, I was able to use the allowDomain method to get a .pls file to load from shoutCast. One interesting thing to note here is that the file I'm loading is in a Windows ini file format, not XML. The XML object loads it with no problem, and then I split on carriage returns, then loop through the array to pick out the tracks (check for "File" in the string, then split on "=").

Now, the standalone SWF will stream just fine, but the SWF embeded in a page just flat out won't work.

What I find strange is that with the sacred security model, I'm able to load XML from ShoutCast - a completely different and non compatible domain, but I can't stream and audio file? Something is messed up here. I suspect that it has something to do with the streams coming from an IP address and port - a possible Macromedia bug?

Oh, and sorry for the really nasty interface on the player - it's a test only
Attached Files
File Type: zip shoutcast_flash.zip (47.3 KB, 9484 views)
Nebulus is offline   Reply With Quote
Old 16th July 2003, 01:38   #11
SorceryKid
Senior Member
 
Join Date: Nov 2000
Posts: 294
Ooops my bad. I meant HTTP 302 redirect (mixing up my status codes since I was just in a thread about a 403 error

Executive Director, SWCI
www.smallwebcaster.org // Redefining Music Royalties for Small Webcasters

Legal Disclaimer: The information hereinbefore is not intended to constitute legal advice or consultation nor does it form a legally binding contract.
SorceryKid is offline   Reply With Quote
Old 9th August 2003, 03:46   #12
mohanad
Member
 
Join Date: Jun 2000
Posts: 65
yes, embedded flash works with live365 and icecast coz they use HTTP headers, shoutcast doesn't work coz it uses these ICY headers, users listening to my icecast stream don't download any player(no winamp, no realplayer, nothing), they just use the flash embedded player(the player is only 18k in size!)
mohanad is offline   Reply With Quote
Old 10th August 2003, 03:44   #13
skullnls
Junior Member
 
Join Date: Aug 2003
Posts: 13
could we get a copy of it?
skullnls is offline   Reply With Quote
Old 10th August 2003, 03:54   #14
DJHotIce
Forum Loser
(Forum King)
 
DJHotIce's Avatar
 
Join Date: Jan 2003
Location: That place I can't remember the name.
Posts: 4,617
Send a message via AIM to DJHotIce Send a message via Yahoo to DJHotIce
Quote:
Originally posted by Nebulus
Well, in both standalone SWF and in a page, I was able to use the allowDomain method to get a .pls file to load from shoutCast. One interesting thing to note here is that the file I'm loading is in a Windows ini file format, not XML. The XML object loads it with no problem, and then I split on carriage returns, then loop through the array to pick out the tracks (check for "File" in the string, then split on "=").

Now, the standalone SWF will stream just fine, but the SWF embeded in a page just flat out won't work.

What I find strange is that with the sacred security model, I'm able to load XML from ShoutCast - a completely different and non compatible domain, but I can't stream and audio file? Something is messed up here. I suspect that it has something to do with the streams coming from an IP address and port - a possible Macromedia bug?

Oh, and sorry for the really nasty interface on the player - it's a test only
It was said it wasn't possible maybe thats what stands!

-DJHotIce
Bounce Multimedia - Professional Web Design
DJHotIce is offline   Reply With Quote
Old 10th August 2003, 06:45   #15
SorceryKid
Senior Member
 
Join Date: Nov 2000
Posts: 294
I'm going to have to read up more about the allowDomain option. I didn't know that there were any methods or properties for cross-domain file loading within an embedded flash player (only standalone). Unfortunately I recently uninstalled Flash MX cuz of limited hard disk space. Which reminds me, time to get new hard drive

--Randall

Executive Director, SWCI
www.smallwebcaster.org // Redefining Music Royalties for Small Webcasters

Legal Disclaimer: The information hereinbefore is not intended to constitute legal advice or consultation nor does it form a legally binding contract.
SorceryKid is offline   Reply With Quote
Old 11th August 2003, 17:53   #16
mohanad
Member
 
Join Date: Jun 2000
Posts: 65
Quote:
Originally posted by skullnls
could we get a copy of it?

http://zamalekradio.port5.com

-works with icecast/live365
-includes user authentication
-ability to switch between stations
mohanad is offline   Reply With Quote
Old 12th August 2003, 01:38   #17
SorceryKid
Senior Member
 
Join Date: Nov 2000
Posts: 294
Niiice! Both the player and the music. I'm impressed.
SorceryKid is offline   Reply With Quote
Old 15th August 2003, 13:18   #18
tom_taylor
Junior Member
 
tom_taylor's Avatar
 
Join Date: Jul 2003
Location: Warrington, UK
Posts: 38
Send a message via ICQ to tom_taylor Send a message via AIM to tom_taylor Send a message via Yahoo to tom_taylor
cant we use xml or php to create http headers just like live365 and icecast

Quote:
Originally posted by mohanad
yes, embedded flash works with live365 and icecast coz they use HTTP headers, shoutcast doesn't work coz it uses these ICY headers, users listening to my icecast stream don't download any player(no winamp, no realplayer, nothing), they just use the flash embedded player(the player is only 18k in size!)
ive alrdy got the flash playing the shoutcast, but only locally on my desktop (due to the http headers aint there it wont work when embeded into a webpage and on a web server, there is a stript (well a line of code) which u can put in to allow the flash file to get the stream across a diff domain =)
tom_taylor is offline   Reply With Quote
Old 16th August 2003, 16:30   #19
tom_taylor
Junior Member
 
tom_taylor's Avatar
 
Join Date: Jul 2003
Location: Warrington, UK
Posts: 38
Send a message via ICQ to tom_taylor Send a message via AIM to tom_taylor Send a message via Yahoo to tom_taylor
an add on to my idea above ^^^

use xml or php to bring in http headers into the flash file, as well as the stream address, i dont know wether that would work better!?

cheers
tom_taylor is offline   Reply With Quote
Old 20th August 2003, 20:48   #20
mohanad
Member
 
Join Date: Jun 2000
Posts: 65
Quote:
Originally posted by tom_taylor
cant we use xml or php to create http headers just like live365 and icecast



ive alrdy got the flash playing the shoutcast, but only locally on my desktop (due to the http headers aint there it wont work when embeded into a webpage and on a web server, there is a stript (well a line of code) which u can put in to allow the flash file to get the stream across a diff domain =)
icecast and live365 uses the standard audio tags <x-audiocast>, shoutcast uses non standard tags <icy>, flash is built to only understand standard headers
mohanad is offline   Reply With Quote
Old 21st August 2003, 04:12   #21
tom_taylor
Junior Member
 
tom_taylor's Avatar
 
Join Date: Jul 2003
Location: Warrington, UK
Posts: 38
Send a message via ICQ to tom_taylor Send a message via AIM to tom_taylor Send a message via Yahoo to tom_taylor
Quote:
Originally posted by mohanad
icecast and live365 uses the standard audio tags <x-audiocast>, shoutcast uses non standard tags <icy>, flash is built to only understand standard headers
if thats the case then im sure we could use php to read the <icy> non standard headers and create them into standard ones in xml (just like the <x-audiocast> audio tags u mentioned above)?

i use php to parse the xml from the shoutcast servers we use so we get our stats live on creativeradio.co.uk, our PODplayer for easy listening and the php generated images below in my sig

we should we able to do something like that, seem as tho flash 5+ will understand xml, or php files imported as action script (let the server execute and add what we need, then flash reads the php file like any http browser/client would, alrdy tried and works =)
tom_taylor is offline   Reply With Quote
Old 26th August 2003, 01:44   #22
wahili
Junior Member
 
Join Date: Aug 2003
Posts: 40
Send a message via AIM to wahili
what happen then..does any of these flash files work? is this doable. even if i could get it work off my desktop it would be cool but in teh web page even better..whats up?
wahili is offline   Reply With Quote
Old 26th August 2003, 01:54   #23
tom_taylor
Junior Member
 
tom_taylor's Avatar
 
Join Date: Jul 2003
Location: Warrington, UK
Posts: 38
Send a message via ICQ to tom_taylor Send a message via AIM to tom_taylor Send a message via Yahoo to tom_taylor
ei yea they do work on ya desktop piss easy, just need to do the above an we can get it workin, just need a hand wid the xml and php interegation into flash, if ne1 wants to give me a hand pm me an we'll sort sumot =)
tom_taylor is offline   Reply With Quote
Old 26th August 2003, 13:24   #24
mohanad
Member
 
Join Date: Jun 2000
Posts: 65
the latest I found is that embedded flash player works for shoutcast in Mozilla and netscape (not IE), icecast and live365 works in all browsers, the problem of shoutcast+flash+IE isn't the user-agent as some people suggested because Mozilla has same user-agent as IE and Mozilla works while IE doesn't
mohanad is offline   Reply With Quote
Old 26th August 2003, 14:19   #25
mohanad
Member
 
Join Date: Jun 2000
Posts: 65
I even changed IE user-agent value in the registery to look exactly like Mozilla, so wehn I check my IE user-agent it looks like this:

The user agent string your browser is giving:

Mozilla/5.0 (Widnows; U; Windows NT 5.0)


it sill doesn't work, if if I changed this Mozilla/5.0 to whatever it doesn't work
mohanad is offline   Reply With Quote
Old 26th August 2003, 16:26   #26
tom_taylor
Junior Member
 
tom_taylor's Avatar
 
Join Date: Jul 2003
Location: Warrington, UK
Posts: 38
Send a message via ICQ to tom_taylor Send a message via AIM to tom_taylor Send a message via Yahoo to tom_taylor
so it could possibly be a bug or security thing in the flash player for ie ?
tom_taylor is offline   Reply With Quote
Old 26th August 2003, 16:40   #27
mohanad
Member
 
Join Date: Jun 2000
Posts: 65
Quote:
Originally posted by tom_taylor
so it could possibly be a bug or security thing in the flash player for ie ?

not a security thing because icecast and live365 works in IE, user-agent isn't the reason, try changing your IE user-agent and it will not work, I think it is a shoutcast problem

http://www.winguides.com/registry/display.php/799/
mohanad is offline   Reply With Quote
Old 26th August 2003, 16:52   #28
tom_taylor
Junior Member
 
tom_taylor's Avatar
 
Join Date: Jul 2003
Location: Warrington, UK
Posts: 38
Send a message via ICQ to tom_taylor Send a message via AIM to tom_taylor Send a message via Yahoo to tom_taylor
there is a security loop hole in flash, where it wont allow to access streams across domains, i fink it culd b shoutcast ur ryte, tis just wierd how it will work locally, but whern embeded onto a webpage and usin ie's user agent, its a bit wierd!
tom_taylor is offline   Reply With Quote
Old 26th August 2003, 16:59   #29
mohanad
Member
 
Join Date: Jun 2000
Posts: 65
flash works through domains, I was able to listen to live365 and icecast streams in all browsers, was able to listen to shoutcast stream in Netscape and Mozilla but not IE
mohanad is offline   Reply With Quote
Old 26th August 2003, 17:04   #30
tom_taylor
Junior Member
 
tom_taylor's Avatar
 
Join Date: Jul 2003
Location: Warrington, UK
Posts: 38
Send a message via ICQ to tom_taylor Send a message via AIM to tom_taylor Send a message via Yahoo to tom_taylor
ei yea thats ryte, well its gotta b something to do with shoutcast, flash and ie, probably is the user agent cos when u change it, it still does not work, shuld b a way to work around it, fink i ave an idea =) ill get bak to ya if it works lol
tom_taylor is offline   Reply With Quote
Old 27th August 2003, 12:45   #31
Nige_TAW
Junior Member
 
Join Date: Aug 2003
Location: cardiff, U.K
Posts: 11
Send a message via ICQ to Nige_TAW
any1 figured this out yet? i have the same problem, locally works fine, but on the web server and no joy ..
Nige_TAW is offline   Reply With Quote
Old 29th August 2003, 16:08   #32
SorceryKid
Senior Member
 
Join Date: Nov 2000
Posts: 294
Okay, I'm going to reinstall Flash MX this Saturday (yay long weekend!) so I can finally give this a try. I really like the idea of an embeded player, so I should do this anyway. I'll post my findings here.

--Randall
SorceryKid is offline   Reply With Quote
Old 29th August 2003, 20:26   #33
tom_taylor
Junior Member
 
tom_taylor's Avatar
 
Join Date: Jul 2003
Location: Warrington, UK
Posts: 38
Send a message via ICQ to tom_taylor Send a message via AIM to tom_taylor Send a message via Yahoo to tom_taylor
it does work, fink we gotta work around the bug in flash an the security flaw which does not allow to use data from different domains within a web browser, due to the http headors (shoutcast doesnt give any cos of the yp.shoutcast.com so we need to create them in an xml file or sumot!?)

it does work locally on a machine and will connect to the shoutcast server even if its on a different domain or workstation, so its the flash plugin for and internet explorer itself, as it works in gekko and mozzilla applications

wotcha wreckon then? cos after readin wot every1 else has said and tried i fink this sums it up??
tom_taylor is offline   Reply With Quote
Old 30th August 2003, 19:02   #34
mohanad
Member
 
Join Date: Jun 2000
Posts: 65
tom_taylor,
there is no security problem in flash, because it works with icecast and live365 so,

flash + (icecast or live365) + (netscape or mozilla or IE) works
flash + (shoutcast) + (netscape or mozilla) works
flash + (shoutcast) + (IE) doesn't work
mohanad is offline   Reply With Quote
Old 31st August 2003, 22:59   #35
tom_taylor
Junior Member
 
tom_taylor's Avatar
 
Join Date: Jul 2003
Location: Warrington, UK
Posts: 38
Send a message via ICQ to tom_taylor Send a message via AIM to tom_taylor Send a message via Yahoo to tom_taylor
ok so if we put the security crap 2 one side, is it due to the fact that icecast and live365 use http headers, and shoutcast does not as it has the yp (yellow pages)

ova than that i cant understand it, or cant we dummy it and use xml to bring the stream in?? or an external actionscript file, which we can generate info via php or wot eva (just runnin sum ideas off like)
tom_taylor is offline   Reply With Quote
Old 1st March 2004, 23:27   #36
JesterXL
Junior Member
 
Join Date: Mar 2004
Posts: 1
Works in Central

Shoutcast + Flash 6.0.65.0 + Central v1 = works

F'n A... I hated IE anyway.

BTW, anyone ever figured out how to parse those ICY headers? I can help with both PHP, XML, and Flash stuff.

--JesterXL
JesterXL is offline   Reply With Quote
Old 6th March 2004, 01:38   #37
notsozen
Junior Member
 
Join Date: Mar 2004
Posts: 1
Sorry, I'm not a coder. Any one can post a sample in how to retrieve the the album/artist name when playing shoutcast stream with Flash?

I got it playing, but don't know how to retrieve the info. I know a bit o ASP, XML and ActionScript1,2.

Thanks in advanced,
notsozen is offline   Reply With Quote
Old 27th March 2004, 18:48   #38
djboxny
Junior Member
 
Join Date: Mar 2004
Location: New York
Posts: 11
Send a message via AIM to djboxny Send a message via Yahoo to djboxny
OK i am kinda lost. My shoutcas server is served thru a dedicated server that i got. Meaning that if i decided to put the flash the problem of the flash tring to get the stream remotetly is goned?. Becuase it is in the same server as the server so i can use the localhost feature. Now i know that there alot of us that are in this same situation. and would like to know how can we inplement the flash radio to ur sites.

PS my dedicated server is a Linux
djboxny is offline   Reply With Quote
Old 27th March 2004, 19:57   #39
Nebulus
Member
 
Join Date: Jul 2003
Posts: 70
notsozen,
to get ID3 data info form the stream, you can use this code when you load the audio:

var my_sound = new Sound('path_to'stream',1);
my_sound.onId3 = function(){
// put all your id3 handling code in here.
// flash help files have a full listing of supported ID3 tags.
}

djboxny,
you can load content from other sites by loading an xml permission file on the server that's hosting the content.

When a flash movie requests data from a domain other than the one it's sitting on, the server serving the content has to have a file, crossdomain.xml in the root of the website.

the format of the crossdomain.xml looks like this:

<cross-domain-policy>
<allow-access-from domain="*.your_site.com" />
<allow-access-from domain="*.somebodyelses_site.com" />
<allow-access-from domain="*.another_site.com" />
</cross-domain-policy>

any domain listed in the crossdomain.xml file can have access to the site's content now.

Hope that helps!
Nebulus is offline   Reply With Quote
Old 27th March 2004, 20:17   #40
djboxny
Junior Member
 
Join Date: Mar 2004
Location: New York
Posts: 11
Send a message via AIM to djboxny Send a message via Yahoo to djboxny
MY Domain is Latinspot.com = its a Dedicated server so i installed 2 shout cast servers. There are in the same server as my webiste. So its not a remote connection. Now being that what can i do now to add a flash player to my site. And wich program should i use to build the flash aplication. Any help is welcomed
djboxny is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Shoutcast > Shoutcast Discussions

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump