mi sembra lo scrisse Natili
codice:
function endOfVideoDetector(p_infoCode:String):Boolean {
if (p_infoCode == "NetStream.Play.Start") {
m_playStop = false;
} else if (p_infoCode == "NetStream.Play.Stop") {
m_playStop = true;
} else if (p_infoCode == "NetStream.Buffer.Full" || p_infoCode == "NetStream.Play.Reset") {
m_bufferEmpty = false;
} else if (p_infoCode == "NetStream.Buffer.Empty") {
m_bufferEmpty = true;
}
if (m_playStop && m_bufferEmpty) {
if (withinNSecondsOfEnd(0.4)) {
m_playStop = false;
m_bufferEmpty = false;
return true;
} else {
m_playStop = false;
m_bufferEmpty = false;
pause(true);
pause(false);
return false;
}
}
return false;
}
function withinNSecondsOfEnd(p_theSeconds:Number) {
if ((duration-time)<p_theSeconds) {
return true;
} else {
return false;
}
}