我尝试NetStream
使用动作脚本语言在课堂上执行搜索功能,搜索无法正常工作。我在 NetStream 中阅读了 KeyFrames,KeyFrames 和 seek 之间有什么关系?NetStream 使用 seek 功能还有其他问题吗?onClick() 函数寻找;
private function onClick(event:MouseEvent):void
{
if (event.currentTarget is Group)
{
var myGroup:Group = event.currentTarget as Group;
if ( myGroup.mouseX >= 100)
{
mouseClickedXPos = myGroup.mouseX;
ns.inBufferSeek = true;
var seekTime:Number = (mouseClickedXPos-100) * (totalTime/(controlBarControls.width-100));
ns.seek(seekTime);
}
}
}
有网络流的 netStatus 事件
ns.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
private function onNetStatus(event:NetStatusEvent):void
{
if ( event.info == "NetStream.Play.StreamNotFound" )
legend.text = "Video file passed, not available!";
else if(event.info.code == "NetStream.Play.FileStructureInvalid")
legend.text = "Video file passed, FileStructureInvalid";
}
event.info.code
是 NetStream.Seek.InvalidTime ,视频将停止播放,有时会寻找视频结尾,但我跟踪它,ns.time()
不会更新为新值(seekTime)