用于 Adobe® Flash® Platform 的 ActionScript® 3.0 参考
主页  |  隐藏包列表和类列表 |   |   |  新增内容  |  索引  |  附录  |  为什么显示为英语?
过滤条件: AIR 30.0 和更早版本, Flash Player 30.0 和更早版本, Flash Lite 4
Flex 4.6 和更早版本, Flash Pro CS6 和更早版本
隐藏过滤条件
flash.media 

Video  - AS3

x

顶级
adobe.utils
air.desktop
air.net
air.update
air.update.events
coldfusion.air
coldfusion.air.errors
coldfusion.air.events
coldfusion.service
coldfusion.service.events
coldfusion.service.mxml
com.adobe.acm.solutions.authoring.domain.extensions
com.adobe.acm.solutions.ccr.domain.extensions
com.adobe.consulting.pst.vo
com.adobe.dct.component
com.adobe.dct.component.datadictionary
com.adobe.dct.component.datadictionaryElement
com.adobe.dct.component.dataElementsPanel
com.adobe.dct.component.toolbars
com.adobe.dct.event
com.adobe.dct.exp
com.adobe.dct.model
com.adobe.dct.service
com.adobe.dct.service.provider
com.adobe.dct.transfer
com.adobe.dct.util
com.adobe.dct.view
com.adobe.ep.taskmanagement.domain
com.adobe.ep.taskmanagement.event
com.adobe.ep.taskmanagement.filter
com.adobe.ep.taskmanagement.services
com.adobe.ep.taskmanagement.util
com.adobe.ep.ux.attachmentlist.component
com.adobe.ep.ux.attachmentlist.domain
com.adobe.ep.ux.attachmentlist.domain.events
com.adobe.ep.ux.attachmentlist.domain.renderers
com.adobe.ep.ux.attachmentlist.skin
com.adobe.ep.ux.attachmentlist.skin.renderers
com.adobe.ep.ux.content.event
com.adobe.ep.ux.content.factory
com.adobe.ep.ux.content.handlers
com.adobe.ep.ux.content.managers
com.adobe.ep.ux.content.model.asset
com.adobe.ep.ux.content.model.preview
com.adobe.ep.ux.content.model.relation
com.adobe.ep.ux.content.model.search
com.adobe.ep.ux.content.model.toolbar
com.adobe.ep.ux.content.search
com.adobe.ep.ux.content.services
com.adobe.ep.ux.content.services.load
com.adobe.ep.ux.content.services.permissions
com.adobe.ep.ux.content.services.preview
com.adobe.ep.ux.content.services.providers
com.adobe.ep.ux.content.services.query
com.adobe.ep.ux.content.services.relationships
com.adobe.ep.ux.content.services.search.lccontent
com.adobe.ep.ux.content.services.version
com.adobe.ep.ux.content.view
com.adobe.ep.ux.content.view.components.activate
com.adobe.ep.ux.content.view.components.grid
com.adobe.ep.ux.content.view.components.grid.hover
com.adobe.ep.ux.content.view.components.grid.hover.component
com.adobe.ep.ux.content.view.components.grid.renderers
com.adobe.ep.ux.content.view.components.relationships
com.adobe.ep.ux.content.view.components.review
com.adobe.ep.ux.content.view.components.search.renderers
com.adobe.ep.ux.content.view.components.searchpod
com.adobe.ep.ux.content.view.components.toolbar
com.adobe.ep.ux.content.view.components.toolbar.controlRenderers
com.adobe.ep.ux.content.view.components.version
com.adobe.ep.ux.documentsubmit.component
com.adobe.ep.ux.documentsubmit.domain
com.adobe.ep.ux.documentsubmit.skin
com.adobe.ep.ux.taskaction.component
com.adobe.ep.ux.taskaction.domain
com.adobe.ep.ux.taskaction.domain.events
com.adobe.ep.ux.taskaction.skin
com.adobe.ep.ux.taskdetails.component
com.adobe.ep.ux.taskdetails.domain
com.adobe.ep.ux.taskdetails.skin
com.adobe.ep.ux.tasklist.component
com.adobe.ep.ux.tasklist.domain
com.adobe.ep.ux.tasklist.skin
com.adobe.ep.ux.webdocumentviewer.domain
com.adobe.exm.expression
com.adobe.exm.expression.error
com.adobe.exm.expression.event
com.adobe.exm.expression.impl
com.adobe.fiber.runtime.lib
com.adobe.fiber.services
com.adobe.fiber.services.wrapper
com.adobe.fiber.styles
com.adobe.fiber.util
com.adobe.fiber.valueobjects
com.adobe.gravity.binding
com.adobe.gravity.context
com.adobe.gravity.flex.bundleloader
com.adobe.gravity.flex.progress
com.adobe.gravity.flex.serviceloader
com.adobe.gravity.framework
com.adobe.gravity.init
com.adobe.gravity.service.bundleloader
com.adobe.gravity.service.logging
com.adobe.gravity.service.manifest
com.adobe.gravity.service.progress
com.adobe.gravity.tracker
com.adobe.gravity.ui
com.adobe.gravity.utility
com.adobe.gravity.utility.async
com.adobe.gravity.utility.error
com.adobe.gravity.utility.events
com.adobe.gravity.utility.factory
com.adobe.gravity.utility.flex.async
com.adobe.gravity.utility.logging
com.adobe.gravity.utility.message
com.adobe.gravity.utility.sequence
com.adobe.gravity.utility.url
com.adobe.guides.control
com.adobe.guides.domain
com.adobe.guides.i18n
com.adobe.guides.spark.components.skins
com.adobe.guides.spark.components.skins.mx
com.adobe.guides.spark.headers.components
com.adobe.guides.spark.headers.skins
com.adobe.guides.spark.layouts.components
com.adobe.guides.spark.layouts.skins
com.adobe.guides.spark.navigators.components
com.adobe.guides.spark.navigators.renderers
com.adobe.guides.spark.navigators.skins
com.adobe.guides.spark.util
com.adobe.guides.spark.wrappers.components
com.adobe.guides.spark.wrappers.skins
com.adobe.guides.submit
com.adobe.icc.dc.domain
com.adobe.icc.dc.domain.factory
com.adobe.icc.editors.events
com.adobe.icc.editors.handlers
com.adobe.icc.editors.managers
com.adobe.icc.editors.model
com.adobe.icc.editors.model.config
com.adobe.icc.editors.model.el
com.adobe.icc.editors.model.el.operands
com.adobe.icc.editors.model.el.operators
com.adobe.icc.enum
com.adobe.icc.external.dc
com.adobe.icc.obj
com.adobe.icc.services
com.adobe.icc.services.category
com.adobe.icc.services.config
com.adobe.icc.services.download
com.adobe.icc.services.export
com.adobe.icc.services.external
com.adobe.icc.services.formbridge
com.adobe.icc.services.fragmentlayout
com.adobe.icc.services.layout
com.adobe.icc.services.letter
com.adobe.icc.services.locator
com.adobe.icc.services.module
com.adobe.icc.services.render
com.adobe.icc.services.submit
com.adobe.icc.services.user
com.adobe.icc.token
com.adobe.icc.vo
com.adobe.icc.vo.render
com.adobe.icomm.assetplacement.controller
com.adobe.icomm.assetplacement.controller.utils
com.adobe.icomm.assetplacement.data
com.adobe.icomm.assetplacement.model
com.adobe.livecycle.assetmanager.client
com.adobe.livecycle.assetmanager.client.event
com.adobe.livecycle.assetmanager.client.handler
com.adobe.livecycle.assetmanager.client.managers
com.adobe.livecycle.assetmanager.client.model
com.adobe.livecycle.assetmanager.client.model.cms
com.adobe.livecycle.assetmanager.client.service
com.adobe.livecycle.assetmanager.client.service.search
com.adobe.livecycle.assetmanager.client.service.search.cms
com.adobe.livecycle.assetmanager.client.utils
com.adobe.livecycle.content
com.adobe.livecycle.rca.model
com.adobe.livecycle.rca.model.constant
com.adobe.livecycle.rca.model.document
com.adobe.livecycle.rca.model.participant
com.adobe.livecycle.rca.model.reminder
com.adobe.livecycle.rca.model.stage
com.adobe.livecycle.rca.service
com.adobe.livecycle.rca.service.core
com.adobe.livecycle.rca.service.core.delegate
com.adobe.livecycle.rca.service.process
com.adobe.livecycle.rca.service.process.delegate
com.adobe.livecycle.rca.token
com.adobe.livecycle.ria.security.api
com.adobe.livecycle.ria.security.service
com.adobe.mosaic.layouts
com.adobe.mosaic.layouts.dragAndDrop
com.adobe.mosaic.layouts.interfaces
com.adobe.mosaic.mxml
com.adobe.mosaic.om.constants
com.adobe.mosaic.om.events
com.adobe.mosaic.om.impl
com.adobe.mosaic.om.interfaces
com.adobe.mosaic.skinning
com.adobe.mosaic.sparklib.editors
com.adobe.mosaic.sparklib.optionMenu
com.adobe.mosaic.sparklib.scrollableMenu
com.adobe.mosaic.sparklib.scrollableMenu.skins
com.adobe.mosaic.sparklib.tabLayout
com.adobe.mosaic.sparklib.tabLayout.events
com.adobe.mosaic.sparklib.tabLayout.layouts
com.adobe.mosaic.sparklib.tabLayout.skins
com.adobe.mosaic.sparklib.text
com.adobe.mosaic.sparklib.util
com.adobe.solutions.acm.authoring.presentation
com.adobe.solutions.acm.authoring.presentation.actionbar
com.adobe.solutions.acm.authoring.presentation.common
com.adobe.solutions.acm.authoring.presentation.events
com.adobe.solutions.acm.authoring.presentation.fragment
com.adobe.solutions.acm.authoring.presentation.letter
com.adobe.solutions.acm.authoring.presentation.letter.data
com.adobe.solutions.acm.authoring.presentation.preview
com.adobe.solutions.acm.authoring.presentation.rte
com.adobe.solutions.acm.ccr.presentation
com.adobe.solutions.acm.ccr.presentation.contentcapture
com.adobe.solutions.acm.ccr.presentation.contentcapture.events
com.adobe.solutions.acm.ccr.presentation.contentcapture.preview
com.adobe.solutions.acm.ccr.presentation.datacapture
com.adobe.solutions.acm.ccr.presentation.datacapture.renderers
com.adobe.solutions.acm.ccr.presentation.pdf
com.adobe.solutions.exm
com.adobe.solutions.exm.authoring
com.adobe.solutions.exm.authoring.components.controls
com.adobe.solutions.exm.authoring.components.toolbars
com.adobe.solutions.exm.authoring.domain
com.adobe.solutions.exm.authoring.domain.expression
com.adobe.solutions.exm.authoring.domain.impl
com.adobe.solutions.exm.authoring.domain.method
com.adobe.solutions.exm.authoring.domain.variable
com.adobe.solutions.exm.authoring.enum
com.adobe.solutions.exm.authoring.events
com.adobe.solutions.exm.authoring.model
com.adobe.solutions.exm.authoring.renderer
com.adobe.solutions.exm.authoring.view
com.adobe.solutions.exm.expression
com.adobe.solutions.exm.impl
com.adobe.solutions.exm.impl.method
com.adobe.solutions.exm.method
com.adobe.solutions.exm.mock
com.adobe.solutions.exm.mock.method
com.adobe.solutions.exm.runtime
com.adobe.solutions.exm.runtime.impl
com.adobe.solutions.exm.variable
com.adobe.solutions.prm.constant
com.adobe.solutions.prm.domain
com.adobe.solutions.prm.domain.factory
com.adobe.solutions.prm.domain.impl
com.adobe.solutions.prm.domain.manager
com.adobe.solutions.prm.presentation.asset
com.adobe.solutions.prm.presentation.constant
com.adobe.solutions.prm.presentation.document
com.adobe.solutions.prm.presentation.event
com.adobe.solutions.prm.presentation.file
com.adobe.solutions.prm.presentation.project
com.adobe.solutions.prm.presentation.team
com.adobe.solutions.prm.presentation.util
com.adobe.solutions.prm.service
com.adobe.solutions.prm.services.impl
com.adobe.solutions.prm.vo
com.adobe.solutions.rca.constant
com.adobe.solutions.rca.domain
com.adobe.solutions.rca.domain.common
com.adobe.solutions.rca.domain.factory
com.adobe.solutions.rca.domain.impl
com.adobe.solutions.rca.domain.impl.manager
com.adobe.solutions.rca.domain.manager
com.adobe.solutions.rca.presentation
com.adobe.solutions.rca.presentation.comment
com.adobe.solutions.rca.presentation.constant
com.adobe.solutions.rca.presentation.event
com.adobe.solutions.rca.presentation.gantt
com.adobe.solutions.rca.presentation.gantt.ruler
com.adobe.solutions.rca.presentation.template
com.adobe.solutions.rca.presentation.template.audit
com.adobe.solutions.rca.presentation.template.definition
com.adobe.solutions.rca.presentation.template.documents
com.adobe.solutions.rca.presentation.template.stages
com.adobe.solutions.rca.presentation.util
com.adobe.solutions.rca.service
com.adobe.solutions.rca.services.impl
com.adobe.solutions.rca.vo
com.adobe.solutions.rca.vo.um
com.adobe.viewsource
fl.accessibility
fl.containers
fl.controls
fl.controls.dataGridClasses
fl.controls.listClasses
fl.controls.progressBarClasses
fl.core
fl.data
fl.display
fl.events
fl.ik
fl.lang
fl.livepreview
fl.managers
fl.motion
fl.motion.easing
fl.rsl
fl.text
fl.transitions
fl.transitions.easing
fl.video
flash.accessibility
flash.concurrent
flash.crypto
flash.data
flash.desktop
flash.display
flash.display3D
flash.display3D.textures
flash.errors
flash.events
flash.external
flash.filesystem
flash.filters
flash.geom
flash.globalization
flash.html
flash.media
flash.net
flash.net.dns
flash.net.drm
flash.notifications
flash.permissions
flash.printing
flash.profiler
flash.sampler
flash.security
flash.sensors
flash.system
flash.text
flash.text.engine
flash.text.ime
flash.ui
flash.utils
flash.xml
flashx.textLayout
flashx.textLayout.compose
flashx.textLayout.container
flashx.textLayout.conversion
flashx.textLayout.edit
flashx.textLayout.elements
flashx.textLayout.events
flashx.textLayout.factory
flashx.textLayout.formats
flashx.textLayout.operations
flashx.textLayout.utils
flashx.undo
ga.controls
ga.layouts
ga.model
ga.uiComponents
ga.util
ga.views
ga.wrappers
lc.foundation
lc.foundation.domain
lc.foundation.events
lc.foundation.ui
lc.foundation.util
lc.preloader
lc.procmgmt
lc.procmgmt.commands
lc.procmgmt.domain
lc.procmgmt.events
lc.procmgmt.formbridge
lc.procmgmt.impl
lc.procmgmt.ui.attachments
lc.procmgmt.ui.controls
lc.procmgmt.ui.controls.card
lc.procmgmt.ui.controls.renderer
lc.procmgmt.ui.help
lc.procmgmt.ui.layout
lc.procmgmt.ui.presentationmodel
lc.procmgmt.ui.process
lc.procmgmt.ui.search
lc.procmgmt.ui.startpoint
lc.procmgmt.ui.task
lc.procmgmt.ui.task.form
lc.procmgmt.ui.task.form.commands
lc.procmgmt.ui.tracking
mx.accessibility
mx.automation
mx.automation.air
mx.automation.delegates
mx.automation.delegates.advancedDataGrid
mx.automation.delegates.charts
mx.automation.delegates.containers
mx.automation.delegates.controls
mx.automation.delegates.controls.dataGridClasses
mx.automation.delegates.controls.fileSystemClasses
mx.automation.delegates.core
mx.automation.delegates.flashflexkit
mx.automation.events
mx.binding
mx.binding.utils
mx.charts
mx.charts.chartClasses
mx.charts.effects
mx.charts.effects.effectClasses
mx.charts.events
mx.charts.renderers
mx.charts.series
mx.charts.series.items
mx.charts.series.renderData
mx.charts.styles
mx.collections
mx.collections.errors
mx.containers
mx.containers.accordionClasses
mx.containers.dividedBoxClasses
mx.containers.errors
mx.containers.utilityClasses
mx.controls
mx.controls.advancedDataGridClasses
mx.controls.dataGridClasses
mx.controls.listClasses
mx.controls.menuClasses
mx.controls.olapDataGridClasses
mx.controls.scrollClasses
mx.controls.sliderClasses
mx.controls.textClasses
mx.controls.treeClasses
mx.controls.videoClasses
mx.core
mx.core.windowClasses
mx.data
mx.data.crypto
mx.data.errors
mx.data.events
mx.data.messages
mx.data.mxml
mx.data.offline.errors
mx.data.utils
mx.effects
mx.effects.easing
mx.effects.effectClasses
mx.events
mx.filters
mx.flash
mx.formatters
mx.geom
mx.graphics
mx.graphics.codec
mx.graphics.shaderClasses
mx.logging
mx.logging.errors
mx.logging.targets
mx.managers
mx.messaging
mx.messaging.channels
mx.messaging.config
mx.messaging.errors
mx.messaging.events
mx.messaging.management
mx.messaging.messages
mx.modules
mx.netmon
mx.olap
mx.olap.aggregators
mx.preloaders
mx.printing
mx.resources
mx.rpc
mx.rpc.events
mx.rpc.http
mx.rpc.http.mxml
mx.rpc.livecycle
mx.rpc.mxml
mx.rpc.remoting
mx.rpc.remoting.mxml
mx.rpc.soap
mx.rpc.soap.mxml
mx.rpc.wsdl
mx.rpc.xml
mx.skins
mx.skins.halo
mx.skins.spark
mx.skins.wireframe
mx.skins.wireframe.windowChrome
mx.states
mx.styles
mx.utils
mx.validators
org.osmf.containers
org.osmf.display
org.osmf.elements
org.osmf.events
org.osmf.layout
org.osmf.logging
org.osmf.media
org.osmf.metadata
org.osmf.net
org.osmf.net.dvr
org.osmf.net.httpstreaming
org.osmf.net.metrics
org.osmf.net.qos
org.osmf.net.rtmpstreaming
org.osmf.net.rules
org.osmf.traits
org.osmf.utils
spark.accessibility
spark.automation.delegates
spark.automation.delegates.components
spark.automation.delegates.components.gridClasses
spark.automation.delegates.components.mediaClasses
spark.automation.delegates.components.supportClasses
spark.automation.delegates.skins.spark
spark.automation.events
spark.collections
spark.components
spark.components.calendarClasses
spark.components.gridClasses
spark.components.mediaClasses
spark.components.supportClasses
spark.components.windowClasses
spark.core
spark.effects
spark.effects.animation
spark.effects.easing
spark.effects.interpolation
spark.effects.supportClasses
spark.events
spark.filters
spark.formatters
spark.formatters.supportClasses
spark.globalization
spark.globalization.supportClasses
spark.layouts
spark.layouts.supportClasses
spark.managers
spark.modules
spark.preloaders
spark.primitives
spark.primitives.supportClasses
spark.skins
spark.skins.mobile
spark.skins.mobile.supportClasses
spark.skins.spark
spark.skins.spark.mediaClasses.fullScreen
spark.skins.spark.mediaClasses.normal
spark.skins.spark.windowChrome
spark.skins.wireframe
spark.skins.wireframe.mediaClasses
spark.skins.wireframe.mediaClasses.fullScreen
spark.transitions
spark.utils
spark.validators
spark.validators.supportClasses
xd.core.axm.enterprise.view.components
xd.core.axm.enterprise.view.skins
xd.core.axm.view.components
xd.core.axm.view.components.support

语言元素

全局常量
全局函数
运算符
语句、关键字和指令
特殊类型

附录

新增内容
编译器错误
编译器警告
运行时错误
迁移到 ActionScript 3
支持的字符集
仅适用于 MXML 的标签
Motion XML 元素
Timed Text 标记
不推荐使用的元素的列表
AccessibilityImplementation 常量
如何使用 ActionScript 示例
法律声明
flash.media
public class Video
继承Video Inheritance DisplayObject Inheritance EventDispatcher Inheritance Object
子类 VideoPlayer

语言版本: ActionScript 3.0
运行时版本: AIR 1.0, Flash Player 9, Flash Lite 4

Video 类在应用程序中显示实时视频或录制视频,而无需在 SWF 文件中嵌入视频。此类创建播放下列任一类型视频的 Video 对象:在服务器上存储的或本地存储的录制的视频文件;用户捕获的实时视频。Video 对象是应用程序的显示列表中的一个显示对象,它表示在用户界面中运行视频的可见空间。

将 Video 对象与 Flash Media Server 一起使用时,可通过该对象将用户捕获的实时视频发送到服务器,然后从服务器向其他用户广播此视频。通过使用这些功能,您可以开发媒体应用程序,例如,简单的视频播放器、具有在服务器间进行多点发布功能的视频播放器或者用于用户社区的视频共享应用程序。

Flash Player 9 和更高版本支持发布和播放使用 Sorenson Spark 或 On2 VP6 编解码器编码的 FLV 文件,还支持 Alpha 通道。与以前的技术相比,On2 VP6 视频编解码器使用的带宽较少,并且提供了额外的马赛克消除滤镜和色度去环滤镜。有关视频播放和支持格式的详细信息,请参阅 flash.net.NetStream 类。

Flash Player 9.0.115.0 和更高版本支持 mipmap 处理以优化运行时,从而呈现品质和性能。对于视频播放,如果将 Video 对象的 smoothing 属性设置为 true,则 Flash Player 使用 mipmap 优化。

从 AIR 25 开始,已经在 app.xml 中为 Android 引入了一个新标签,名为 disableMediaCodec。将此标签设置为 true 会禁用媒体编解码器,并且使用 OpenMax AL 解码视频。否则,会启用媒体编解码器。默认情况下,此标签的值为 false

与显示列表中的其它显示对象一样,您可以控制 Video 对象的各种属性。例如,可以通过使用 Video 对象的 xy 属性在舞台上移动该对象,以及通过使用其 heightwidth 属性更改其大小,等等。

要播放视频流,请使用 attachCamera()attachNetStream() 将视频附加到 Video 对象。然后,使用 addChild() 将 Video 对象添加到显示列表中。

如果您使用的是 Flash Professional,则还可以将 Video 对象放在舞台上,而不是使用 addChild() 进行添加,如下所示:

  1. 如果看不到“库”面板,请选择“窗口”>“库”,让该面板显示出来。
  2. 单击“库”面板标题栏右侧的“选项”菜单,然后选择“新建视频”,在库中添加一个嵌入式 Video 对象。
  3. 在“视频属性”对话框中,命名嵌入的 Video 对象以便在库中使用,然后单击“确定”。
  4. 将该 Video 对象拖放到舞台上,然后使用属性检查器为其指定一个唯一的实例名称,如 my_video。(不要将其命名为“Video”。)

在桌面上的 AIR 应用程序中,以全屏模式播放视频会禁用任何电源和屏幕节省功能(如果操作系统允许)。

注意:Video 类不是 InteractiveObject 类的子类,因此它无法调度鼠标事件。但是,您可以对包含 Video 对象的显示对象容器调用 addEventListener() 方法。

查看示例

了解详细信息

相关 API 元素



公共属性
 属性由以下参数定义
 InheritedaccessibilityProperties : AccessibilityProperties
此显示对象的当前辅助功能选项。
DisplayObject
 Inheritedalpha : Number
表示指定对象的 Alpha 透明度值。
DisplayObject
 InheritedblendMode : String
