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

VideoPlayer  - AS3 Flash

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 示例
法律声明
fl.video
public class VideoPlayer
继承VideoPlayer Inheritance Video Inheritance DisplayObject Inheritance EventDispatcher Inheritance Object

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

与使用 FLVPlayback 组件相比,VideoPlayer 类可以让您创建出 SWF 文件稍微小一些的视频播放器。 与 FLVPlayback 组件不同的是,VideoPlayer 类不让您包含外观或播放控件,而且,尽管您无法查找或搜索提示点,但仍会发生 cuePoint 事件。 FLVPlayback 类包装 VideoPlayer 类。

由于使用 FLVPlayback 类可以访问 VideoPlayer 类中的所有功能,因此,可以在几乎所有情况下使用 FLVPlayback 类。

此外,FLVPlayback 类自动与 NCManager 类连接,以访问视频服务器(例如 Flash Media Server)上的流式 FLV 文件。 您在设置 contentPath 属性和将某个 URL 传递到 play()load() 方法时,将与 NCManager 类交互。 但是,如果您使用 VideoPlayer 类本身,则必须在 ActionScript 代码中包括以下语句,以确保包括 NCManager 类:

var _forceNCManager:fl.video.NCManager;

NCManager 类实现 INCManager 接口,且可使用实现该接口的自定义类进行替换,以管理网络通信。 如果您进行了上述替换,则还需要包括以下语句,以用提供的类名称替换 NCManager:

fl.video.VideoPlayer.iNCManagerClass = fl.video.NCManager;

如果您在使用默认的 NCManager 类,则不需要添加此语句。

注意:您还可以设置 iNCManagerClass,以便在使用 FLVPlayback 组件时替换默认的 fl.video.NCManager。

为了为多个带宽处理多个流,NCManager 支持 SMIL 的一个子集。

查看示例

相关 API 元素



公共属性
 属性由以下参数定义
 InheritedaccessibilityProperties : AccessibilityProperties
此显示对象的当前辅助功能选项。
DisplayObject
  align : String
指定如何相对于 registrationX、registrationY、registrationWidth 和 registrationHeight 属性显示视频。
VideoPlayer
 Inheritedalpha : Number
表示指定对象的 Alpha 透明度值。
DisplayObject
  autoRewind : Boolean
一个布尔值,如果为 true,则播放停止时(由于播放器到达流的末端或调用了 stop() 方法),会使 FLV 文件后退到第 1 帧。
VideoPlayer
 InheritedblendMode : String
BlendMode 类中的一个值,用于指定要使用的混合模式。
DisplayObject
 InheritedblendShader : Shader
[只写] 设置用于混合前景和背景的着色器。
DisplayObject
  bufferTime : Number
一个数字,指定开始播放视频流前要在内存中缓冲的秒数。
VideoPlayer
  bytesLoaded : uint
[只读] 一个数字,指示 HTTP 下载的下载程度,以字节数表示。
VideoPlayer
  bytesTotal : uint
[只读] 一个数字,指定 HTTP 下载的总下载字节数。
VideoPlayer
 InheritedcacheAsBitmap : Boolean
如果设置为 true,则 Flash 运行时将缓存显示对象的内部位图表示形式。
DisplayObject
 Inherited    cacheAsBitmapMatrix : Matrix
如果为非 null,则 Matrix 对象会定义显示对象在 cacheAsBitmap 设置为 true 时的呈现方式。
DisplayObject
 Inheritedconstructor : Object
对类对象或给定对象实例的构造函数的引用。
Object
 Inheriteddeblocking : int
表示作为后处理的一部分应用于已解码视频的滤镜的类型。
Video
 Inheritedfilters : Array
包含当前与显示对象关联的每个滤镜对象的索引数组。
DisplayObject
  height : Number
[覆盖] 一个数字,指定 VideoPlayer 实例的高度,以像素为单位。
VideoPlayer
  idleTimeout : Number
由于播放暂停或停止,Flash 终止与视频服务器(例如 Flash Media Server)之间的空闲连接之前等待的时间(以毫秒为单位)。
VideoPlayer
  iNCManagerClass : Object = fl.video.NCManager
[静态] 为使所有 VideoPlayer 对象将您的自定义类用作默认的 INCManager 实现,请将 iNCManagerClass 属性设置为您的自定义类的类对象或字符串名称。
VideoPlayer
  isLive : Boolean
[只读] 一个布尔值,如果是实时视频流,则为 true。
VideoPlayer
  isRTMP : Boolean
[只读] 一个布尔值,如果正在使用 RTMP 从 Flash Media Server (FMS) 流式加载 FLV 文件,则为 true。
VideoPlayer
 InheritedloaderInfo : LoaderInfo
[只读] 返回一个 LoaderInfo 对象,其中包含加载此显示对象所属的文件的相关信息。
DisplayObject
 Inheritedmask : DisplayObject
调用显示对象被指定的 mask 对象遮罩。
DisplayObject
  metadata : Object
[只读] 一个对象,它是通过调用 NetSteam.onMetaData() 回调方法(如果有)而接收到的元数据信息包。
VideoPlayer
 InheritedmetaData : Object
如果元数据是通过 PlaceObject4 标记与此 DisplayObject 的实例一起存储在 SWF 文件中的,则获取 DisplayObject 实例的元数据对象。
DisplayObject
 InheritedmouseX : Number
[只读] 表示此鼠标或用户输入设备位置的 x 坐标,以像素为单位。
DisplayObject
 InheritedmouseY : Number
[只读] 表示此鼠标或用户输入设备位置的 y 坐标,以像素为单位。
DisplayObject
 Inheritedname : String
表示 DisplayObject 的实例名称。
DisplayObject
  ncMgr : INCManager
[只读] 一个 INCManager 对象,它提供对实现 INCManager 的类的实例的访问,而该类是 NCManager 类的接口。
VideoPlayer
  netConnection : NetConnection
[只读] 允许直接访问由视频播放器创建的 NetConnection 实例。
VideoPlayer
  netStream : NetStream
[只读] 允许直接访问由视频播放器创建的 NetStream 实例。
VideoPlayer
  netStreamClientClass : Object
[静态] 为 NetStream 的客户端属性注册自定义类。
VideoPlayer
 InheritedopaqueBackground : Object
指定显示对象是否由于具有某种背景颜色而不透明。
DisplayObject
 Inheritedparent : DisplayObjectContainer
[只读] 表示包含此显示对象的 DisplayObjectContainer 对象。
DisplayObject
  playheadTime : Number
一个数字,表示当前播放头的时间或位置(以秒为单位计算),可以是小数值。
VideoPlayer
  playheadUpdateInterval : Number
一个数字,表示每个 playheadUpdate 事件之间的时间量,以毫秒为单位。
VideoPlayer
  progressInterval : Number
一个数字,表示每个 progress 事件之间的时间量,以毫秒为单位。
VideoPlayer
  registrationHeight : Number
高度,用于在自动调整大小时对齐视频内容。
VideoPlayer
  registrationWidth : Number
宽度,用于在自动调整大小时对齐视频内容。
VideoPlayer
  registrationX : Number
x 坐标,用于在自动调整大小时对齐视频内容。
VideoPlayer
  registrationY : Number
y 坐标,用于在自动调整大小时对齐视频内容。
VideoPlayer
 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
  scaleMode : String
指定在视频加载后如何调整其大小。
VideoPlayer
  scaleX : Number
[覆盖] 一个代表水平缩放的数字。
VideoPlayer
  scaleY : Number
[覆盖] 一个代表垂直缩放的数字。
VideoPlayer
 InheritedscaleZ : Number
表示从对象的注册点开始应用的对象的深度缩放比例(百分比)。
DisplayObject
 InheritedscrollRect : Rectangle
显示对象的滚动矩形范围。
DisplayObject
 Inheritedsmoothing : Boolean
指定在缩放视频时是否应进行平滑处理(插补数据)。
Video
  soundTransform : flash.media:SoundTransform
提供对 NetStream.soundTransform 属性的直接访问,以提供更多声音控制。
VideoPlayer
  source : String
[只读] 一个字符串,它指定要进行流式处理的 FLV 文件的 URL 以及如何对其进行流式处理。
VideoPlayer
 Inheritedstage : Stage
[只读] 显示对象的舞台。
DisplayObject
  state : String
[只读] 一个字符串,指定组件的状态。
VideoPlayer
  stateResponsive : Boolean
[只读] 一个布尔值,如果处于响应状态,则为 true。
VideoPlayer
  totalTime : Number
[只读] 一个数字,表示视频的总播放时间,以秒为单位。
VideoPlayer
 Inheritedtransform : flash.geom:Transform
一个对象,具有与显示对象的矩阵、颜色转换和像素范围有关的属性。
DisplayObject
  videoHeight : int
[覆盖] [只读] 加载的 FLV 文件的源宽度。
VideoPlayer
  videoWidth : int
[覆盖] [只读] 加载的 FLV 文件的源宽度。
VideoPlayer
  visible : Boolean
[覆盖] 一个布尔值,如果为 true,则 VideoPlayer 实例可见。
VideoPlayer
  volume : Number
一个数字,介于 0 到 1 的范围内,指示音量控制设置。
VideoPlayer
  width : Number
[覆盖] 一个数字,指定舞台上 VideoPlayer 实例的宽度。
VideoPlayer
  x : Number
[覆盖] 一个数字,指定视频播放器的水平位置,以像素为单位。
VideoPlayer
  y : Number
[覆盖] 一个数字,指定视频播放器的垂直位置,以像素为单位。
VideoPlayer
 Inheritedz : Number
表示 DisplayObject 实例相对于 3D 父容器沿 z 轴的 z 坐标位置。
DisplayObject
公共方法
 方法由以下参数定义
  
VideoPlayer(width:int = 320, height:int = 240)
创建一个具有指定宽度和高度的 VideoPlayer 对象。
VideoPlayer
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
使用 EventDispatcher 对象注册事件侦听器对象,以使侦听器能够接收事件通知。
EventDispatcher
 Inherited
指定要在应用程序中 Video 对象的边界内显示的来自摄像头的视频流。
Video
 Inherited
指定要在应用程序中 Video 对象的边界内显示的视频流。
Video
 Inherited
清除 Video 对象(而非视频流)中当前显示的图像。
Video
  
强制关闭视频流和 Flash Media Server 连接。
VideoPlayer
 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
  
load(url:String, totalTime:Number = NaN, isLive:Boolean = false, startTime:Number = NaN, duration:Number = NaN):void
与 play() 方法类似,但使 FLV 文件加载而不播放。
VideoPlayer
 Inherited
将三维显示对象的(本地)坐标的三维点转换为舞台(全局)坐标中的二维点。
DisplayObject
 Inherited
将 point 对象从显示对象的(本地)坐标转换为舞台(全局)坐标。
DisplayObject
  
在调用 INCManager.connectToURL() 方法后,连接完成或失败后由 INCManager 调用。
VideoPlayer
  
在调用 INCManager.reconnect() 方法后,重新连接完成或失败后由 INCManager 调用。
VideoPlayer
  
暂停视频播放。
VideoPlayer
  
play(url:String = null, totalTime:Number = NaN, isLive:Boolean = false, startTime:Number = NaN, duration:Number = NaN):void
让视频播放。
VideoPlayer
  
当下载到足以播放时播放 FLV 文件。
VideoPlayer
 Inherited
表示指定的属性是否存在、是否可枚举。
Object
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
从 EventDispatcher 对象中删除侦听器。
EventDispatcher
  
在文件中搜索到给定时间,以秒为单位指定,精确到小数点后三位(毫秒)。
VideoPlayer
 Inherited
设置循环操作动态属性的可用性。
Object
  
setScale(scaleX:Number, scaleY:Number):void
同时设置 scaleX 和 scaleY 属性。
VideoPlayer
  
setSize(width:Number, height:Number):void
同时设置 width 和 height 属性。
VideoPlayer
  
停止视频播放。
VideoPlayer
 Inherited
返回此对象的字符串表示形式,其格式设置遵守区域设置特定的约定。
Object
 Inherited
返回指定对象的字符串表示形式。
Object
 Inherited
返回指定对象的原始值。
Object
 Inherited
检查是否用此 EventDispatcher 对象或其任何祖代为指定事件类型注册了事件侦听器。
EventDispatcher
事件
 事件 摘要 由以下参数定义
 Inherited[广播事件] Flash Player 或 AIR 应用程序获得操作系统焦点并变为活动状态时将调度此事件。EventDispatcher
 Inherited将显示对象添加到显示列表中时调度。DisplayObject
 Inherited在将显示对象直接添加到舞台显示列表或将包含显示对象的子树添加至舞台显示列表中时调度。DisplayObject
  由于 autoRewind 属性设置为 true 而将播放头移至视频播放器的开始位置时调度。VideoPlayer
  在以下情况下,VideoPlayer 实例会调度此事件:由于超时或通过调用 close() 方法而关闭 NetConnection,或者您调用了 load() 或 play() 方法或设置了 source 属性,从而导致 RTMP 连接关闭。VideoPlayer
  因为播放器到达 FLV 文件的末尾而完成播放时进行调度。VideoPlayer
  到达提示点时调度。VideoPlayer
 Inherited[广播事件] Flash Player 或 AIR 应用程序失去操作系统焦点并变为非活动状态时将调度此事件。EventDispatcher
  drmAuthenticate 事件VideoPlayer
  
    drmError
drmError 事件VideoPlayer
  
    drmStatus
drmError 事件VideoPlayer
 Inherited[播放事件] 播放头进入新帧时调度。DisplayObject
 Inherited[广播事件] 播放头退出当前帧时调度。DisplayObject
 Inherited[广播事件] 在帧显示对象的构造函数运行之后但在帧脚本运行之前调度。DisplayObject
  在调整视频播放器大小或布置视频播放器时调度。VideoPlayer
  第一次到达 FLV 文件的元数据时调度。VideoPlayer
  在 FLV 文件按 playheadUpdateInterval 属性所指定的频率播放或者开始后退时调度该事件。VideoPlayer
  根据已加载的字节数指示完成的进度。VideoPlayer
  FLV 文件已加载并可以显示时调度此事件。VideoPlayer
 Inherited将要从显示列表中删除显示对象时调度。DisplayObject
 Inherited在从显示列表中直接删除显示对象或删除包含显示对象的子树时调度。DisplayObject
 Inherited[广播事件] 将要更新和呈现显示列表时调度。DisplayObject
  播放状态发生更改时调度。VideoPlayer
公共常量
 常量由以下参数定义
  SHORT_VERSION : String = "2.1"
[静态] 指示组件短版本号的状态变量。
VideoPlayer
  VERSION : String = "2.1.0.23"
[静态] 指示组件长版本号的状态变量。
VideoPlayer
属性详细信息

align

属性
align:String

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

