Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

updated yt player

  • Loading branch information...
commit 301a66f14015ec014216caf91b4d05c283e40086 1 parent 34a7825
@ahmednuaman authored
View
29 com/firestartermedia/lib/as3/display/component/video/YouTubePlayerAS3.as
@@ -28,7 +28,7 @@ package com.firestartermedia.lib.as3.display.component.video
public var autoplay:Boolean = false;
public var chromeless:Boolean = false;
public var loop:Boolean = false;
- public var pars:String = '';
+ public var pars:String = 'modestbranding=1&fs=0&rel=0&showinfo=0&showsearch=0&hd=1&autohide=0&iv_load_policy=3&cc_load_policy=3';
public var playerHeight:Number = 300;
public var playerWidth:Number = 400;
public var quality:String = QUALITY_LARGE;
@@ -112,7 +112,9 @@ package com.firestartermedia.lib.as3.display.component.video
private function handlePlayerStateChange(e:Object):void
{
var state:Number = player.getPlayerState();
-
+
+ dispatchEvent( new YouTubePlayerEvent( YouTubePlayerEvent.STATE_CHANGED, state ) );
+
switch ( state )
{
case 0:
@@ -212,6 +214,14 @@ package com.firestartermedia.lib.as3.display.component.video
}
}
+ public function destroy():void
+ {
+ if ( isLoaded )
+ {
+ player.destroy();
+ }
+ }
+
public function pause():void
{
if ( isLoaded )
@@ -313,11 +323,21 @@ package com.firestartermedia.lib.as3.display.component.video
return ( isLoaded ? player : null );
}
+ public function get loaded():Boolean
+ {
+ return isLoaded;
+ }
+
public function get playing():Boolean
{
return isPlaying;
}
+ override public function get height():Number
+ {
+ return playerHeight;
+ }
+
override public function set height(value:Number):void
{
playerHeight = value;
@@ -328,6 +348,11 @@ package com.firestartermedia.lib.as3.display.component.video
}
}
+ override public function get width():Number
+ {
+ return playerWidth;
+ }
+
override public function set width(value:Number):void
{
playerWidth = value;
Please sign in to comment.
Something went wrong with that request. Please try again.