Skip to content

Instantly share code, notes, and snippets.

@minodisk
Created September 16, 2011 05:40
Show Gist options
  • Save minodisk/1221284 to your computer and use it in GitHub Desktop.
Save minodisk/1221284 to your computer and use it in GitHub Desktop.
NetStream.Seek.Notify で再生時間が期待した値で取得できない件
var connection:NetConnection = new NetConnection();
connection.connect(null);
var stream:NetStream = new NetStream(connection);
stream.client = {};
stream.addEventListener(NetStatusEvent.NET_STATUS, netStatus);
stream.play('example.f4v');
setTimeout(function ():void {
stream.seek(100);
}, 5000);
function netStatus(e:NetStatusEvent):void {
switch (e.info.code) {
case 'NetStream.Seek.Notify':
trace(stream.time); // 5.039
setTimeout(function ():void {
trace(stream.time); // 99.666
}, 0);
break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment