I just finished building a Flash 7 "multiviewplayer" that handles flv,swf
and mp3.
Anyway I ran into your problem and more with regards to the end of the flv
playback in Flash 7.
Solutions
The update time method
private function doUpdateTime(Void):Void
{
//ns.time was not updating quick enough after ns.seek()
//so if we are seeking we use the currentPos var instead
var m_time : Number;
if (m_seek)
{
m_time = m_currentPos;
m_seek = false;
}
else
{
m_time = m_ns.time;
m_currentPos = m_time;
}
var perc = ((m_time)/m_streamLength);
var owner:NSManager = this;
m_ns.onStatus = function (oInfo)
{
//if(oInfo.code == "NetStream.Buffer.Empty" && m_time >=
owner.m_streamLength)
if (oInfo.code == "NetStream.Play.Stop")
{
owner.killStream();
}
}
dispatchEvent({type:"streamTimeUpdate", percentage:perc,
time:m_time});// time:Math.round(m_time)});
}
The other main problem was scrubbing to the end of the flv
What we had to do was pause the playback while scrubbing and then when we
released the scrub at the end off the bar we ran a condition
public function pause(p_pause:Boolean):Void
{
clearInterval(m_timeInterval);
if(m_currentPos >= m_streamLength) {
killStream();
} else {
m_ns.pause(p_pause);
if (!p_pause)
m_timeInterval = setInterval(this, "doUpdateTime",
100);
}
}
Oh and the duration of the flv we got by using Burak's FLVMetadata Injector
and calling
public function getStreamLength():Void
{
// Obtains length through NetStream Object's onMetaData function
var dur:Number
var owner : NSManager = this;
m_ns["onMetaData"] = function (obj)
{
//trace("#onMetaData# "+obj.duration + " converted = " +
Math.ceil(obj.duration * 1000));
owner.m_streamLength = obj.duration;
if (m_streamLength>0) {
owner.dispatchEvent({type:"streamTimeUpdate",
percentage:0, time:0});
}
}
}
Hope this knocks out a few issues for you guys
We also noticed that much of these problems have been fixed in flash 8
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of John Giotta
Sent: Thursday, 17 November 2005 7:47 AM
To: Flashcoders mailing list
Subject: Re: [Flashcoders] End of flv playback event
I hope this thread doesn't die.
I'd like to see what other methods are being used.
I'm actually considering applying a preprocess to our video mirror process
to inject a onlastsecond event with Burak's FLVMetadata Injector.
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders