Packagecom.gestureworks.cml.elements
Classpublic class Video
InheritanceVideo Inheritance TouchContainer Inheritance com.gestureworks.core.TouchSprite

The Video element loads a video and plays it, and provides access to play, pause, stop, and seek methods.

It support the following file types are: .mp4, .FLV, .MPEG-4, .m4v, .3GPP, .MOV, .F4V

     
       var video:VideoElement = new VideoElement();
        video.src = "myVideo.mp4";
        video.autoplay = true;
        video.init();
        addChild(video);        
        video.play();
     
     



Public Properties
 PropertyDefined By
  autoLoad : Boolean
Indicates whether the video file is loaded when the src property is set
Video
  autoplay : Boolean
Indicates whether the video file plays upon load
Video
 InheritedautoShuffle : Boolean
autoshuffles
TouchContainer
  centerPlayButton : Boolean = true
Flag central alignment of the play button
Video
 InheritedchildList : ChildList
Returns the object's childList.
TouchContainer
 InheritedclassName : String
sets the class name of displayobject
TouchContainer
 InheritedcloneExclusions : Vector.<String>
[read-only] Returns a list of properties to exclude when cloning this object
TouchContainer
 InheritedcmlIndex : int
Returns the index created by the CML parser.
TouchContainer
  deblocking : int
Indicates the type of filter applied to decoded video as part of post-processing.
Video
  debug : Boolean
Prints status message to console
Video
 InheriteddimensionsTo : Object
Sets the dimensions of TouchContainer to given object
TouchContainer
 InheriteddropShadow : Boolean
Sets the drop shadow effect
TouchContainer
  duration : Number
[read-only] Total video duration
Video
 Inheritedgroup : String
TouchContainer
  height : Number
[override] Sets the video height
Video
 InheritedheightPercent : Number
sets the height of the container
TouchContainer
 Inheritedid : String
Returns the object's id.
TouchContainer
  isLoaded : Boolean
[read-only] Returns video loaded status
Video
  isPaused : Boolean
[read-only] Returns video paused status
Video
  isPlaying : Boolean
[read-only] Returns video playing status
Video
 Inheritedlayout : *
specifies the type of layout
TouchContainer
 InheritedlayoutList : Dictionary
TouchContainer
  loop : Boolean
Video loop play
Video
 InheritedmouseChildren : Boolean
[override] sets the mousechildren value to true or false.
TouchContainer
  mute : Boolean
Turns the volume all the way down when true and returns it to volume prior to muting when false
Video
 InheritedpaddingBottom : Number
Sets the number of pixels between the container's bottom border and the bottom of its content area.
TouchContainer
 InheritedpaddingLeft : Number
Sets the number of pixels between the component's left border and the left edge of its content area.
TouchContainer
 InheritedpaddingRight : Number
Sets the number of pixels between the component's right border and the right edge of its content area.
TouchContainer
 InheritedpaddingTop : Number
Sets the number of pixels between the container's top border and the top of its content area.
TouchContainer
  percentLoaded : Number
[read-only] Percent of file loaded
Video
  playButtonState : String
Specifies the button state to execute the play operation
Video
  position : *
[override] Playhead position in ms
Video
  progressBar : *
Links a progress bar to the video process
Video
 InheritedrelativeX : Boolean
When set true this containers children's x position will be laid out relatively to each other.
TouchContainer
 InheritedrelativeY : Boolean
When set true this containers children's y position will be laid out relatively to each other.
TouchContainer
  resample : Boolean
Video
  smoothing : Boolean
Specifies whether the video should be smoothed (interpolated) when it is scaled.
Video
 Inheritedsound : String
TouchContainer
  src : String
Sets the video file path
Video
 Inheritedstate : Dictionary
TouchContainer
 InheritedstateId : *
Returns the current state id.
TouchContainer
 InheritedtoBitmap : Boolean
TouchContainer
  volume : Number
Sets the audio volume
Video
  width : Number
[override] Sets the video width
Video
 InheritedwidthPercent : Number
sets the width of the container
TouchContainer
Protected Properties
 PropertyDefined By
 InheritedcmlGestureList : Object
TouchContainer
Public Methods
 MethodDefined By
  
Constructor
Video
 Inherited
TouchContainer
 Inherited
method searches the child and adds to the list
TouchContainer
 Inherited
addChild(child:DisplayObject):DisplayObject
[override] Adds child to display list and, if not already added, the child list
TouchContainer
 Inherited
addChildAt(child:DisplayObject, index:int):DisplayObject
[override] Adds child to display list and, if not already added, the child list
TouchContainer
 Inherited
applyLayout(value:* = null):void
Apply the containers layout
TouchContainer
 Inherited
childToList(id:String, child:*):void
child appended to the childlist
TouchContainer
 Inherited
clone():*
Clone method
TouchContainer
  
close():void
Closes video
Video
  
dispose():void
[override] Destructor
Video
  
fitContent(aspectWidth:Number, aspectHeight:Number):void
Video
 Inherited
getElementById(id:String):*
Searches CML childList by id.
TouchContainer
 Inherited
getElementsByClassName(className:String):Array
Searches the CML childList by className.
TouchContainer
 Inherited
getElementsByTagName(tagName:Class):Array
Searches the CML childList by tagName as Class.
TouchContainer
  
init():void
[override]
Video
 Inherited
loadState(sId:* = null, recursion:Boolean = false):void
Loads state by index number.
TouchContainer
 Inherited
makeGestureList(value:XMLList):Object
Creates gestureList object from XML
TouchContainer
  
open(file:String = null):void
Sets the src property and loads the video
Video
 Inherited
parseCML(cml:XMLList):XMLList
Parse cml for local layouts.
TouchContainer
  
pause(e:StateEvent = null):void
Pauses video
Video
  
play(e:StateEvent = null):void
Plays the video from the beginning
Video
 Inherited
postparseCML(cml:XMLList):void
Abstract method allows the setting of a postparse CML routine.
TouchContainer
 Inherited
querySelector(selector:String):*
Searches the CML childList by selector.
TouchContainer
 Inherited
querySelectorAll(selector:*):Array
Search the CML childList by selector.
TouchContainer
 Inherited
removeChild(child:DisplayObject):DisplayObject
[override] Removes child from display list and, if not already removed, the child list
TouchContainer
 Inherited
removeChildAt(index:int):DisplayObject
[override] Removes child from display list and, if not already removed, the child list
TouchContainer
 Inherited
removeChildren(beginIndex:int = 0, endIndex:int = 2147483647):void
[override] Removes children from display list and, if not already removed, the child list
TouchContainer
  
resize():void
Video
  
resume(e:StateEvent = null):void
Resumes video playback from paused position
Video
 Inherited
saveState(sId:* = null, recursion:Boolean = false):void
Save state by index number.
TouchContainer
 Inherited
searchChildren(value:*, returnType:Class = null):*
This method does a depth first search of childLists.
TouchContainer
  
seek(offset:Number):void
Sets the video playhead position
Video
 Inherited
method sets the dimensions of each child
TouchContainer
  
stop():void
Pauses video and returns to the beginning
Video
 Inherited
tweenState(sId:* = null, tweenTime:Number = 1):void
Tween state by stateIndex from current to given state index.
TouchContainer
 Inherited
Updates child padding within this container
TouchContainer
 Inherited
Updates child percent dimensions within this container
TouchContainer
 Inherited
updateProperties(state:* = 0):void
Updates properties from state.
TouchContainer
 Inherited
Updates child relative positions within this container
TouchContainer
Property Detail
autoLoadproperty
autoLoad:Boolean

Indicates whether the video file is loaded when the src property is set


Implementation
    public function get autoLoad():Boolean
    public function set autoLoad(value:Boolean):void
autoplayproperty 
autoplay:Boolean

Indicates whether the video file plays upon load


Implementation
    public function get autoplay():Boolean
    public function set autoplay(value:Boolean):void
centerPlayButtonproperty 
public var centerPlayButton:Boolean = true

Flag central alignment of the play button

deblockingproperty 
deblocking:int

Indicates the type of filter applied to decoded video as part of post-processing.


Implementation
    public function get deblocking():int
    public function set deblocking(value:int):void
debugproperty 
debug:Boolean

Prints status message to console


Implementation
    public function get debug():Boolean
    public function set debug(value:Boolean):void
durationproperty 
duration:Number  [read-only]

Total video duration


Implementation
    public function get duration():Number
heightproperty 
height:Number[override]

Sets the video height


Implementation
    public function get height():Number
    public function set height(value:Number):void
isLoadedproperty 
isLoaded:Boolean  [read-only]

Returns video loaded status


Implementation
    public function get isLoaded():Boolean
isPausedproperty 
isPaused:Boolean  [read-only]

Returns video paused status


Implementation
    public function get isPaused():Boolean
isPlayingproperty 
isPlaying:Boolean  [read-only]

Returns video playing status


Implementation
    public function get isPlaying():Boolean
loopproperty 
loop:Boolean

Video loop play


Implementation
    public function get loop():Boolean
    public function set loop(value:Boolean):void
muteproperty 
mute:Boolean

Turns the volume all the way down when true and returns it to volume prior to muting when false

The default value is false.


Implementation
    public function get mute():Boolean
    public function set mute(value:Boolean):void
percentLoadedproperty 
percentLoaded:Number  [read-only]

Percent of file loaded


Implementation
    public function get percentLoaded():Number
playButtonStateproperty 
playButtonState:String

Specifies the button state to execute the play operation

The default value is down.


Implementation
    public function get playButtonState():String
    public function set playButtonState(value:String):void
positionproperty 
position:*[override]

Playhead position in ms


Implementation
    public function get position():*
    public function set position(value:any):void
progressBarproperty 
progressBar:*

Links a progress bar to the video process


Implementation
    public function get progressBar():*
    public function set progressBar(value:any):void
resampleproperty 
resample:Boolean


Implementation
    public function get resample():Boolean
    public function set resample(value:Boolean):void
smoothingproperty 
smoothing:Boolean

Specifies whether the video should be smoothed (interpolated) when it is scaled.


Implementation
    public function get smoothing():Boolean
    public function set smoothing(value:Boolean):void
srcproperty 
src:String

Sets the video file path


Implementation
    public function get src():String
    public function set src(value:String):void
volumeproperty 
volume:Number

Sets the audio volume

The default value is 1.


Implementation
    public function get volume():Number
    public function set volume(value:Number):void
widthproperty 
width:Number[override]

Sets the video width


Implementation
    public function get width():Number
    public function set width(value:Number):void
Constructor Detail
Video()Constructor
public function Video()

Constructor

Method Detail
close()method
public function close():void

Closes video

dispose()method 
override public function dispose():void

Destructor

fitContent()method 
public function fitContent(aspectWidth:Number, aspectHeight:Number):void

Parameters

aspectWidth:Number
 
aspectHeight:Number

init()method 
override public function init():void

open()method 
public function open(file:String = null):void

Sets the src property and loads the video

Parameters

file:String (default = null)

pause()method 
public function pause(e:StateEvent = null):void

Pauses video

Parameters

e:StateEvent (default = null)

play()method 
public function play(e:StateEvent = null):void

Plays the video from the beginning

Parameters

e:StateEvent (default = null)

resize()method 
public function resize():void

resume()method 
public function resume(e:StateEvent = null):void

Resumes video playback from paused position

Parameters

e:StateEvent (default = null)

seek()method 
public function seek(offset:Number):void

Sets the video playhead position

Parameters

offset:Number

stop()method 
public function stop():void

Pauses video and returns to the beginning