Go Back   Winamp Forums > SHOUTcast > SHOUTcast Site Design,Widgets and Toolbar

Reply
Thread Tools Search this Thread Display Modes
Old 26th October 2009, 15:04   #1
supernoob
Junior Member
 
Join Date: Oct 2009
Posts: 2
Flash player that works.

Hi.

Im like 34489 other people looking for a working flash solution working together with a shoutcast server.

1. Icecast needs to be recompiled cuase of some content length problem.

"There's an outstanding bug in Flash Player 8/9 that gives an incorrect value for the amount of data downloaded when looking at Icecast2 or Shoutcast streams via a web browser (due to a missing 'content-length' header). "

2. Shoutcast DNAS does not support crossdomain.xml

3. constant streaming from FLASH will crash the browser after a while since the data is never flushed and the resources will drain eventually.

Well people I will give you a simple flash program that solves all this.

This is the first time i touch flash so please dont laugh. te code is put together from one app demoing how to make a volume control and the other piece of code is from one guy playing winamp on a WII.

I made the volume control work. play and stop does not do anything. if you enhance the code please post your code in this thread. For example i set the volume on release but it's dead simple to continiusly change the volume when dragging.

Anyway.

to solve '2' launch the swf like this:

Code:

code:

<head>

<script src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>

<script type="text/javascript">
swfobject.embedSWF('iminalurar2.swf', 'player', '320', '240', '9', false, false, false, false);
</script>

<head>

<body>

<div id="playercontainer" class="playercontainer">
<a id="player" class="player" href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">Get the Flash Plugin to see this video.</a></div>

</body>

Attached Files
File Type: zip smurf.zip (8.2 KB, 367 views)
supernoob is offline   Reply With Quote
Old 26th October 2009, 15:05   #2
supernoob
Junior Member
 
Join Date: Oct 2009
Posts: 2
I forgot to say that please help me to enchance the player. I'll post my changes here..

/Anders.
supernoob is offline   Reply With Quote
Old 16th April 2010, 23:58   #3
DmVinny
Junior Member
 
Join Date: Apr 2010
Posts: 5
Ok I was looking at your code, and I guess im also one of the 34489 people trying to work something out on this... Now i am also a noob at flash , but I had an idea as well.

You seem to be on the right track trying to stream 2 sounds. But what if you set it up to use 2 timers.

Say we have the stream run for 3 minutes on sound 1.

We set timer 1 to call a function which switches the stream from sound 1 to sound 2, or sound 2 to sound 1 depending on which one we are playing every 3 minutes, and nulling out the previous played Sound.

We set timer 2 to call a function every 2 minutes 30 seconds, inside the function we start loading Sound 1 or Sound 2 depending on which is currently playing.

Would this possibly help in clearing the memory issue flash has with streams?
DmVinny is offline   Reply With Quote
Old 17th April 2010, 01:40   #4
Brutish Sailor
Major Dude
 
Brutish Sailor's Avatar
 
Join Date: Jan 2009
Location: San Diego CA
Posts: 978
Send a message via Skype™ to Brutish Sailor
this by theory is pretty sound, the idea of both of these should work in therory, as what your trying to do overall is clear the catch. Changing the source will not matter if the stream is consistent.

In simplest terms for people that dont understand the memory leak issue from what I understand:

When the stream starts, the script collects data in the cache. You have listened to an MP3 through a flash player. As the MP3 plays, all previous information that just came into the container is not discarded. As a result you can go back to part of the song in the flash player, and play that sample without having to wait for information to be re-transmitted because its in the cache.

Why is this bad? Because in a flash player, it doesn't discard the cache, and as a result causes the memory leak to occur, which crashes the browser.

So, A bunch of people have tried making a player that simply times to drop and pick up the stream, discarding the stream cache.

Why is this a pain? because then you have to deal with trying to keep up with numbers in your dnas while youhave a ton of drops re-occur over and over. This kind of stress is not appreciated on an SC_server.

The only solution is to rewrite flash so it doesn't store in the cache. But then it wouldnt be flash, and everyone wouldn't have what-ever-it-is you have just written stored on their comp.

The best case situation is we all complain to adobe to make flash constantly discard in the event of a stream.

http://www.youtube.com/user/BrutishSail0r
I follow Dave St. John's swag, Like this if my videos help: http://www.facebook.com/casterhub
Brutish Sailor is offline   Reply With Quote
Old 17th April 2010, 19:04   #5
DmVinny
Junior Member
 
Join Date: Apr 2010
Posts: 5
Now does the memory leak affect the server hosting the flash movie, or the client listening?
DmVinny is offline   Reply With Quote
Old 17th April 2010, 19:25   #6
Brutish Sailor
Major Dude
 
Brutish Sailor's Avatar
 
Join Date: Jan 2009
Location: San Diego CA
Posts: 978
Send a message via Skype™ to Brutish Sailor
It effects the listening clients browser. A flash movie? no problem. A stream however, is consistently streaming info, causing the browsers cache to fill. So because of the consistency of the stream (the flash player reading it as a file), there is no way for the browser to discard info, because the stream does not register as a stream to flash, it registers as a file, and continuously collects data in the cache, waiting for the file to finish the upload, which will not happen, because it is a consistent stream.

http://www.youtube.com/user/BrutishSail0r
I follow Dave St. John's swag, Like this if my videos help: http://www.facebook.com/casterhub

Last edited by Brutish Sailor; 17th April 2010 at 19:57.
Brutish Sailor is offline   Reply With Quote
Old 19th April 2010, 01:16   #7
DmVinny
Junior Member
 
Join Date: Apr 2010
Posts: 5
I've been searching the new and seen at a few places that flash 10 and as3 have helped take care of this issue? im assuming this is not true?
DmVinny is offline   Reply With Quote
Old 19th April 2010, 01:34   #8
Brutish Sailor
Major Dude
 
Brutish Sailor's Avatar
 
Join Date: Jan 2009
Location: San Diego CA
Posts: 978
Send a message via Skype™ to Brutish Sailor
Its true. But sometimes I have noticed issues. It usually doesnt occur if the stream is coming from a flash media server, but link a random flash player to a SC server, and see listen for 45-1 hour.

I notice NO issues now when I link one of the players from Sodeh.de to a server. other players.... Not so much luck for some reason.

http://www.youtube.com/user/BrutishSail0r
I follow Dave St. John's swag, Like this if my videos help: http://www.facebook.com/casterhub
Brutish Sailor is offline   Reply With Quote
Reply
Go Back   Winamp Forums > SHOUTcast > SHOUTcast Site Design,Widgets and Toolbar

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