BlendMode 类中的一个值,用于指定要使用的混合模式。
DisplayObject
 InheritedblendShader : Shader
[只写] 设置用于混合前景和背景的着色器。
DisplayObject
 InheritedcacheAsBitmap : Boolean
如果设置为 true,则 Flash 运行时将缓存显示对象的内部位图表示形式。
DisplayObject
 Inherited    cacheAsBitmapMatrix : Matrix
如果为非 null,则 Matrix 对象会定义显示对象在 cacheAsBitmap 设置为 true 时的呈现方式。
DisplayObject
 Inheritedconstructor : Object
对类对象或给定对象实例的构造函数的引用。
Object
  deblocking : int
表示作为后处理的一部分应用于已解码视频的滤镜的类型。
Video
 Inheritedfilters : Array
包含当前与显示对象关联的每个滤镜对象的索引数组。
DisplayObject
 Inheritedheight : Number
表示显示对象的高度,以像素为单位。
DisplayObject
 InheritedloaderInfo : LoaderInfo
[只读] 返回一个 LoaderInfo 对象,其中包含加载此显示对象所属的文件的相关信息。
DisplayObject
 Inheritedmask : DisplayObject
调用显示对象被指定的 mask 对象遮罩。
DisplayObject
 InheritedmetaData : Object
如果元数据是通过 PlaceObject4 标记与此 DisplayObject 的实例一起存储在 SWF 文件中的,则获取 DisplayObject 实例的元数据对象。
DisplayObject
 InheritedmouseX : Number
[只读] 表示此鼠标或用户输入设备位置的 x 坐标,以像素为单位。
DisplayObject
 InheritedmouseY : Number
[只读] 表示此鼠标或用户输入设备位置的 y 坐标,以像素为单位。
DisplayObject
 Inheritedname : String
表示 DisplayObject 的实例名称。
DisplayObject
 InheritedopaqueBackground : Object
指定显示对象是否由于具有某种背景颜色而不透明。
DisplayObject
 Inheritedparent : DisplayObjectContainer
[只读] 表示包含此显示对象的 DisplayObjectContainer 对象。
DisplayObject
 Inheritedroot : DisplayObject
[只读] 对于加载的 SWF 文件中的显示对象,root 属性是此 SWF 文件所表示的显示列表树结构部分中的顶级显示对象。
DisplayObject
 Inheritedrotation : Number
