本文介绍了得到了我的外部NetStream的工作 - 但如何从我的库中加载的。FLV?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何加载的FLV(可以称之为library.flv)坐在我的(内部)闪存库到我的NetStream?

我可以很容易地加载外部FLV的同下面,但我需要从我的库中加载的。FLV

  //创建视频对象
VAR ADFvideo =新视频(110180);
videoContainer.addChild(ADFvideo);
ADFvideo.x = 0;
ADFvideo.y = 0;

//加载FLV到视频对象
VAR ADFnc:的NetConnection =新的NetConnection();
ADFnc.connect(空);
VAR ADFns:NetStream的=新的NetStream(ADFnc);
ADFvideo.attachNetStream(ADFns);

//处理元数据(它到达的视频开始播放,所以它是pefect时使用的第一个事件);
VAR ADFcustomClient:对象=新的对象();
ADFcustomClient.onMetaData = ADFmetaDataHandler;
ADFns.client = ADFcustomClient;
VAR ADFinfoObj:对象;
功能ADFmetaDataHandler(ADFinfo:对象):无效
{
        //元的东西
}

ADFns.play(文件/ external.flv); / *加载外部FLV的电流的方式* /

ADFns.addEventListener(NetStatusEvent.NET_STATUS,statusChanged);

功能statusChanged(统计:将NetStatusEvent)
{
        //事件变化
}
 

解决方案

我不认为你可以使用的NetStream了嵌入式FLV视频。当您导入的视频库中,你将不得不将其转换为一个影片剪辑的选项或把它作为一个简单的视频,将坐在时间轴上。对于后来的选项,你不能创建一个AS联动。这是不建议再剪辑,你将体验syncronisation问题,播放问题,pre-加载问题。

How do I load an .flv (lets call it "library.flv") sitting in my (internal) Flash library into my Netstream?

I can easily load external .flv's with the below, but I need to load the .flv from my library

//Creating the video object
var ADFvideo = new Video(110,180);
videoContainer.addChild(ADFvideo);
ADFvideo.x = 0;
ADFvideo.y = 0;

//Loading the flv into the video object 
var ADFnc:NetConnection = new NetConnection();
ADFnc.connect(null);
var ADFns:NetStream = new NetStream(ADFnc);
ADFvideo.attachNetStream(ADFns);

//Handling metaData (it arrives as the video starts playing, so it is the pefect time to fire the first event);
var ADFcustomClient:Object = new Object();
ADFcustomClient.onMetaData = ADFmetaDataHandler;
ADFns.client = ADFcustomClient;
var ADFinfoObj:Object;
function ADFmetaDataHandler(ADFinfo:Object):void
{
        //meta stuff
}

ADFns.play("files/external.flv"); /* current way of loading the external .flv */

ADFns.addEventListener(NetStatusEvent.NET_STATUS, statusChanged);

function statusChanged(stats:NetStatusEvent)
{
        //event changes
}
解决方案

I don't think you can use NetStream with an embedded flv video. When you import the video to your library, you will have the option to convert it to a movieclip or to keep it as a simple video that will sit on the timeline. For the later option, you can't create an AS Linkage. It is not recommended for longer clip as you will experience syncronisation issue, playback problem and pre-loading issues.

这篇关于得到了我的外部NetStream的工作 - 但如何从我的库中加载的。FLV?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 01:17