Packagecom.gestureworks.cml.element
Classpublic class YouTube
InheritanceYouTube Inheritance ElementFactory Inheritance flash.display.Sprite

The YouTube element retrieves and streams a Youtube video using the Youtube API. The source of the file will be the Youtube video's ID. The video must be set to allow embedding and accessible without a user sign in.

The Video ID is the 10-digit ID associated with the video link. For example, a direct URL to the video used in this example is: http://www.youtube.com/watch?v=h0MZX-D8xzA. Notice the "h0MZX-D8xzA" is the video's id. A video must be set to allow embedding from its owner to be used by the YouTube API. If you receive "Error 100" or "Error 101", or "150", the video either no longer exists, or its embedding has been disabled.

     
       var ytElement:YouTubeElement = new YouTubeElement();
        ytElement.src = "h0MZX-D8xzA";
        ytElement.autoplay = true;
        ytElement.chrome = true;
        addChild(ytElement);
        ytElement.init();
     
     



Public Properties
 PropertyDefined By
 Inheritedalpha : Number
[override] [write-only] sets the alpha for display objects
ElementFactory
  autoplay : Boolean
Sets whether or not the video plays immediately.
YouTube
 Inheritedblur : Boolean
Sets the drop shadow effect
ElementFactory
 Inheritedbottom : Number
sets the bottom value
ElementFactory
  chrome : Boolean
Sets whether or not to use the chromed (player with buttons) or not.
YouTube
 Inheritedclass_ : String
Object's css class;
ElementFactory
 InheritedclassName : String
sets the class name of displayobject
ElementFactory
 InheritedcmlIndex : int
sets the cml index
ElementFactory
 InheriteddebugStyle : *
sets the debug style
ElementFactory
 InheriteddisplayEvents : String
Use for dispatch completes.
ElementFactory
 InheriteddropShadow : Boolean
Sets the drop shadow effect
ElementFactory
  height : Number
[override] Sets the video height.
YouTube
 InheritedheightPercent : String
sets the height percent of display object
ElementFactory
 InheritedhorizontalCenter : Number
sets the horizontal center of display object
ElementFactory
 Inheritedid : String
sets the id of child
ElementFactory
 Inheritedindex : int
sets the index of display object
ElementFactory
  isPlaying : Boolean
[read-only]
YouTube
 Inheritedleft : Number
sets left value
ElementFactory
  loaded : Boolean
[read-only]
YouTube
 InheritedpropertyStates : Array
Deprecated: Please Use state
ElementFactory
 Inheritedright : Number
sets the right value
ElementFactory
 Inheritedscale : Number
Sets both the x and y scale values
ElementFactory
 InheritedscaleX : Number
[override] Sets width of the display object in pixels
ElementFactory
 InheritedscaleY : Number
[override] Sets width of the display object in pixels
ElementFactory
  src : String
Sets the video ID to be loaded.
YouTube
 Inheritedstate : Array
property states array
ElementFactory
 Inheritedtop : Number
sets top value
ElementFactory
 InheritedverticalCenter : Number
sets the vertical center of display object
ElementFactory
  width : Number
[override] Sets the video width.
YouTube
 InheritedwidthPercent : String
sets the percent of width of display object
ElementFactory
Public Methods
 MethodDefined By
  
Constructor
YouTube
 Inherited
clone():*
Returns clone of self
ElementFactory
  
close():void
closes the video
YouTube
  
[override] CML callback Initialisation
YouTube
  
dispose():void
[override] Dispose
YouTube
  
init():void
[override] Initialisation method
YouTube
 Inherited
parseCML(cml:XMLList):XMLList
parses cml file
ElementFactory
  
pause():void
pauses the video
YouTube
  
play():void
Start playing from the beginning.
YouTube
 Inherited
postparseCML(cml:XMLList):void
post parses the cml file
ElementFactory
  
resume():void
Resume from last spot.
YouTube
  
seek(value:Number, seekAhead:Boolean):void
seek
YouTube
  
stop():void
stops the video
YouTube
 Inherited
updateProperties(state:Number = 0):void
this method updates the properties
ElementFactory
Property Detail
autoplayproperty
autoplay:Boolean

Sets whether or not the video plays immediately. Note: the player does not start loading the FLV it requests until a call to play the video, or seek to the video is called.

The default value is false;.


Implementation
    public function get autoplay():Boolean
    public function set autoplay(value:Boolean):void
chromeproperty 
chrome:Boolean

Sets whether or not to use the chromed (player with buttons) or not.

The default value is false.


Implementation
    public function get chrome():Boolean
    public function set chrome(value:Boolean):void
heightproperty 
height:Number[override]

Sets the video height.

The default value is 360.


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


Implementation
    public function get isPlaying():Boolean
loadedproperty 
loaded:Boolean  [read-only]


Implementation
    public function get loaded():Boolean
srcproperty 
src:String

Sets the video ID to be loaded. Must be present or the element will crash.


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

Sets the video width.

The default value is 480.


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

Constructor

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

closes the video

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

CML callback Initialisation

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

Dispose

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

Initialisation method

pause()method 
public function pause():void

pauses the video

play()method 
public function play():void

Start playing from the beginning.

resume()method 
public function resume():void

Resume from last spot.

seek()method 
public function seek(value:Number, seekAhead:Boolean):void

seek

Parameters

value:Number
 
seekAhead:Boolean

stop()method 
public function stop():void

stops the video