表示 DisplayObject 实例距其原始方向的旋转程度,以度为单位。
DisplayObject
 InheritedrotationX : Number
表示 DisplayObject 实例相对于 3D 父容器距离其原始方向的 x 轴旋转(以度为单位)。
DisplayObject
 InheritedrotationY : Number
表示 DisplayObject 实例相对于 3D 父容器距离其原始方向的 y 轴旋转(以度为单位)。
DisplayObject
 InheritedrotationZ : Number
表示 DisplayObject 实例相对于 3D 父容器距离其原始方向的 z 轴旋转(以度为单位)。
DisplayObject
 Inheritedscale9Grid : Rectangle
当前有效的缩放网格。
DisplayObject
 InheritedscaleX : Number
表示从注册点开始应用的对象的水平缩放比例(百分比)。
DisplayObject
 InheritedscaleY : Number
表示从对象注册点开始应用的对象的垂直缩放比例(百分比)。
DisplayObject
 InheritedscaleZ : Number
表示从对象的注册点开始应用的对象的深度缩放比例(百分比)。
DisplayObject
 InheritedscrollRect : Rectangle
显示对象的滚动矩形范围。
DisplayObject
  smoothing : Boolean
指定在缩放视频时是否应进行平滑处理(插补数据)。
Video
 Inheritedstage : Stage
[只读] 显示对象的舞台。
DisplayObject
 Inheritedtransform : flash.geom:Transform
一个对象,具有与显示对象的矩阵、颜色转换和像素范围有关的属性。
DisplayObject
  videoHeight : int
[只读] 一个整数,以像素为单位指定视频流的高度。
Video
  videoWidth : int
[只读] 一个整数,以像素为单位指定视频流的宽度。
Video
 Inheritedvisible : Boolean
显示对象是否可见。
DisplayObject
 Inheritedwidth : Number
表示显示对象的宽度,以像素为单位。
DisplayObject
 Inheritedx : Number
表示 DisplayObject 实例相对于父级 DisplayObjectContainer 本地坐标的 x 坐标。
DisplayObject
 Inheritedy : Number
表示 DisplayObject 实例相对于父级 DisplayObjectContainer 本地坐标的 y 坐标。
DisplayObject
 Inheritedz : Number
表示 DisplayObject 实例相对于 3D 父容器沿 z 轴的 z 坐标位置。
DisplayObject
公共方法
 方法由以下参数定义
  
Video(width:int = 320, height:int = 240)
创建新的 Video 实例。
Video
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
使用 EventDispatcher 对象注册事件侦听器对象,以使侦听器能够接收事件通知。
EventDispatcher
  
指定要在应用程序中 Video 对象的边界内显示的来自摄像头的视频流。
Video
  
指定要在应用程序中 Video 对象的边界内显示的视频流。
Video
  
清除 Video 对象(而非视频流)中当前显示的图像。
Video
 Inherited
将事件调度到事件流中。
EventDispatcher
 Inherited
getBounds(targetCoordinateSpace:DisplayObject):Rectangle
返回一个矩形,该矩形定义相对于 targetCoordinateSpace 对象坐标系的显示对象区域。
DisplayObject
 Inherited
getRect(targetCoordinateSpace:DisplayObject):Rectangle
返回一个矩形,该矩形根据 targetCoordinateSpace 参数定义的坐标系定义显示对象的边界,但不包括形状上的任何笔触。
DisplayObject
 Inherited
将 point 对象从舞台(全局)坐标转换为显示对象的(本地)坐标。
DisplayObject
 Inherited
将二维点从舞台(全局)坐标转换为三维显示对象的(本地)坐标。
DisplayObject
 Inherited
检查 EventDispatcher 对象是否为特定事件类型注册了任何侦听器。
EventDispatcher
 Inherited
表示对象是否已经定义了指定的属性。
Object
 Inherited
计算显示对象的边框,以确定它是否与 obj 显示对象的边框重叠或相交。
DisplayObject
 Inherited
hitTestPoint(x:Number, y:Number, shapeFlag:Boolean = false):Boolean
计算显示对象,以确定它是否与 x 和 y 参数指定的点重叠或相交。
DisplayObject
 Inherited
表示 Object 类的实例是否在指定为参数的对象的原型链中。
Object
 Inherited
将三维显示对象的(本地)坐标的三维点转换为舞台(全局)坐标中的二维点。
DisplayObject
 Inherited
将 point 对象从显示对象的(本地)坐标转换为舞台(全局)坐标。
DisplayObject
 Inherited
表示指定的属性是否存在、是否可枚举。
Object
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
从 EventDispatcher 对象中删除侦听器。
EventDispatcher
 Inherited
设置循环操作动态属性的可用性。
Object
 Inherited
返回此对象的字符串表示形式,其格式设置遵守区域设置特定的约定。
Object
 Inherited
返回指定对象的字符串表示形式。
Object
 Inherited
返回指定对象的原始值。
Object
 Inherited
检查是否用此 EventDispatcher 对象或其任何祖代为指定事件类型注册了事件侦听器。
EventDispatcher
事件
 事件 摘要 由以下参数定义
 Inherited[广播事件] Flash Player 或 AIR 应用程序获得操作系统焦点并变为活动状态时将调度此事件。EventDispatcher
 Inherited将显示对象添加到显示列表中时调度。DisplayObject
 Inherited在将显示对象直接添加到舞台显示列表或将包含显示对象的子树添加至舞台显示列表中时调度。DisplayObject
 Inherited[广播事件] Flash Player 或 AIR 应用程序失去操作系统焦点并变为非活动状态时将调度此事件。EventDispatcher
 Inherited[播放事件] 播放头进入新帧时调度。DisplayObject
 Inherited[广播事件] 播放头退出当前帧时调度。DisplayObject
 Inherited[广播事件] 在帧显示对象的构造函数运行之后但在帧脚本运行之前调度。DisplayObject
 Inherited将要从显示列表中删除显示对象时调度。DisplayObject
 Inherited在从显示列表中直接删除显示对象或删除包含显示对象的子树时调度。DisplayObject
 Inherited[广播事件] 将要更新和呈现显示列表时调度。DisplayObject
属性详细信息

deblocking

属性
deblocking:int

语言版本: ActionScript 3.0
运行时版本: AIR 1.0, Flash Player 9, Flash Lite 4

表示作为后处理的一部分应用于已解码视频的滤镜的类型。默认值为 0,表示允许视频压缩程序根据需要应用消除马赛克的滤镜。

压缩视频可能会导致产生不希望有的伪像。可以使用 deblocking 属性设置用于减少马赛克(而对于使用 On2 编解码器压缩的视频,则用于降低扭曲边缘)的过滤器。

马赛克是指组成每个视频帧的块的边界之间的可见瑕疵。扭曲边缘是指视频图像内元素周围的扭曲边缘。

有两种消除马赛克的滤镜:分别在 Sorenson 编解码器和 On2 VP6 编解码器中。此外,如果使用 On2 VP6 编解码器,则可以使用色度去环滤镜。要设置滤镜,请使用下列值之一:

  • 0 - 允许视频压缩程序根据需要应用消除马赛克的滤镜。
  • 1 - 不使用消除马赛克的滤镜。
  • 2 - 使用 Sorenson 消除马赛克的滤镜。
  • 3 -(只限 On2 视频)使用 On2 消除马赛克的滤镜,但不使用色度去环滤镜。
  • 4 -(只限 On2 视频)使用 On2 消除马赛克的滤镜和色度去环滤镜。
  • 5 - (只限 On2 视频)使用 On2 消除马赛克的滤镜和性能更高的 On2 色度去环滤镜。

如果在使用 Sorenson 编解码器时为视频选择了大于 2 的值,则 Sorenson 解码器默认为 2。

使用消除马赛克的滤镜会影响整体播放性能,而且对于高带宽视频通常没有必要。如果用户系统的功能不够强大,则用户在启用消除马赛克的滤镜的情况下播放视频可能会有困难。



实现
    public function get deblocking():int
    public function set deblocking(value:int):void

smoothing

属性 
smoothing:Boolean

语言版本: ActionScript 3.0
运行时版本: AIR 1.0, Flash Player 9, Flash Lite 4

指定在缩放视频时是否应进行平滑处理(插补数据)。为顺畅工作,运行时必须处于高品质模式(默认值)。默认值是 false(不进行平滑处理)。

对于使用 Flash Player 9.0.115.0 及更高版本进行的视频播放,请将此属性设置为 true 以利用 mipmap 图像优化。



实现
    public function get smoothing():Boolean
    public function set smoothing(value:Boolean):void

videoHeight

属性 
videoHeight:int  [只读]

语言版本: ActionScript 3.0
运行时版本: AIR 1.0, Flash Player 9, Flash Lite 4

一个整数,以像素为单位指定视频流的高度。对于实时流,此值与正在捕获该视频流的 Camera 对象的 Camera.height 属性相同。对于录制的视频文件,此值为视频高度。对于录制的视频,当此值更改时,将会调度 NetStream.Video.DimensionChange 事件。

例如,您可能需要使用此属性来确保用户以捕获时的相同大小观看视频,而无论 Video 对象在舞台上的实际大小是什么。



实现
    public function get videoHeight():int

相关 API 元素

videoWidth

属性 
videoWidth:int  [只读]

语言版本: ActionScript 3.0
运行时版本: AIR 1.0, Flash Player 9, Flash Lite 4

一个整数,以像素为单位指定视频流的宽度。对于实时流,此值与正在捕获该视频流的 Camera 对象的 Camera.width 属性相同。对于录制的视频文件,此值为视频宽度。对于录制的视频,当此值更改时,将会调度 NetStream.Video.DimensionChange 事件。

例如,您可能需要使用此属性来确保用户以捕获时的相同大小观看视频,而无论 Video 对象在舞台上的实际大小是什么。



实现
    public function get videoWidth():int

相关 API 元素

构造函数详细信息

Video

()构造函数
public function Video(width:int = 320, height:int = 240)

语言版本: ActionScript 3.0
运行时版本: AIR 1.0, Flash Player 9

创建新的 Video 实例。如果没有提供 widthheight 参数的值,将使用默认值。在初始构建后,也可以使用 Video.widthVideo.height 设置 Video 对象的宽度和高度属性。在创建新的 Video 对象时,不允许宽度和高度的值为零;如果传递零,则将应用默认值。

创建 Video 后,请调用 DisplayObjectContainer.addChild()DisplayObjectContainer.addChildAt() 方法以便将 Video 对象添加到父级 DisplayObjectContainer 对象。

