The following is from http://en.wikipedia.org/wiki/Adobe_Flash#Flash_Video
以下内容来自http://en.wikipedia.org/wiki/Adobe_Flash#Flash_Video
Flash Video
Flash Video (.flv files) is a container format, meaning that it is not a video format in itself, but can contain other formats. The video in Flash is encoded in H.263, and starting with Flash player 8, it may alternatively be encoded in VP6. The audio is in MP3. The use of VP6 is common in many companies, because of the large adoption rates of Flash Player 8 and Flash Player 9.[16]
Flash视频(.flv文件)是一种容器格式,这意味着它本身不是视频格式,但可以包含其他格式。 Flash中的视频以H.263编码,从Flash播放器8开始,它也可以用VP6编码。音频采用MP3格式。由于Flash Player 8和Flash Player 9的采用率很高,因此在许多公司中使用VP6很常见。[16]
On August 20, 2007, Adobe announced on its blog that with Update 3 of Flash Player 9, Flash Video will also support the MPEG-4 international standard.[31] Specifically, Flash Player will have support for video compressed in H.264 (MPEG-4 Part 10), audio compressed using AAC (MPEG-4 Part 3), the MP4, M4V, M4A, 3GP and MOV multimedia container formats (MPEG-4 Part 14), 3GPP Timed Text specification (MPEG-4 Part 17) which is a standardized subtitle format and partial parsing support for the 'ilst' atom which is the ID3 equivalent iTunes uses to store metadata. Adobe also announced that they will be gradually moving away from the proprietary FLV format to the standard MP4 format owing to functional limits with the FLV structure when streaming H.264. The final release of the Flash Player supporting MPEG-4 had become available in Fall 2007.[32]
2007年8月20日,Adobe在其博客上宣布,通过Flash Player 9的Update 3,Flash Video也将支持MPEG-4国际标准。[31]具体来说,Flash Player将支持以H.264(MPEG-4 Part 10)压缩的视频,使用AAC(MPEG-4 Part 3)压缩的音频,MP4,M4V,M4A,3GP和MOV多媒体容器格式(MPEG- 4部分14),3GPP定时文本规范(MPEG-4 Part 17),它是标准化的字幕格式和对'ilst'原子的部分解析支持,它是用于存储元数据的ID3等效物。 Adobe还宣布,由于流式H.264时FLV结构的功能限制,他们将逐渐从专有FLV格式转向标准MP4格式。支持MPEG-4的Flash Player的最终版本已于2007年秋季推出。[32]
package com.yourdomain.packageName
{
import flash.display.Sprite;
import flash.media.Video;
import flash.net.NetConnection;
import flash.net.NetStream;
public class DocumentClass extends Sprite
{
private var _video:Video;
private var _nc:NetConnection;
private var _ns:NetStream;
public function DocumentClass():void
{
_video = new Video(800, 600);
addChild(_video);
_nc = new NetConnection();
_nc.connect(null);
_ns = new NetStream(nc);
_video.attachNetStream(_ns);
_ns.play("path/to/file.extension");
}
}
}
-This is a very basic implementation and does not include handling of meta-data.
- 这是一个非常基本的实现,不包括元数据的处理。
First, we instantiate a Video object that is 800 wide and 600 tall and add it to the display list.
首先,我们实例化一个800宽600高的视频对象,并将其添加到显示列表中。
Second, we instantiate a NetConnection object and call it's connect method passing null as a parameter. (This is required)
其次,我们实例化一个NetConnection对象并调用它的connect方法,将null作为参数传递。 (这是必需的)
Third, we create a NetStream object, passing the previously made NetConnection object to it's constructor.
第三,我们创建一个NetStream对象,将先前创建的NetConnection对象传递给它的构造函数。
Fourth, we set attachNetStream of the Video object to _ns, the NetStream we instantiated.
第四,我们将Video对象的attachNetStream设置为_ns,即我们实例化的NetStream。
Finally, we call the play method of the NetStream object, _ns, and pass it a string to where our media is located. (The FLV/F4V/MOV/etc.)
最后,我们调用NetStream对象的play方法_ns,并将字符串传递给我们的媒体所在的位置。 (FLV / F4V / MOV /等)
Hope this helps.
希望这可以帮助。