[FLASH] Web Radio player
Hello,
i've made a simple flash application with Flash MX 2004 that plays MP3 LIVE stream from a web radio.
It all works properly if i execute the compiled SWF file with FlashMX, but if i embed it in an HTML page, it won't play sound!
strange uh?
and, the more curious thing is that after having opened it from the web page, it won't play sound anymore even with FlashMX!!
Why??
I've attached the SWF file, the HTML page that embeds it, and the source FLA file, if you want to take a look.
Please, try it and tell me if you hear the radio.
The steps i've made are :
1) I added to the stage a MediaDisplay component (from the Media Components).
2) In the Component Inspector Window, i chosed "MP3" , i specified the URL of the live stream to play, and i checked "Play automatically".
3) I exported the SWF choosing Flash Player 6, Action Script 2.0 and setting audio to "MP3 128 kbps best quality".
# 1 Re: [FLASH] Web Radio player
I have opened the FLA, but I am not seeing any code whatsoever. All I see are 3 objects added to the library. Are you sure this isn't a paths issue?
and, the more curious thing is that after having opened it from the web page, it won't play sound anymore even with FlashMX!!
Why??
Well, remember that a webpage can only work the with compiled SWF and not the original FLA. Therefore you know that something else is affecting it.
# 2 Re: [FLASH] Web Radio player
I have opened the FLA, but I am not seeing any code whatsoever. All I see are 3 objects added to the library. Are you sure this isn't a paths issue?
Well, remember that a webpage can only work the with compiled SWF and not the original FLA. Therefore you know that something else is affecting it.
If it was a path's issue, it would not work even if you try opening it with FlashMX, is it right?
No, i haven't written a single line of code (i'm a newbie on Action Script :) ), i've only specified the URL and the parameters in the component inspection window.
I tried doing this just now:
i chosed the MediaDisplay component on the stage, i opened the Actions window below, and i put this code, but the problem persists :(
onClipEvent(load){
var s:Sound = new Sound(this);
s.loadSound("http://leaseweb.hard.fm:8000",true);
}
# 3 Re: [FLASH] Web Radio player
If it were a path's issue, it would not work even if you try opening it with FlashMX, is it right?
I was refering to the stream/file that you were attempting to play, not the calling of the actual SWF file.
I am pretty sure that loadSound must directly link to an MP3.
# 4 Re: [FLASH] Web Radio player
I was refering to the stream/file that you were attempting to play, not the calling of the actual SWF file.
I am pretty sure that loadSound must directly link to an MP3.
For "directly link" you mean the MP3 must be a static file?
I'm sure that MP3 live streams are supported :)
And the path is correct because FlashMX finds the stream and plays it correctly..
I think this is a security issue, i heard somewhere that the browser's flash plugin , when it requests files/streams on a different domain, it looks for the crossdomain.xml file on the remote server from which comes the stream (or the static file ..), but evidently there isn't such XML file there.
Maybe FlashMX does not do that check while the flash plugin does??
# 5 Re: [FLASH] Web Radio player
I too thought of a security issue. You can test that theory by changing those settings in Internet Explorer, for the Local Intranet.
EDIT: I found this ( http://kb.adobe.com/selfservice/viewContent.do?externalId=50c96388&sliceId=1) link that looks very helpful.
# 6 Re: [FLASH] Web Radio player
I too thought of a security issue. You can test that theory by changing those settings in Internet Explorer, for the Local Intranet.
EDIT: I found this (http://kb.adobe.com/selfservice/viewContent.do?externalId=50c96388&sliceId=1) link that looks very helpful.
Ok, another thing.
I tried to install VLC media player on 2 remote servers and i've created an MP3 stream with it.
Then, i changed the URL in the Flash application to match the remote output stream from VLC, and the sound works perfectly both with FlashMX and the plugin (run from my home)!!!!
It's very strange.
I haven't created a crossdomain.xml file on the server..
Please download these two zip files and try the application.
http://www.mediamax.com/vegetasayan/Hosted/radio_test_1.zip
http://www.mediamax.com/vegetasayan/Hosted/radio_test_2.zip
The zips contain the flash application (.SWF), its source file (.FLA) and an HTML page that embeds the SWF file.
Both the applications are identical except for the stream requested.
Let me know if you heard the music or not, i would be very grateful.