参数
width:int (default = 320) — 视频的宽度(以像素为单位)。
 
height:int (default = 240) — 视频的高度,以像素为单位。

示例  ( 如何使用本示例 )

以下示例显示如何加载外部 FLV 文件:
var MyVideo:Video = new Video();
addChild(MyVideo);
 
var MyNC:NetConnection = new NetConnection();
MyNC.connect(null);
 
var MyNS:NetStream = new NetStream(MyNC);
MyNS.play("http://www.helpexamples.com/flash/video/clouds.flv");

MyVideo.attachNetStream(MyNS);

//the clouds.flv video has metadata we're not using, so create
//an error handler to ignore the message generated by the runtime
//about the metadata
MyNS.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler); 

function asyncErrorHandler(event:AsyncErrorEvent):void 
{ 
   //ignore metadata error message
} 
方法详细信息

attachCamera

()方法
public function attachCamera(camera:Camera):void

语言版本: ActionScript 3.0
运行时版本: AIR 1.0, Flash Player 9

指定要在应用程序中 Video 对象的边界内显示的来自摄像头的视频流。

使用此方法将用户捕获的实时视频附加到 Video 对象。您可以在捕获实时视频的同一台计算机或设备上本地播放该视频,也可以将其发送到 Flash Media Server,然后使用该服务器将视频流式传输到其他用户。

注意:在 iOS AIR 应用程序中,当应用程序使用 GPU 呈现模式时,不能显示摄像头视频。

参数

camera:Camera — 正在捕获视频数据的 Camera 对象。要切断与该 Video 对象的连接,请传递 null

相关 API 元素


示例
如何使用本示例
有关如何使用此方法的说明,请参阅 Camera.getCamera() 方法示例。

attachNetStream

()方法 
public function attachNetStream(netStream:NetStream):void

语言版本: ActionScript 3.0
运行时版本: AIR 1.0, Flash Player 9, Flash Lite 4

指定要在应用程序中 Video 对象的边界内显示的视频流。视频流是使用 NetStream.play() 播放的视频文件,Camera 对象或 null。如果使用视频文件,则可以将其存储在本地文件系统或 Flash Media Server 中。如果 netStream 参数的值为 null,则不会再在 Video 对象中播放视频。

如果视频文件只包含音频,则无需使用此方法;当调用 NetStream.play() 时,将自动播放视频文件的音频部分。要控制与视频文件相关联的音频,请使用用于播放视频文件的 NetStream 对象的 soundTransform 属性。

参数

netStream:NetStream — 一个 NetStream 对象。要切断与该 Video 对象的连接,请传递 null

相关 API 元素

clear

()方法 
public function clear():void

语言版本: ActionScript 3.0
运行时版本: AIR 1.0, Flash Player 9, Flash Lite 4

清除 Video 对象(而非视频流)中当前显示的图像。此方法对于处理当前图像非常有用。例如,您可以清除最后一幅图像或显示待机信息,而无需隐藏 Video 对象。

相关 API 元素

VideoExample.as

以下示例将 Video 对象与 NetConnection 和 NetStream 类一同使用,以加载和播放 FLV 文件。为了运行此示例,需要一个名称和位置与传递给 videoURL 的变量相匹配的 FLV 文件,在本例中,使用 SWF 文件所在目录下的一个名为 Video.flv 的 FLV 文件。

在本例中,创建 Video 和 NetStream 对象并调用 Video.attachNetStream()NetStream.play() 的代码放入处理函数。仅在试图连接 NetConnection 对象成功时调用处理函数,即,当 netStatus 事件返回一个 info 对象,该对象带有一个表示成功的 code 属性时,才调用该处理函数。建议先等待连接成功,然后再调用 NetStream.play()

 package {
    import flash.display.Sprite;
    import flash.events.*;
    import flash.media.Video;
    import flash.net.NetConnection;
    import flash.net.NetStream;

    public class VideoExample extends Sprite {
        private var videoURL:String = "Video.flv";
        private var connection:NetConnection;
        private var stream:NetStream;

        public function VideoExample() {
            connection = new NetConnection();
            connection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
            connection.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
            connection.connect(null);
        }

        private function netStatusHandler(event:NetStatusEvent):void {
            switch (event.info.code) {
                case "NetConnection.Connect.Success":
                    connectStream();
                    break;
                case "NetStream.Play.StreamNotFound":
                    trace("Unable to locate video: " + videoURL);
                    break;
            }
        }

        private function connectStream():void {
            stream = new NetStream(connection);
            stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
            stream.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
            var video:Video = new Video();
            video.attachNetStream(stream);
            stream.play(videoURL);
            addChild(video);
        }

        private function securityErrorHandler(event:SecurityErrorEvent):void {
            trace("securityErrorHandler: " + event);
        }
        
        private function asyncErrorHandler(event:AsyncErrorEvent):void {
            // ignore AsyncErrorEvent events.
        }
    }
 }




[ X ]为什么显示为英语?
《ActionScript 3.0 参考》中的内容以英语显示

《ActionScript 3.0 参考》中的部分内容未翻译成所有语言。当某个语言元素未翻译时,将显示为英语。例如,ga.controls.HelpBox 类未翻译成任何语言。因此在简体中文版的参考中,ga.controls.HelpBox 类显示为英语。