-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathStreamEngine.as
45 lines (36 loc) · 1.32 KB
/
StreamEngine.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
package {
import StreamView;
import flash.media.Camera;
import flash.external.ExternalInterface;
public class StreamEngine extends StreamView {
var local = 'cam_local';
var remote = 'cam_server';
/**
* Initialize video displays. Override for class variants.
*/
override public function initView() {
displays = {};
displays[local] = new StreamDisplay( local, { show_info: false } );
addChild( displays[local].vid );
}
/**
* Initialize connections. Override for class variants.
*/
override public function initConnections() {
ctrl = new StreamController( this );
ctrl.addConnection( local, ctrl.input.cam, displays[local].vid );
//ctrl.start( local );
ctrl.addConnection( remote, ctrl.input.cam, options.serverURL );
//ctrl.start( remote, options.streamName );
// Add JS callbacks
ExternalInterface.addCallback( 'startRecording', function() {
ctrl.start( local );
ctrl.start( remote ) ;
});
ExternalInterface.addCallback( 'stopRecording', function() {
ctrl.stop( local );
ctrl.stop( remote );
});
}
}
}