Hi everybody, I am trying to build an mp3 player in Macromedia Flash that would work with Icecast. Using Flash as a mp3 player instead of Winamp, XMMS,. could democratize Icecast because Flash is cross-platform/cross-browser, it is installed on almost every computer connected to the internet and it will be embedded into a webpage. I successfully imported an Icecast live stream into Flash with this simple ActionScript code: TestIcecast = new Sound(); TestIcecast.loadSound("http://myradio.com:8000/mystream", true); TestIcecast.start(0,0) For those who don't know flash, here is the process of creating a flash animation: you edit the code into a .fla file, then export this code into a .swf file (the flash animation) and then embed this flash animation into a webpage. HERE IS THE PROBLEM: the code above works perfectly in a standalone swf file but not when the swf is embedded into a webpage. I analyzed the logs of my icecast server to understand what is happening: When I run the swf in standalone mode (not embedded), the ACCESS log is: 192.168.0.3 - - [27/Nov/2003:04:37:46 Romance Standard Time] "GET /mystream HTTP/1.1" 200 246535 "(null)" "http://192.168.0.4:37/mystream" 13712368. When I run the webpage in which the swf is embedded in, I can see the swf contacts the server but no stream is played. The ACCESS log is: 192.168.0.3 - - [27/Nov/2003:04:42:58 Romance Standard Time] "GET /mystream HTTP/1.1" 200 328981 "(null)" "-" 13712464 I both case, the ERROR log is: [.]Client connected [.]Source found for client [.[Client added It means the swf, even when embedded, can access the stream (but it doesn't play anything). Anyway, I noticed the only difference between the two ACCESS logs is the "http://192.168.0.4:37/mystream" (in first log) instead of "-" (in second log) that appears behind "(null)". Please not that I made other tests with Winamp and the habitual information that appears behind "(null)" is "-". I thought the problem might come from the headers that Icecast need to receive from regular players (Winamp,.) before sending the stream because I think my Flash animation doesn't send any header information when embedded into a webpage (headers information is send by the browser instead). For this reason I tried to use a php script that sends hardcoded header information (Content-type: audio/mpeg; GET <path of the stream> HTTP/1.1; protocol: \"http\") to the server. Then I call the URL of this script into my flash code instead of the URL of the stream. The php script is: <?php $streamname = "192.168.0.4"; // put in whatever stream you want to play $port = "37"; // put in the port of the stream $path = "/mystream"; // put in any extra path, this is usually just a / header("Content-type: audio/mpeg"); $sock = fsockopen($streamname,$port); fputs($sock, "GET $path HTTP/1.1\n"); fputs($sock, "protocol: \"http\"\n"); fputs($sock, "Connection: close\n\n"); fpassthru($sock); ?> I still have the same problem even with the script: I can listen to the stream when I run the swf in standalone mode but NOT when it is embedded into a webpage. I also analyzed the access logs of Icecast when I call the php script into my flash animation instead of the direct source URL (this test was realized with the swf embedded): 192.168.0.5 - - [27/Nov/2003:04:54:03 Romance Standard Time] "GET /mystream HTTP/1.1" 200 94383 "(null)" "-" 4549088 You can notice that it creates the exact same log if I use the php or the direct stream source when I test my swf embedded. Is there any header information missing in my php script? What header information do I have to add in order to send the "http://192.168.0.4:37/mystream" information (instead of "-") that appears after "(null)" into the ACCESS log (mentioned above)??? Do you think the problem might come from the the macromedia Flash player's security policy? Note that the same problem happens with Shoutcast. Also, I have heard that it worked with Icecast1! Do you have an idea of what modification in Icecast2 could avoid it to work? Thank you very much for any help! MAX <p>--- >8 ---- List archives: http://www.xiph.org/archives/ icecast project homepage: http://www.icecast.org/ To unsubscribe from this list, send a message to 'icecast-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
Hi Moritz, I didn't know so many people in the Icecast-Dev list were running Linux PPC! Anyway, I understand that you guys don't have the time to help me with that because you wouldn't be able to run the flash player anyway! Because of that, I think I will send the topic to the regular Icecast mailing list (where I might find more people running Linux, Mac OS or Windows). There are still some kinds of information I can only get from the dev list: -Does anybody know where I can find a document that explains the changes in the core architecture between Icecast1 and Icecast2 (Flash was working with Icecast1)? -Does Icecast need to receive some kinds of headers from the player before sending the stream? If yes, what are these headers? -Can somebody translate me this access log line: 192.168.0.3 - - [27/Nov/2003:04:42:58 Romance Standard Time] "GET /mystream HTTP/1.1" 200 328981 "(null)" "-" 13712464 What is "200 328981", "(null)" and "-"? Thanks in advance, MAX -----Original Message----- From: owner-icecast-dev@xiph.org [mailto:owner-icecast-dev@xiph.org] On Behalf Of gtgbr@gmx.net Sent: Saturday, November 29, 2003 1:32 AM To: icecast-dev@xiph.org Subject: Re: [icecast-dev] Hot Topic: Icecast in Macromedia Flash Macsym wrote:> I am trying to build an mp3 player in Macromedia Flash that would workwith> Icecast. Using Flash as a mp3 player instead of Winamp, XMMS,. could > democratize Icecast because Flash is cross-platform/cross-browser, it is > installed on almost every computer connected to the internet and it willbe> embedded into a webpage.You should read the Flash Player's EULA ... I, for example, am not allowed to install or even use the flashplugin as an OpenBSD user on most of my computers. (One may only use it on Windows, MacOS, Linux and Solaris.) On a side note, I happen to know that the plugin would actually work in Linux emulation on OpenBSD... of course, nobody officially ever tried that. Not very interesting. That, and what Jack wrote about its lack of Ogg support make Flash simply the wrong tool. <p>Moritz --- >8 ---- List archives: http://www.xiph.org/archives/ icecast project homepage: http://www.icecast.org/ To unsubscribe from this list, send a message to 'icecast-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered. <p>--- >8 ---- List archives: http://www.xiph.org/archives/ icecast project homepage: http://www.icecast.org/ To unsubscribe from this list, send a message to 'icecast-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
> I am trying to build an mp3 player in Macromedia Flash that would work with > Icecast. Using Flash as a mp3 player instead of Winamp, XMMS,. could > democratize Icecast because Flash is cross-platform/cross-browser, it is > installed on almost every computer connected to the internet and it will be > embedded into a webpage.Unfortunately flash doesn't work on many of the xiph developers platform of choice (ppc linux), nor does it support Ogg. So while interesting, it's not nearly as democratizing as one would at first think. jack. --- >8 ---- List archives: http://www.xiph.org/archives/ icecast project homepage: http://www.icecast.org/ To unsubscribe from this list, send a message to 'icecast-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
Hi Jack, By "democratizing" Icecast, I meant that it would create a single player for all users of Win32, Linux and MAC. Also, I have heard the PPC community is now convincing Macromedia to develop a version of their Linux Flash Plugin especially for PPC. You are true about the .ogg files, Flash can't play it for the moment which is bad because it .ogg is definitely a better format than MP3. Anyway, I think developing a Flash mp3 player for Icecast is still a nice idea. MAX -----Original Message----- From: owner-icecast-dev@xiph.org [mailto:owner-icecast-dev@xiph.org] On Behalf Of Jack Moffitt Sent: Saturday, November 29, 2003 1:17 AM To: icecast-dev@xiph.org Subject: Re: [icecast-dev] Hot Topic: Icecast in Macromedia Flash> I am trying to build an mp3 player in Macromedia Flash that would workwith> Icecast. Using Flash as a mp3 player instead of Winamp, XMMS,. could > democratize Icecast because Flash is cross-platform/cross-browser, it is > installed on almost every computer connected to the internet and it willbe> embedded into a webpage.Unfortunately flash doesn't work on many of the xiph developers platform of choice (ppc linux), nor does it support Ogg. So while interesting, it's not nearly as democratizing as one would at first think. jack. --- >8 ---- List archives: http://www.xiph.org/archives/ icecast project homepage: http://www.icecast.org/ To unsubscribe from this list, send a message to 'icecast-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered. <p>--- >8 ---- List archives: http://www.xiph.org/archives/ icecast project homepage: http://www.icecast.org/ To unsubscribe from this list, send a message to 'icecast-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
Macsym wrote:> I am trying to build an mp3 player in Macromedia Flash that would work with > Icecast. Using Flash as a mp3 player instead of Winamp, XMMS,. could > democratize Icecast because Flash is cross-platform/cross-browser, it is > installed on almost every computer connected to the internet and it will be > embedded into a webpage.You should read the Flash Player's EULA ... I, for example, am not allowed to install or even use the flashplugin as an OpenBSD user on most of my computers. (One may only use it on Windows, MacOS, Linux and Solaris.) On a side note, I happen to know that the plugin would actually work in Linux emulation on OpenBSD... of course, nobody officially ever tried that. Not very interesting. That, and what Jack wrote about its lack of Ogg support make Flash simply the wrong tool. <p>Moritz --- >8 ---- List archives: http://www.xiph.org/archives/ icecast project homepage: http://www.icecast.org/ To unsubscribe from this list, send a message to 'icecast-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.