My favorites | Sign in
Project Home Downloads Wiki Issues Source
Checkout   Browse   Changes    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
package de.derhess.video.youtube
{
/**
* released under MIT License (X11)
* http://www.opensource.org/licenses/mit-license.php
*
* Class for managing the YouTube Events for the YouTube Flex Player
*
* @author Florian Weil [derhess.de, Deutschland]
* @see http://blog.derhess.de
*/

import flash.events.Event;

public class YouTubeEvent extends Event
{
//--------------------------------------------------------------------------
//
// Class variables
//
//--------------------------------------------------------------------------
public static const STATUS:String = "youtubeStatus";
public static const PLAYER_LOADED:String = "youtubePlayerLoaded";
public static const ERROR:String = "youtubeError";
public static const VIDEO_QUALITY_CHANGE:String = "youtubeVideoQuality";
//--------------------------------------------------------------------------
//
// Initialization
//
//--------------------------------------------------------------------------

public function YouTubeEvent(type : String, bubbles : Boolean = false, cancelable : Boolean = false)
{
super(type, bubbles, cancelable);
init();
}
/**
* @private
* Initializes the instance.
*/
private function init():void
{
currentTime = 0;
duration = 0;
playerState = -1;
playbackQuality = "default";
errorCode = 0;
}

//--------------------------------------------------------------------------
//
// Variables
//
//--------------------------------------------------------------------------


//--------------------------------------------------------------------------
//
// Properties
//
//--------------------------------------------------------------------------
public var currentTime:Number;
public var duration:Number;
public var playerState:Number;
public var errorCode:Number;
public var playbackQuality:String;

//--------------------------------------------------------------------------
//
// Additional getters and setters
//
//--------------------------------------------------------------------------



//--------------------------------------------------------------------------
//
// API
//
//--------------------------------------------------------------------------

/**
* Completely destroys the instance and frees all objects for the garbage
* collector by setting their references to null.
*/
public function destroy():void
{

}

//--------------------------------------------------------------------------
//
// Overridden methods: _SuperClassName_
//
//--------------------------------------------------------------------------
override public function clone():Event
{
var event:YouTubeEvent = new YouTubeEvent(type);
event.playerState = this.playerState;
event.currentTime = this.currentTime;
event.duration = this.duration;
event.errorCode = this.errorCode;
event.playbackQuality = this.playbackQuality;
return event;
}

override public function toString():String
{
return "YouTubeEvent{playerState:" + playerState + ", playbackQuality:" + playbackQuality +", currentTime:" + currentTime.toString()+",duration:"+duration.toString()+", errorCode:"+errorCode.toString()+"}";
}



}
}

Change log

r11 by Florian....@derhess.de on Oct 27, 2009   Diff
added YouTube AS3 Chromeless API Wrapper
Version 1.0
Go to: 
Project members, sign in to write a code review

Older revisions

All revisions of this file

File info

Size: 3972 bytes, 115 lines
Powered by Google Project Hosting