I've created a player for a client in the past using their LimeLight server to stream videos and not had an issue before, however for a new client using different LimeLight server, the videos seem to be ending 3-4 secs too early.
My traces on 3 vastly different videos I tested:
metadata duration = 32 // 32 secs long, ends at 27
Stop [27.350 seconds] = 4.65
metadata duration = 17 // 17 secs long, ends at 12
Stop [12.852 seconds] = 4.148
metadata duration = 258 // 258 secs long, ends at 255
Stop [255.861 seconds]
In the video players I check for NetStream.Play.Stop
then put a 'reset' type function in there. This function however triggers too early due to this strange bug. Has anyone have seen this before?
private function netStatusHandler(event:NetStatusEvent):void
{
trace("connected is: " + nc.connected );
switch (event.info.code)
{
case "NetConnection.Connect.Success":
trace("Connected");
connectStream();
break;
case "NetStream.Play.Start":
trace("********** Start [" + ns.time.toFixed(3) + " seconds]");
break;
case "NetStream.Play.Stop":
trace("‹ ----------- Playback has stopped. ----------- ›");
trace("Stop [" + ns.time.toFixed(3) + " seconds]");
if (nsBuffering){ removeChild(bufferAni); }
nsBuffering = false;
videoStatus = "NotPlaying";
resetVideo(); //<- Video ends so go back to start
// ^ This triggers too early
break;
}
}
The only work-around I see for this is saving the initial number I get from the metadata duration, and running a timer to constantly check for when the current ns.time matches metadata and then run my reset function.