指定如何相对于 registrationXregistrationYregistrationWidthregistrationHeight 属性显示视频。 当将 scaleMode 属性设置为 VideoScaleMode.MAINTAIN_ASPECT_RATIOVideoScaleMode.NO_SCALE 时,align 属性执行该自动布局。 在加载 FLV 文件后更改该属性会使自动布局立即开始。 值来自 VideoAlign 类。

默认值为 VideoAlign.CENTER。



实现
    public function get align():String
    public function set align(value:String):void

相关 API 元素

autoRewind

属性 
autoRewind:Boolean

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

一个布尔值,如果为 true,则播放停止时(由于播放器到达流的末端或调用了 stop() 方法),会使 FLV 文件后退到第 1 帧。 此属性对于实时流无意义。

默认值为 false。



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

bufferTime

属性 
bufferTime:Number

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

一个数字,指定开始播放视频流前要在内存中缓冲的秒数。 对于通过 RTMP 流式处理的 FLV 文件(它们并不下载并且只在内存中缓冲),使该设置的值大于默认值 0.1 十分重要。对于通过 HTTP 渐进式下载的 FLV 文件,增加该值只会带来很小的好处,尽管它可以改善在旧式、速度较慢的计算机上查看高质量视频的效果。

对于预先录制(非实时)的视频,请不要将 bufferTime 属性设置为 0;应使用默认缓冲时间或增加缓冲时间。

此属性并不指定在开始播放前要下载的 FLV 文件量。



实现
    public function get bufferTime():Number
    public function set bufferTime(value:Number):void

相关 API 元素

bytesLoaded

属性 
bytesLoaded:uint  [只读]

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

一个数字,指示 HTTP 下载的下载程度,以字节数表示。 在没有流时、流来自 Flash Media Server (FMS) 时或者没有可用信息时,返回 0。 返回值只用于 HTTP 下载。



实现
    public function get bytesLoaded():uint

bytesTotal

属性 
bytesTotal:uint  [只读]

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

一个数字,指定 HTTP 下载的总下载字节数。 在没有流时、流来自 Flash Media Server (FMS) 时或者没有可用信息时,返回 -1。 返回值只用于 HTTP 下载。



实现
    public function get bytesTotal():uint

height

属性 
height:Number[覆盖]

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

一个数字,指定 VideoPlayer 实例的高度,以像素为单位。

注意:请勿将该属性与类似于 fl.video.VideoPlayer.videoHeight 属性的 flash.media.Video.height 属性混淆。



实现
    override public function get height():Number
    override public function set height(value:Number):void

相关 API 元素

idleTimeout

属性 
idleTimeout:Number

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

由于播放暂停或停止,Flash 终止与视频服务器(例如 Flash Media Server)之间的空闲连接之前等待的时间(以毫秒为单位)。此属性对通过 HTTP 的 FLV 文件下载没有影响。

如果设置了此属性,则视频流空闲时,会用新值重新开始超时期间。



实现
    public function get idleTimeout():Number
    public function set idleTimeout(value:Number):void

iNCManagerClass

属性 
public static var iNCManagerClass:Object = fl.video.NCManager

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

为使所有 VideoPlayer 对象将您的自定义类用作默认的 INCManager 实现,请将 iNCManagerClass 属性设置为您的自定义类的类对象或字符串名称。 FLVPlayback 类包含自定义类的定义,而视频播放器则不包含。

默认值为“fl.video.NCManager”字符串。

isLive

属性 
isLive:Boolean  [只读]

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

一个布尔值,如果是实时视频流,则为 true。只有从视频服务器(例如 Flash Media Server)或其他 Flash 视频流服务进行流式加载时,此属性才有效。 对于 HTTP 下载,会忽略此属性的值。

将预先录制的视频流发送到视频播放器时,将 isLive 属性设置为 false;发送实时数据(如实时广播)时将该属性设置为 true。为提高性能,请在将 isLive 属性设置为 false 时不要将 bufferTime 属性设置为 0



实现
    public function get isLive():Boolean

相关 API 元素

isRTMP

属性 
isRTMP:Boolean  [只读]

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

一个布尔值,如果正在使用 RTMP 从 Flash Media Server (FMS) 流式加载 FLV 文件,则为 true。对于任何其他 FLV 文件源,它的值都是 false



实现
    public function get isRTMP():Boolean

相关 API 元素

metadata

属性 
metadata:Object  [只读]

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

一个对象,它是通过调用 NetSteam.onMetaData() 回调方法(如果有)而接收到的元数据信息包。 调度 metadataReceived 事件后准备就绪。

如果 FLV 文件是用 Flash 8 编码器编码的,则 metadata 属性包含以下信息。早期的 FLV 文件只包含 heightwidthduration 值。

参数描述
canSeekToEnd一个布尔值,如果 FLV 文件是用最后一帧(它允许定位到渐进式下载影片剪辑的末尾)上的关键帧编码的,则该值为 true。如果 FLV 文件不是用最后一帧上的关键帧编码的,则该值为 false
cuePoints嵌入在 FLV 文件中的提示点对象组成的数组,每个提示点对应一个对象。 如果 FLV 文件不包含任何提示点,则值是未定义的。每个对象都具有以下属性:
  • type -- 一个字符串,它将提示点的类型指定为“navigation”或“event”。
  • name -- 一个字符串,表示提示点的名称。
  • time -- 一个数字,表示以秒为单位的提示点的时间,精确到三位小数(毫秒)。
  • parameters -- 一个可选对象,具有用户在创建提示点时指定的名称-值对。
audiocodecid一个数字,指示已使用的音频编解码器(编码/解码技术)。
audiodelay 一个数字,在源文件中表示时间 0,从该时间起对 FLV 文件进行编码。

视频内容延迟很短的一段时间,以便与音频同步。例如,如果 audiodelay 值为 .038,则在源文件里从时间 0 处开始的视频在 FLV 文件里从时间 .038 处开始。

请注意,FLVPlayback 和 VideoPlayer 类将在其时间设置中补偿该延迟。 这意味着您可以继续使用在源文件中所使用的时间设置。

audiodatarate一个数字,表示每秒音频的千字节数。
videocodecid一个数字,表示用于对视频进行编码的编解码器版本。
framerate一个数字,表示 FLV 文件的帧频。
videodatarate一个数字,表示 FLV 文件的视频数据速率。
height一个数字,表示 FLV 文件的高度。
width一个数字,表示 FLV 文件的宽度。
duration一个数字,以秒为单位指定 FLV 文件的持续时间。



实现
    public function get metadata():Object

相关 API 元素

ncMgr

属性 
ncMgr:INCManager  [只读]

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

一个 INCManager 对象,它提供对实现 INCManager 的类的实例的访问,而该类是 NCManager 类的接口。

您可以使用此属性来实现需要自定义初始化的自定义 INCManager。



实现
    public function get ncMgr():INCManager

相关 API 元素

netConnection

属性 
netConnection:NetConnection  [只读]

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

允许直接访问由视频播放器创建的 NetConnection 实例。



实现
    public function get netConnection():NetConnection

netStream

属性 
netStream:NetStream  [只读]

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

允许直接访问由视频播放器创建的 NetStream 实例。



实现
    public function get netStream():NetStream

netStreamClientClass

属性 
public static var netStreamClientClass:Object

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.115.0, AIR 1.0

为 NetStream 的客户端属性注册自定义类。 在默认情况下,使用 fl.video.VideoPlayerClient;此类处理 onMetaData()onCuePoint() 消息。 若要为其他消息添加自定义处理,例如 onImageData()onTextData(),您可以创建自己的类并将此属性设置为该类。

该类的构造函数必须使用一个 VideoPlayer 实例作为其唯一参数,而且该参数必须具有可以使用 Boolean 值的属性。 当客户端仍在等待文件开始处应有的数据消息时,此属性应该为 false。如果在接收这些消息之前 VideoPlayer 执行其调整大小或自动后退,而可能无法再收到这些消息。 默认情况下,一调用 onMetaData()fl.video.VideoPlayerClient 就会从 ready 属性返回 true

您可以将该属性设置为该类对象本身(如下例所示)或该类的字符串名称:

        import fl.video.
        VideoPlayer.netStreamClientClass = MyCustomClient;
        

请注意:仅仅将其设置为该类的字符串名称是无法强制该类编译到 SWF 中的。 默认值是类对象 fl.video.VideoPlayerClient,而不是字符串名称。

极力建议将任何自定义实现都作为 fl.video.VideoPlayer 的子类。 其他方式都有可能造成破坏元数据和 VideoPlayer 和 FLVPlayback 组件中内置的提示点处理。

默认值为 fl.video.VideoPlayerClient。


引发
VideoError — 如果将此属性设置为无效值,则会引发 VideoError.NETSTREAM_CLIENT_CLASS_UNSET

playheadTime

属性 
playheadTime:Number

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

一个数字,表示当前播放头的时间或位置(以秒为单位计算),可以是小数值。 设置此属性会触发搜索,并具有搜索的所有限制。

播放头时间发生变化(包括播放 FLV 文件时每隔 0.25 秒更改一次)时,该组件会调度 playheadUpdate 事件。

由于几种原因,在调用一种搜索方法或者设置 playheadTime 以引发搜索后,playheadTime 属性中不太可能立即包含预期值。 首先,对于渐进式下载,由于只能搜索关键帧,因此搜索将转到指定时间后第一个关键帧的时间。(对于流式下载,搜索总是转到指定的确切时间,即使 FLV 源文件在此处没有关键帧也是如此。)其次,由于搜索是异步执行的,因此,如果调用 seek 方法或者设置 playheadTime 属性,则 playheadTime 不会立即更新。 若要在搜索完成后获取时间,请侦听 seek 事件,该事件在 playheadTime 属性更新后才会引发。



实现
    public function get playheadTime():Number
    public function set playheadTime(value:Number):void

相关 API 元素

playheadUpdateInterval

属性 
playheadUpdateInterval:Number

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

一个数字,表示每个 playheadUpdate 事件之间的时间量,以毫秒为单位。 播放 FLV 文件时设置此属性会重新启动计时器。

因为 ActionScript 提示点在播放头更新时开始,所以,降低 playheadUpdateInterval 属性的值可增加 ActionScript 提示点的精确度。

因为播放头更新间隔是通过调用全局 setInterval() 方法设置的,所以,更新操作无法比 SWF 文件帧频更频繁地触发,这与此方法设置的任何间隔一样。 因此,举例来说,对于每秒 12 帧的默认帧频而言,您可以创建的最低有效间隔大约为 83 毫秒,或者 1 秒(1000 毫秒)的 12 分之 1。

默认值为 250。



实现
    public function get playheadUpdateInterval():Number
    public function set playheadUpdateInterval(value:Number):void

相关 API 元素

progressInterval

属性 
progressInterval:Number

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

一个数字,表示每个 progress 事件之间的时间量,以毫秒为单位。 如果您在播放视频流时设置此属性,则会重新启动记时器。



实现
    public function get progressInterval():Number
    public function set progressInterval(value:Number):void

registrationHeight

属性 
registrationHeight:Number

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

高度,用于在自动调整大小时对齐视频内容。 请勿将 registrationHeight 属性与 height 属性混淆。 height 属性反映视频内容的实际高度。

示例 1,使用下列设置加载一 80x80 FLV 文件:

  • registrationX = 100
  • registrationY = 100
  • registrationWidth = 60
  • registrationHeight = 40
  • align = VideoAlign.CENTER
  • scaleMode = VideoScaleMode.NO_SCALE
经过自动调整大小后,您将得到:
  • x = 90
  • y = 80
  • width = 80
  • height = 80

示例 2,使用下列设置加载与示例 1 相同的场景:

  • scaleMode = VideoScaleMode.MAINTAIN_ASPECT_RATIO
您将得到:
  • x = 110
  • y = 100
  • width = 40
  • height = 80

示例 3,使用下列设置加载与示例 2 相同的场景:

  • scaleMode = VideoScaleMode.EXACT_FIT
您将获得与注册值相同的所有值:
  • x = 100
  • y = 100
  • width = 60
  • height = 40

设置 registrationHeight 属性等同于设置 height 属性,反之亦然。 设置任何其他属性或调用更改高度的任何方法(例如 scaleXsetSizesetScale)也会使 heightregistrationHeight 保持同步。



实现
    public function get registrationHeight():Number
    public function set registrationHeight(value:Number):void

相关 API 元素

registrationWidth

属性 
registrationWidth:Number

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

宽度,用于在自动调整大小时对齐视频内容。 请勿将 registrationWidth 属性与 width 属性混淆。 width 属性反映视频内容的实际宽度。

示例 1,使用下列设置加载一 80x80 FLV 文件:

  • registrationX = 100
  • registrationY = 100
  • registrationWidth = 60
  • registrationHeight = 40
  • align = VideoAlign.CENTER
  • scaleMode = VideoScaleMode.NO_SCALE
经过自动调整大小后,您将得到:
  • x = 90
  • y = 80
  • width = 80
  • height = 80

示例 2,使用下列设置加载与示例 1 相同的场景:

  • scaleMode = VideoScaleMode.MAINTAIN_ASPECT_RATIO
您将得到:
  • x = 110
  • y = 100
  • width = 40
  • height = 80

示例 3,使用下列设置加载与示例 2 相同的场景:

  • scaleMode = VideoScaleMode.EXACT_FIT
您将获得与注册值相同的所有值:
  • x = 100
  • y = 100
  • width = 60
  • height = 40

设置 registrationWidth 属性等同于设置 width 属性,反之亦然。 设置任何其他属性或调用更改宽度的任何方法(例如 scaleXsetSizesetScale)也会使 widthregistrationWidth 保持同步。



实现
    public function get registrationWidth():Number
    public function set registrationWidth(value:Number):void

相关 API 元素

registrationX

属性 
registrationX:Number

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

x 坐标,用于在自动调整大小时对齐视频内容。 请勿将其与反映视频内容实际位置的 x 属性混淆。

示例 1,使用下列设置加载一 80x80 FLV 文件:

  • registrationX = 100
  • registrationY = 100
  • registrationWidth = 60
  • registrationHeight = 40
  • align = VideoAlign.CENTER
  • scaleMode = VideoScaleMode.NO_SCALE
经过自动调整大小后,您将得到:
  • x = 90
  • y = 80
  • width = 80
  • height = 80

示例 2,使用下列设置加载与示例 1 相同的场景:

  • scaleMode = VideoScaleMode.MAINTAIN_ASPECT_RATIO
您将得到:
  • x = 110
  • y = 100
  • width = 40
  • height = 80

示例 3,使用下列设置加载与示例 2 相同的场景:

  • scaleMode = VideoScaleMode.EXACT_FIT
您将获得与注册值相同的所有值:
  • x = 100
  • y = 100
  • width = 60
  • height = 40

如果设置了 xregistrationX 属性,则第二个属性会更改以维持其与第一个属性的偏移量。 例如,如果 x = 10 且 registrationX = 20,则设置 x = 110 的同时也会设置 registrationX = 120。



实现
    public function get registrationX():Number
    public function set registrationX(value:Number):void

相关 API 元素

registrationY

属性 
registrationY:Number

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

y 坐标,用于在自动调整大小时对齐视频内容。 请勿将其与反映视频内容实际位置的 y 属性混淆。

示例 1,使用下列设置加载一 80x80 FLV 文件:

  • registrationX = 100
  • registrationY = 100
  • registrationWidth = 60
  • registrationHeight = 40
  • align = VideoAlign.CENTER
  • scaleMode = VideoScaleMode.NO_SCALE
经过自动调整大小后,您将得到:
  • x = 90
  • y = 80
  • width = 80
  • height = 80

示例 2,使用下列设置加载与示例 1 相同的场景:

  • scaleMode = VideoScaleMode.MAINTAIN_ASPECT_RATIO
您将得到:
  • x = 110
  • y = 100
  • width = 40
  • height = 80

示例 3,使用下列设置加载与示例 2 相同的场景:

  • scaleMode = VideoScaleMode.EXACT_FIT
您将获得与注册值相同的所有值:
  • x = 100
  • y = 100
  • width = 60
  • height = 40

如果设置了 yregistrationY 属性,则第二个属性会更改以维持其与第一个属性的偏移量。 例如,如果 y = 10 且 registrationY = 20,则设置 y = 110 的同时也会设置 registrationY = 120。



实现
    public function get registrationY():Number
    public function set registrationY(value:Number):void

相关 API 元素

scaleMode

属性 
scaleMode:String

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

指定在视频加载后如何调整其大小。 如果设置为 VideoScaleMode.MAINTAIN_ASPECT_RATIO,则将视频高宽比保持在由 registrationXregistrationYregistrationWidthregistrationHeight 所定义的矩形内。 如果设置为 VideoScaleMode.NO_SCALE,则会使视频自动调整为源 FLV 文件尺寸大小。 如果设置为 VideoScaleMode.EXACT_FIT,则忽略源 FLV 文件的尺寸大小,并将视频拉伸到适合 registrationXregistrationYregistrationWidthregistrationHeight 所定义的矩形。 如果在加载 FLV 文件后设置该属性,则立即开始自动布局。 值来自 VideoScaleMode

默认值为 VideoScaleMode.MAINTAIN_ASPECT_RATIO。



实现
    public function get scaleMode():String
    public function set scaleMode(value:String):void

相关 API 元素

scaleX

属性 
scaleX:Number[覆盖]

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

一个代表水平缩放的数字。

默认值为 1。



实现
    override public function get scaleX():Number
    override public function set scaleX(value:Number):void

相关 API 元素

scaleY

属性 
scaleY:Number[覆盖]

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

一个代表垂直缩放的数字。

默认值为 1。



实现
    override public function get scaleY():Number
    override public function set scaleY(value:Number):void

相关 API 元素

soundTransform

属性 
soundTransform:flash.media:SoundTransform

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

提供对 NetStream.soundTransform 属性的直接访问,以提供更多声音控制。 设置此属性以更改设置;使用此属性的 getter 存取器方法来恢复当前设置。



实现
    public function get soundTransform():flash.media:SoundTransform
    public function set soundTransform(value:flash.media:SoundTransform):void

相关 API 元素

source

属性 
source:String  [只读]

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

一个字符串,它指定要进行流式处理的 FLV 文件的 URL 以及如何对其进行流式处理。 URL 可以是指向 FLV 文件的 HTTP URL、指向流的 RTMP URL,也可以是指向 XML 文件的 HTTP URL。

如果您通过组件检查器或属性检查器设置了此属性,则 FLV 文件在发生下一个 enterFrame 事件时开始加载和播放。 在延迟期间可以设置影响加载的 isLiveautoPlaycuePoints 等属性。 它还允许放置在第一帧上的 ActionScript 在 FLVPlayback 组件开始播放前对其产生影响。

如果您通过 ActionScript 设置该属性,则它会在 autoPlay 属性设置为 false 时,立即调用 VideoPlayer.load() 方法。 或者,它会在 autoPlay 属性设置为 true 时调用 VideoPlayer.play() 方法。 autoPlaytotalTimeisLive 属性影响新 FLV 文件的加载方式,因此,如果您要设置这些属性,则必须在设置 source 属性前设置它们。

通过将 autoPlay 属性设置为 false,可以防止自动播放新的 FLV 文件。



实现
    public function get source():String

相关 API 元素

state

属性 
state:String  [只读]

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

一个字符串,指定组件的状态。 该属性通过 load()play()stop()pause()seek() 方法进行设置。

state 属性的可能值包括:bufferingconnectionErrordisconnectedloadingpausedplayingrewindingseekingstopped。您可以使用 FLVPlayback 类属性测试这些状态。



实现
    public function get state():String

相关 API 元素

stateResponsive

属性 
stateResponsive:Boolean  [只读]

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

一个布尔值,如果处于响应状态,则为 true。如果状态为不可响应状态,则对 play()load()stop()pause()seek() 方法的调用将被排队,以供以后在状态更改为可响应状态时执行。 因为这些调用被排队并在以后执行,所以,通常不必跟踪 stateResponsive 属性的值。 可响应状态是:stoppedplayingpausedbuffering



实现
    public function get stateResponsive():Boolean

相关 API 元素

totalTime

属性 
totalTime:Number  [只读]

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

一个数字,表示视频的总播放时间,以秒为单位。

在从 Flash Media Server (FMS) 进行流式加载并使用默认的 NCManager 时,服务器端应用程序编程接口 (API) 会自动确定此值,并且该值会覆盖通过此属性设置或从元数据中收集的任何值。 设置 source 属性后,可以在到达 stoppedplaying 状态时读取此属性。 此属性对于来自 FMS 的实时流无意义。

对于 HTTP 下载,如果 FLV 文件嵌入了元数据,则会自动确定该值;如果未嵌入元数据,则应明确设置该值,否则该值将为 NaN。 如果明确设置该值,则将忽略流中的元数据值。

设置此属性时,该值会影响通过设置 source 加载的下一个 FLV 文件。 但它对已加载的 FLV 文件没有任何影响。 而且,在加载 FLV 文件之后,此属性才会返回传递到其中的新值。

如果从未设置此属性(明确或自动),则播放仍有效,但可能会导致搜索控件出问题。

除非明确设置该值,否则在将其设置为一个来自元数据的有效值之前,该值一直为 NaN。



实现
    public function get totalTime():Number

相关 API 元素

videoHeight

属性 
videoHeight:int  [只读] [覆盖]

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

加载的 FLV 文件的源宽度。 如果还没有可用的信息,则该属性返回 -1。



实现
    override public function get videoHeight():int

相关 API 元素

videoWidth

属性 
videoWidth:int  [只读] [覆盖]

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

加载的 FLV 文件的源宽度。 如果还没有可用的信息,则该属性返回 -1。



实现
    override public function get videoWidth():int

相关 API 元素

visible

属性 
visible:Boolean[覆盖]

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

一个布尔值,如果为 true,则 VideoPlayer 实例可见。 如果为 false,则会使实例不可见。

默认值为 true。



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

volume

属性 
volume:Number

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

一个数字,介于 0 到 1 的范围内,指示音量控制设置。

默认值为 1。



实现
    public function get volume():Number
    public function set volume(value:Number):void

相关 API 元素

width

属性 
width:Number[覆盖]

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

一个数字,指定舞台上 VideoPlayer 实例的宽度。

注意flash.media.Video.width 属性与 fl.video.VideoPlayer.videoWidth 属性类似。



实现
    override public function get width():Number
    override public function set width(value:Number):void

相关 API 元素

x

属性 
x:Number[覆盖]

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

一个数字,指定视频播放器的水平位置,以像素为单位。

设置 x 属性也会影响到 registrationX 属性。 如果设置了 xregistrationX 属性,则第二个属性会更改以维持其与第一个属性的偏移量。 例如,如果 x = 10 且 registrationX = 20,则设置 x = 110 的同时也会设置 registrationX = 120。



实现
    override public function get x():Number
    override public function set x(value:Number):void

相关 API 元素

y

属性 
y:Number[覆盖]

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

一个数字,指定视频播放器的垂直位置,以像素为单位。

设置 y 属性也会影响到 registrationY 属性。 如果设置了 yregistrationY 属性,则第二个属性会更改以维持其与第一个属性的偏移量。 例如,如果 y = 10 且 registrationY = 20,则设置 y = 110 的同时也会设置 registrationY = 120。



实现
    override public function get y():Number
    override public function set y(value:Number):void

相关 API 元素

构造函数详细信息

VideoPlayer

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

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

创建一个具有指定宽度和高度的 VideoPlayer 对象。

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

相关 API 元素

方法详细信息

close

()方法
public function close():void

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

强制关闭视频流和 Flash Media Server 连接。 此方法触发 close 事件。 由于闲置超时功能会关闭流,因此通常无需直接调用该方法。

相关 API 元素

load

()方法 
public function load(url:String, totalTime:Number = NaN, isLive:Boolean = false, startTime:Number = NaN, duration:Number = NaN):void

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

play() 方法类似,但使 FLV 文件加载而不播放。 适当时会自动调整大小,并且显示 FLV 文件的第一帧。 初次加载和自动布局后,状态将为 VideoState.PAUSED

该方法使用与 play() 方法相同的参数,但如果没有 URL,则无法调用 load() 方法。 否则,将会引发错误。 如果视频播放器处于不可响应状态,则 load() 方法会将请求排队。

参数

url:String — 一个要加载的 FLV 文件的 URL 字符串。 如果不为 URL 传递任何值,则将引发带有消息 null URL sent to VideoPlayer.load 的错误。
 
totalTime:Number (default = NaN) — FLV 文件的长度。 传入 0、null 或未定义的值将自动从元数据、服务器或 XML 中检测长度。
 
isLive:Boolean (default = false) — 如果从 Flash Media Server (FMS) 流式加载实时输入信号,则值为 true
 
startTime:Number (default = NaN) — 时间(以秒为单位),在给定媒体中被视作 0 时间。将从此处开始播放,playheadTime 认为 startTime 是 0 时间,并且不可能搜寻此时间点前的位置(搜索到 0 将搜索到给定 startTime)。如果 isLive 为 true,则忽略此参数。
 
duration:Number (default = NaN) — 时间(以秒为单位),用作媒体的持续时间。仅当 startTime <= 0 时使用。此参数与 startTime 一起定义一段媒体,VideoPlayer 将此媒体段看作一个完整的媒体。当视频持续播放数秒时,播放将停止,并将调度 complete 事件。尝试在此持续时间范围外搜寻将失败。检索 totalTime 属性时,它将返回指定的持续时间。它与此方法的 totalTime 参数不同,因为该参数用于指定媒体的实际持续时间,这在媒体不包含具有此类信息的元数据时最为有用;如果 totalTime 短于媒体实际持续时间,它不会停止播放。而使用此持续时间参数,播放将停止。如果 isLive 为 true,则忽略此参数。

相关 API 元素

ncConnected

()方法 
public function ncConnected():void

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

在调用 INCManager.connectToURL() 方法后,连接完成或失败后由 INCManager 调用。 如果连接失败,请在调用之前将 INCManager.netConnection 属性设置为 null 或未定义的值。

相关 API 元素

ncReconnected

()方法 
public function ncReconnected():void

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

在调用 INCManager.reconnect() 方法后,重新连接完成或失败后由 INCManager 调用。 如果连接失败,请在调用之前将 INCManager.netconnection 属性设置为 null

相关 API 元素

pause

()方法 
public function pause():void

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

暂停视频播放。 如果视频已经暂停或停止,则此方法没有任何作用。若要再次开始播放,请调用 play()。不使用任何参数。

如果播放器处于不可响应状态,则 pause() 方法会将请求排队。

如果在没有连接任何流的情况下调用,则将引发异常。使用 stateChange 事件和 connected 属性可以确定何时调用此方法才是安全的。

如果播放器处于停止状态,则调用 pause() 方法没有任何作用,播放器保持在停止状态。

相关 API 元素

play

()方法 
public function play(url:String = null, totalTime:Number = NaN, isLive:Boolean = false, startTime:Number = NaN, duration:Number = NaN):void

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

让视频播放。可以在视频暂停、停止或已经在播放时调用。 调用此方法时不带任何参数将播放已加载的视频,或传入 URL 来加载新的流。

如果播放器处于不可响应状态,则会将请求排队。

如果在未连接任何流的情况下进行不带任何参数的调用,将引发异常。 使用 stateChange 事件和 connected 属性可以确定何时调用此方法才是安全的。

参数

url:String (default = null) — 如果要加载和播放新的 FLV 文件,则传入 URL 字符串。 如果已经加载了一个 FLV 文件,并想继续播放它,则传入 null
 
totalTime:Number (default = NaN) — 传入 FLV 文件的长度。 传入 0NaN 将自动从元数据、服务器或 XML 中检测长度。 如果在调用 ncConnected 属性时 INCManager.streamLength 属性不是 0null 或未定义,则其值优先于此值。
 
isLive:Boolean (default = false) — 如果从 Flash Media Server (FMS) 流式加载实时输入信号,则传入 true
 
startTime:Number (default = NaN) — 时间(以秒为单位),在给定媒体中被视作 0 时间。将从此处开始播放,playheadTime 认为 startTime 是 0 时间,并且不可能搜寻此时间点前的位置(搜索到 0 将搜索到给定 startTime)。如果 isLive 为 true,则忽略此参数。
 
duration:Number (default = NaN) — 时间(以秒为单位),用作媒体的持续时间。仅当 startTime <= 0 时使用。此参数与 startTime 一起定义一段媒体,VideoPlayer 将此媒体段看作一个完整的媒体。当视频持续播放数秒时,播放将停止,并将调度 complete 事件。尝试在此持续时间范围外搜寻将失败。检索 totalTime 属性时,它将返回指定的持续时间。它与此方法的 totalTime 参数不同,因为该参数用于指定媒体的实际持续时间,这在媒体不包含具有此类信息的元数据时最为有用;如果 totalTime 短于媒体实际持续时间,它不会停止播放。而使用此持续时间参数,播放将停止。如果 isLive 为 true,则忽略此参数。

相关 API 元素

playWhenEnoughDownloaded

()方法 
public function playWhenEnoughDownloaded():void

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

当下载到足以播放时播放 FLV 文件。 当 FLV 文件下载完成或从 Flash Media Server (FMS) 进行流式加载时,调用 playWhenEnoughDownloaded() 方法等同于调用不带参数的 play() 方法。 调用该方法不会暂停播放,因此,在大多数情况下,您可能需要在调用该方法前调用 pause() 方法。

seek

()方法 
public function seek(time:Number):void

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

在文件中搜索到给定时间,以秒为单位指定,精确到小数点后三位(毫秒)。如果正在播放视频,则视频将继续从该点播放。 如果视频已暂停,则视频将搜索到该点并保持暂停状态。 如果视频已停止,则视频搜索到该点并进入暂停状态。 使用实时流时,不起任何作用。

在调用一种搜索方法或者设置 playheadTime 以引发搜索后,playheadTime 属性可能不会立即包含预期值。 对于渐进式下载,由于只能搜索关键帧,因此搜索将转到指定时间后第一个关键帧的时间。

注意:对于流式下载,搜索总是转到指定的确切时间,即使 FLV 源文件在此处没有关键帧也是如此。

由于搜索是异步执行的,因此,如果调用 seek 方法或者设置 playheadTime 属性,则 playheadTime 将不会立即更新。 若要在搜索完成后获得这一时间,需要侦听 seek 事件,该事件只在 playheadTime 属性更新后才启动。

如果在没有连接任何流的情况下调用,则将引发异常。使用 stateChange 事件和 connected 属性可以确定何时调用此方法才是安全的。

参数

time:Number — 一个数字,指定放置播放头的时间,以秒为单位。


引发
VideoError — 如果时间 < 0 或者为 NaN

相关 API 元素

setScale

()方法 
public function setScale(scaleX:Number, scaleY:Number):void

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

同时设置 scaleXscaleY 属性。 单独设置 scaleXscaleY 会触发两次 autolayout 事件,而调用 setScale() 方法将只引发一次 autolayout 事件。

如果 scaleMode 属性为 VideoScaleMode.MAINTAIN_ASPECT_RATIOVideoScaleMode.NO_SCALE,则调用该方法会立即引发 autolayout 事件。

参数

scaleX:Number — 一个代表水平缩放的数字。
 
scaleY:Number — 一个代表垂直缩放的数字。

相关 API 元素

setSize

()方法 
public function setSize(width:Number, height:Number):void

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

同时设置 widthheight 属性。 单独设置 widthheight 会触发两次 autolayout 事件,而调用 setSize() 方法将只引发一次 autolayout 事件。

如果 scaleMode 属性为 VideoScaleMode.MAINTAIN_ASPECT_RATIOVideoScaleMode.NO_SCALE,则调用该方法会立即触发 autolayout 事件。

参数

width:Number — 视频播放器的宽度。
 
height:Number — 视频播放器的高度。

相关 API 元素

stop

()方法 
public function stop():void

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

停止视频播放。如果 autoRewind 设置为 true,则后退到第一帧。如果视频已经停止,则此方法没有任何作用。若要再次开始播放,请调用 play()。不使用任何参数。

如果播放器处于不可响应状态,则会将请求排队。

如果在没有连接任何流的情况下调用,则将引发异常。使用 stateChange 事件和 connected 属性可以确定何时调用此方法才是安全的。

相关 API 元素

事件详细信息

autoRewound

事件
事件对象类型: fl.video.VideoEvent
属性 VideoEvent.type = fl.video.VideoEvent.AUTO_REWOUND

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

由于 autoRewind 属性设置为 true 而将播放头移至视频播放器的开始位置时调度。

autoRewound 事件为 VideoEvent 类型,并具有常量 VideoEvent.AUTO_REWOUND

定义 autoRewound 事件对象的 type 属性值。

此事件具有以下属性:

属性
bubblesfalse
cancelablefalse;没有要取消的默认行为。
state一个字符串,标识来自 VideoState 类的用于描述组件播放状态的常量。
playheadTime一个数字,表示当前播放头的时间或位置。
vpVideoPlayer 对象的索引。

相关 API 元素

close

事件  
事件对象类型: fl.video.VideoEvent
属性 VideoEvent.type = fl.video.VideoEvent.CLOSE

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

在以下情况下,VideoPlayer 实例会调度此事件:由于超时或通过调用 close() 方法而关闭 NetConnection,或者您调用了 load()play() 方法或设置了 source 属性,从而导致 RTMP 连接关闭。 只有从 Flash Media Server (FMS) 或其他 Flash 视频流服务 (FVSS) 进行流式加载时,FLVPlayback 实例才调度此事件。

close 事件为 VideoEvent 类型,并具有常量 VideoEvent.CLOSE

定义 close 事件对象的 type 属性值。

此事件具有以下属性:

属性
bubblesfalse
cancelablefalse;没有要取消的默认行为。
state一个字符串,标识来自 VideoState 类的用于描述组件播放状态的常量。
playheadTime一个数字,表示当前播放头的时间或位置。
vpVideoPlayer 对象的索引。

相关 API 元素

complete

事件  
事件对象类型: fl.video.VideoEvent
属性 VideoEvent.type = fl.video.VideoEvent.COMPLETE

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

因为播放器到达 FLV 文件的末尾而完成播放时进行调度。 如果您调用 stop()pause() 方法或者单击相应的控件,则组件将不会调度该事件。

当应用程序使用渐进式下载时,将不会明确设置 totalTime 属性,还会下载未在元数据中指定持续时间的 FLV 文件。 视频播放器在调度此事件前将 totalTime 属性设置为近似的总时间值。

视频播放器还会调度 stateChangestopped 事件。

complete 事件为 VideoEvent 类型,并具有常量 VideoEvent.COMPLETE

定义 complete 事件对象的 type 属性值。

此事件具有以下属性:

属性
bubblesfalse
cancelablefalse;没有要取消的默认行为。
state一个字符串,标识来自 VideoState 类的用于描述组件播放状态的常量。
playheadTime一个数字,表示当前播放头的时间或位置。
vpVideoPlayer 对象的索引。

相关 API 元素

cuePoint

事件  
事件对象类型: fl.video.MetadataEvent
属性 MetadataEvent.type = fl.video.MetadataEvent.CUE_POINT

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

到达提示点时调度。 事件对象具有一个 info 属性,该属性包含 FLV 文件提示点的 NetStream.onCuePoint 事件回调接收的 info 对象。 对于 ActionScript 提示点,它包含传递到 ActionScript 提示点方法或属性的对象。

cuePoint 事件为 MetadataEvent 类型,并具有常量 MetadataEvent.CUE_POINT

定义 cuePoint 事件对象的 type 属性值。

此事件具有以下属性:

属性
bubblesfalse
cancelablefalse;没有要取消的默认行为。
info具有描述提示点的属性的对象。
vpVideoPlayer 对象的索引。

相关 API 元素

    

drmAuthenticate

事件  
事件对象类型: flash.events.DRMAuthenticateEvent

产品版本: Flash CS3
运行时版本: AIR 1.0

drmAuthenticate 事件

    

drmError

事件  
事件对象类型: flash.events.DRMErrorEvent

产品版本: Flash CS3
运行时版本: AIR 1.0

drmError 事件

    

drmStatus

事件  
事件对象类型: flash.events.DRMStatusEvent

产品版本: Flash CS3
运行时版本: AIR 1.0

drmError 事件

layout

事件  
事件对象类型: fl.video.LayoutEvent
属性 LayoutEvent.type = fl.video.LayoutEvent.LAYOUT

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

在调整视频播放器大小或布置视频播放器时调度。 布局有以下两种情况:

  • 通过使用 autoLayout 事件、调用 setScale()setSize() 方法或更改 widthheightscaleXscaleY 属性布置视频播放器。
  • 有两个大小不同的视频播放器,并且将 visibleVideoPlayerIndex 属性从一个视频播放器切换到另一个视频播放器。

layout 事件为 LayoutEvent 类型,并具有常量 LayoutEvent.LAYOUT

定义 layout 事件对象的 type 属性值。

此事件具有以下属性:

属性
bubblesfalse
cancelablefalse;没有要取消的默认行为。
oldBoundslayout 事件发生前,目标的 xywidthheight 属性的值。
oldRegistrationBoundslayout 事件发生前,目标的 registrationXregistrationYregistrationWidthregistrationHeight 属性的值。

相关 API 元素

metadataReceived

事件  
事件对象类型: fl.video.MetadataEvent
属性 MetadataEvent.type = fl.video.MetadataEvent.METADATA_RECEIVED

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

第一次到达 FLV 文件的元数据时调度。事件对象具有一个 info 属性,该属性包含 NetStream.onMetaData 事件回调接收的 info 对象。

metadataReceived 事件为 MetadataEvent 类型,并具有常量 MetadataEvent.METADATA_RECEIVED

定义 metadataReceived 事件对象的 type 属性值。

此事件具有以下属性:

属性
bubblesfalse
cancelablefalse;没有要取消的默认行为。
info具有描述 FLV 文件的属性的对象。
vpVideoPlayer 对象的索引。

相关 API 元素

playheadUpdate

事件  
事件对象类型: fl.video.VideoEvent
属性 VideoEvent.type = fl.video.VideoEvent.PLAYHEAD_UPDATE

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

在 FLV 文件按 playheadUpdateInterval 属性所指定的频率播放或者开始后退时调度该事件。 当视频播放器处于暂停或停止状态时,该组件不调度此事件(除非发生搜索)。

playheadUpdate 事件为 VideoEvent 类型,并具有常量 VideoEvent.PLAYHEAD_UPDATE

定义 playheadUpdate 事件对象的 type 属性值。

此事件具有以下属性:

属性
bubblesfalse
cancelablefalse;没有要取消的默认行为。
state一个字符串,标识来自 VideoState 类的用于描述组件播放状态的常量。
playheadTime一个数字,表示当前播放头的时间或位置。
vpVideoPlayer 对象的索引。

相关 API 元素

progress

事件  
事件对象类型: fl.video.VideoProgressEvent
属性 VideoProgressEvent.type = fl.video.VideoProgressEvent.PROGRESS

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

根据已加载的字节数指示完成的进度。 按 progressInterval 属性所指定的频率调度,从加载开始时开始,到所有字节加载结束或者出现网络错误时结束。 默认为每隔 0.25 秒调度一次,从调用 load 时开始,到所有字节加载结束或者出现网络错误时结束。 使用此事件可以检查已加载的字节数或缓冲区中的字节数。

仅针对渐进式 HTTP 下载进行调度。 根据已加载的字节数指示进度。 事件对象具有 bytesLoadedbytesTotal 属性,与名称相同的 FLVPlayback 属性相同。

progress 事件为 VideoProgressEvent 类型,并具有常量 VideoProgressEvent.PROGRESS

定义 progress 事件对象的 type 属性值。

此事件具有以下属性:

属性
bubblesfalse
cancelablefalse;没有要取消的默认行为。
bytesLoaded在侦听器处理事件时加载的项数或字节数。
bytesTotal如果加载过程成功,将加载的总项数或总字节数。
vpVideoPlayer 对象的索引。

相关 API 元素

ready

事件  
事件对象类型: fl.video.VideoEvent
属性 VideoEvent.type = fl.video.VideoEvent.READY

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

FLV 文件已加载并可以显示时调度此事件。 在您使用 play()load() 方法加载新的 FLV 文件后首次进入可响应状态时,该事件发生。 它只为加载的每个 FLV 文件发生一次。

ready 事件为 VideoEvent 类型,并具有常量 VideoEvent.READY

定义 ready 事件对象的 type 属性值。

此事件具有以下属性:

属性
bubblesfalse
cancelablefalse;没有要取消的默认行为。
state一个字符串,标识来自 VideoState 类的用于描述组件播放状态的常量。
playheadTime一个数字,表示当前播放头的时间或位置。
vpVideoPlayer 对象的索引。

相关 API 元素

stateChange

事件  
事件对象类型: fl.video.VideoEvent
属性 VideoEvent.type = fl.video.VideoEvent.STATE_CHANGE

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

播放状态发生更改时调度。 当 autoRewind 调用完成时,将在后退状态下调度 stateChange 事件。 stateChange 事件在后退完成前不会启动。

此事件可用于跟踪播放何时进入或离开不可响应状态(例如在连接、调整大小或后退过程中)。当播放器进入可响应状态时,play()pause()stop()seek() 方法会将要执行的请求排队。

stateChange 事件为 VideoEvent 类型,并具有常量 VideoEvent.STATE_CHANGE

定义 stateChange 事件对象的 type 属性值。

此事件具有以下属性:

属性
bubblesfalse
cancelablefalse;没有要取消的默认行为。
state一个字符串,标识来自 VideoState 类的用于描述组件播放状态的常量。
playheadTime一个数字,表示当前播放头的时间或位置。
vpVideoPlayer 对象的索引。

相关 API 元素

常量详细信息

SHORT_VERSION

常量
public static const SHORT_VERSION:String = "2.1"

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

指示组件短版本号的状态变量。 版本号在您有 FLA 文件并且需要知道组件版本时很有用。 要确定组件版本,请在 FLA 文件中键入下列 trace 代码:

FLVPlayback.SHORT_VERSION

SHORT_VERSION 变量仅包含主版本号和次版本号,例如:2.0。VERSION 变量包含主版本号和次版本号,以及修订版本号和生成版本号,例如:2.0.0.11。

相关 API 元素

VERSION

常量 
public static const VERSION:String = "2.1.0.23"

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

指示组件长版本号的状态变量。 版本号在您有 FLA 文件并且需要知道组件版本时很有用。 要确定组件版本,请在 FLA 文件中键入下列 trace 代码:

FLVPlayback.VERSION

VERSION 变量包含主版本号和次版本号,以及修订版本号和生成版本号,例如:2.0.0.11。SHORT_VERSION 变量仅包含主版本号和次版本号,例如:2.0。

相关 API 元素

VideoPlayerExample.as

此示例动态创建两个 VideoPlayer 实例,并为其中一个实例设置了模糊滤镜。

若要运行该示例,请按照下列步骤操作:

  1. 在库中添加 FLVPlayback 组件。
  2. testVideoPath 替换为一 FLV 文件的绝对路径或相对路径。
  3. 将该代码作为 VideoPlayerExample.as 另存到 FLA 文件所在的同一目录中。
  4. 将 FLA 文件中的 Document 类设置为 VideoPlayerExample。
package
{
    import fl.video.VideoPlayer;
    import flash.display.Sprite;
    import flash.filters.BlurFilter;

    public class VideoPlayerExample extends Sprite 
    {
        private var videoPath:String = "http://www.helpexamples.com/flash/video/sheep.flv"
        private var player:VideoPlayer;
        private var blurryPlayer:VideoPlayer;
        
        public function VideoPlayerExample() {
            player = new VideoPlayer();
            player.play(videoPath);
            player.setScale(0.75, 0.75);
            addChild(player);
            
            blurryPlayer = new VideoPlayer();
            blurryPlayer.play(videoPath);
            blurryPlayer.setScale(0.75,0.75);
            blurryPlayer.filters = [ new BlurFilter(8, 8, 1) ];
            blurryPlayer.x = 250;
            addChild(blurryPlayer);            
        }
    }
}




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

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