I am making a FLV player that should take download, on-demand-streaming and
live-streaming input.
I have chosen to work with the FLVplayback component in ActionScript2.0.
To be able to show/hide a preloader animation (like youtube-loading) i
listen for stateChange events broadcast by the FLVplayback component.
This works beautifully for download/on-demand-streaming.
For LIVE-streaming this works less well.
Some live sessions there are never any stateChange events triggered (like
playing. buffering).
Some live sessions these events come after 10-30 seconds, which is OK, but
not preferable.
For about 30-50% of the live sessions there are NEVER any stateChange events
triggered.
The code i use to setup the listening for this event (stateChange):
Code:
someFunction(){
// To be able to react to rewind, stop, seek etc. we need to listen for
that event:
this.listenerObject.stateChange = Delegate.create(this, this.stateChange)
this.FLVplayback.addEventListener(stateChange, this.listenerObject);
}
public function stateChange(eventObject:Object){
var state = eventObject.state
debug(state change=+state)
}
(Works perfectly for all but live-streaming, then it only works well about
30-70% of the time)
Googling this issue i came across a post describing a way that i might get
around this:
http://readlist.com/lists/chattyfig.figleaf.com/flashcoders/4/20386.html
Which tells how to get in touch with the NetStream object of the FLVplayback
component.
I have successfully jacked into or hijacked the NetStream.onStatus
function and it gets some events triggered. I believe it works better than
for FLVplayback's stateChange.
The problem THEN becomes that my FLVplayback buttons etc. stop working.
Seems that FLVplayback wants to take care of this onStatus by itself. By
hijacking this function the standard controls fails.
Anyone had problem with similar issues?
It has to be a live stream for this to happen.
I am using FMS on a high-capacity CDN.
Do i have to scrap the FLVplayback component and work with
NetConnection/NetStream/VideoPlayer etc? Or can it be done with the
FLVplayback?
Many thanks in advance for any suggestion about this issue,
/Jonas M
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders