適用於 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 標籤
移動 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

VideoPlayer 類別允許使用較您使用 FLVPlayback 組件時稍小的 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
Boolean 值,如果為 true,則會在播放停止時讓 FLV 檔倒帶到「影格 1」,這可能是因為播放程式到達串流的結尾或者呼叫了 stop() 方法所造成的。
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,當 cacheAsBitmap 設定為 true 時,這個 Matrix 物件會定義顯示物件的顯示方法。
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
[唯讀] Boolean 值,當視訊串流處於即時狀態則為 true。
VideoPlayer
  isRTMP : Boolean
[唯讀] 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 標籤與 SWF 檔案中的這個 DisplayObject 實體一同儲存,則會取得 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 之 client 屬性的自訂類別。
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
[唯讀] Boolean 值,若是有反應的狀態則為 true。
VideoPlayer
  totalTime : Number
[唯讀] 數字,表示視訊的總播放時間,以秒為單位。
VideoPlayer
 Inheritedtransform : flash.geom:Transform
這是一個物件,具有和顯示物件的矩陣、顏色轉換和像素邊界有關的屬性。
DisplayObject
  videoHeight : int
[覆寫] [唯讀] 已載入之 FLV 檔的原始檔寬度。
VideoPlayer
  videoWidth : int
[覆寫] [唯讀] 已載入之 FLV 檔的原始檔寬度。
VideoPlayer
  visible : Boolean
[覆寫] 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
  當 NetConnection 關閉 (無論是因為逾時或透過呼叫 close() 方法),或者您呼叫 load() 或 play() 方法或設定 source 屬性因而造成 RTMP 連線關閉時,VideoPlayer 實體都會傳送此事件。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

Boolean 值,如果為 true,則會在播放停止時讓 FLV 檔倒帶到「影格 1」,這可能是因為播放程式到達串流的結尾或者呼叫了 stop() 方法所造成的。 這個屬性對於即時串流而言是沒有意義的。

預設值為 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

Boolean 值,當視訊串流處於即時狀態則為 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

Boolean 值,使用 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 值。

參數說明
canSeekToEndBoolean 值,當 FLV 檔是以最後一個影格上的關鍵影格編碼,以允許搜尋漸進式下載影片片段的結尾時,則為 true。 如果 FLV 檔不是以最後一個影格上的關鍵影格編碼,則為 false
cuePoints物件的陣列,內嵌於 FLV 檔的其中一個提示點。 如果 FLV 檔沒有任何提示點,值即為 undefined。 每個物件都有下列屬性:
  • type -- 字串,用以將提示點類型指定為 "navigation" 或 "event"。
  • name -- 代表提示點名稱的字串。
  • time -- 數字,具有三位小數位數 (毫秒) 的提示點時間,以秒為單位。
  • parameters -- 具有使用者在建立提示點時所指定之名稱值配對的選擇性物件。
audiocodecid指定所使用之音效轉碼器 (編碼/解碼技術) 的數字。
audiodelay 數字,代表 FLV 檔編碼來源檔案中的時間 0

視訊內容因為需要同步化音訊而短暫延遲一段時間。 例如,如果 audiodelay 值為 .038,則在來源檔案中開始時間為 0 的視訊,在 FLV 檔中的開始時間便為 .038

請注意,FLVPlayback 和 VideoPlayer 類別會在其時間設定中補正這個延遲時間。 這表示您可以繼續使用在來源檔案中使用的時間設定。

audiodatarate每秒音訊 KB 數目。
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 之 client 屬性的自訂類別。根據預設,會使用 fl.video.VideoPlayerClient,此類別會處理 onMetaData()onCuePoint() 訊息。若要針對其他訊息 (例如 onImageData()onTextData()) 加入自訂處理作業,您可以建立自己的類別並將此屬性設定至該類別。

該類別的建構函式必須使用 VideoPlayer 實體做為它的唯一參數,而且它必須具有 Boolean ready 屬性。當用戶端仍在等待任何必須位於檔案開頭的資料訊息期間,此屬性都必須為 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 檔沒有關鍵影格也是如此)。 其次,搜尋作業是非同步的,所以如果您呼叫搜尋方法或設定 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 毫秒,或是除以 12 的 1 秒鐘 (1000 毫秒)。

預設值為 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

Boolean 值,若是有反應的狀態則為 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

Boolean 值,如果為 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 (傳送至 VideoPlayer.load 的 null URL)。
 
totalTime:Number (default = NaN) — FLV 檔的長度。 傳入 0、null 或 undefined,以自動偵測中繼資料、伺服器或 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 視為整個媒體的媒體片段。當視訊播放持續時間秒數後,播放會停止而且會傳送完成事件。嘗試搜尋超過此持續時間時會失敗。擷取 totalTime 屬性時,它會傳回指定的持續時間。這不同於此方法的 totalTime 參數,因為該參數會用於指定媒體的實際持續時間,這在媒體沒有此資訊的中繼資料時十分有用;若 totalTime 小於實際媒體持續時間,這並不會停止播放。但是有了這個 duration 參數之後,將會停止播放。若 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 或 undefined。

相關 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 或 undefined,該值都會優先於這個值。
 
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 視為整個媒體的媒體片段。當視訊播放持續時間秒數後,播放會停止而且會傳送完成事件。嘗試搜尋超過此持續時間時會失敗。擷取 totalTime 屬性時,它會傳回指定的持續時間。這不同於此方法的 totalTime 參數,因為該參數會用於指定媒體的實際持續時間,這在媒體沒有此資訊的中繼資料時十分有用;若 totalTime 小於實際媒體持續時間,這並不會停止播放。但是有了這個 duration 參數之後,將會停止播放。若 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 檔沒有關鍵影格也是如此。

搜尋作業是非同步的,所以如果您呼叫搜尋方法或設定 playheadTime 屬性,playheadTime 並不會立即更新。 若要取得搜尋完成後的時間,請偵聽 seek 事件,此事件會在 playheadTime 屬性更新之後發生。

如果在沒有連接任何串流時呼叫,就會擲回例外。 您可以使用 stateChange 事件和 connected 屬性,判斷可安全呼叫此方法的時機。

參數

time:Number — 數字,指定放置播放磁頭的時間點,以秒為單位。


擲回值
VideoError — 如果 time 為 < 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

當 NetConnection 關閉 (無論是因為逾時或透過呼叫 close() 方法),或者您呼叫 load()play() 方法或設定 source 屬性因而造成 RTMP 連線關閉時,VideoPlayer 實體都會傳送此事件。 只有從 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 呼叫完成時,會傳送內含 rewinding 狀態的 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 檔中輸入下列追蹤程式碼:

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 檔中輸入下列追蹤程式碼:

FLVPlayback.VERSION

VERSION 變數包含主要和次要版本號碼,以及修訂和組建編號,例如 2.0.0.11。SHORT_VERSION 變數只包含主要和次要版本號碼,例如 2.0。

相關 API 元素

VideoPlayerExample.as

這個範例會以動態方式建立兩個 VideoPlayer 實體,並將模糊濾鏡套用到其中一個實體。

若要執行範例,請遵循下列步驟:

  1. 將 FLVPlayback 組件加入元件庫。
  2. 以 FLV 檔的絕對或相對路徑取代 testVideoPath
  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 類別就會以英文顯示。