Gie*_*ius 3 video streaming actionscript-3
我有来自服务器的视频流,后来我想并排添加另一个.这一切都很好,我做到了.现在我的问题来了,当我想要删除视频.我设法将其从显示中删除,但我可以听到视频仍然在后台播放.那么如何停止播放该视频呢?以下是我设置视频的代码:
ns = new NetStream(connection);
ns.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
ns.play(item[1].toString() + ".flv");
video = new Video();
video.attachNetStream( ns );
video.width = 160;
video.height = 120;
videoWrapper = new UIComponent();
videoWrapper.addChild( video );
videos.addElement( videoWrapper );
Run Code Online (Sandbox Code Playgroud)
这是为了删除
videos.removeElement(myVideos[p][1]); // myVideos[p][1] is a reference of videoWrapper
Run Code Online (Sandbox Code Playgroud)