我有这个函数,它在流视频结束后循环其中的所有内容,有没有一种方法只循环流视频和shaker(null)而不循环音频?因为音频是长的,但它的长度更大。所以基本上我需要视频和音频是独立循环的。
function NCListener(e:NetStatusEvent){
if (e.info.code == "NetStream.Play.Stop") {
ns.play("http://media.easyads.bg/ads/display_ads_richmedia/video/avon/maria_ilieva/video_2.flv");
soundChannel = sound.play(0, 9999);
shaker(null);
}
};
var sound:Sound = new Sound();
var soundChannel:SoundChannel= new SoundChannel();
sound.load(new URLRequest("sound.mp3"));
sound.addEventListener(Event.COMPLETE, onSoundLoadComplete );
function onSoundLoadComplete(e:Event):void{
sound.removeEventListener(Event.COMPLETE, onSoundLoadComplete);
soundChannel.addEventListener(Event.SOUND_COMPLETE, onSoundChannelSoundComplete);
}
function onSoundChannelSoundComplete(e:Event):void{
e.currentTarget.removeEventListener(Event.SOUND_COMPLETE, onSoundChannelSoundComplete);
soundChannel = sound.play(0, 9999);
}发布于 2013-02-21 00:08:49
对于独立循环,您需要同时侦听NetStream (onPlayStatus)和SoundChannel (soundComplete)上的事件。在事件处理程序中,您只需重新启动已完成的媒体。
看起来您的示例代码只是在监听NetStream。
https://stackoverflow.com/questions/14983379
复制相似问题