-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathStreamDisplay.as
50 lines (42 loc) · 1.35 KB
/
StreamDisplay.as
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
package {
import Utils;
import InfoField;
import InfoPanel;
import StreamController;
import flash.display.Shape;
import flash.display.Sprite;
import flash.media.Video;
public class StreamDisplay extends Sprite {
var options:Object = {};
var defaults:Object;
public var vid:Video;
public var infoPanel:InfoPanel;
public function StreamDisplay( name, opts=null ) {
defaults = {
width : 480,
height : 360,
show_info : false,
fields : [
"bufferLength",
"bufferTime",
"bytesLoaded",
"bytesTotal",
"currentFPS",
"liveDelay",
"objectEncoding",
"time"
]
};
opts = opts || {};
options = Utils.extend( defaults, opts );
vid = new Video( options.width, options.height );
addChild( vid );
if ( options.show_info && options.fields ) {
infoPanel = new InfoPanel( options.fields );
infoPanel.x = options.width + 10;
/*infoPanel.y = titleHeight;*/
addChild( infoPanel );
}
}
}
}