File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -99,9 +99,7 @@ function (_EventEmitter) {
99
99
100
100
_this . obs . on ( "StreamStarted" , _this . streamStarted . bind ( _assertThisInitialized ( _assertThisInitialized ( _this ) ) ) ) ;
101
101
102
- _this . obs . on ( "Heartbeat" , function ( heartbeat ) {
103
- return _this . heartbeat = heartbeat ;
104
- } ) ;
102
+ _this . obs . on ( "Heartbeat" , _this . handleHeartbeat . bind ( _assertThisInitialized ( _assertThisInitialized ( _this ) ) ) ) ;
105
103
106
104
_this . obs . on ( "ScenesChanged" , _this . scenesChanged . bind ( _assertThisInitialized ( _assertThisInitialized ( _this ) ) ) ) ;
107
105
@@ -330,6 +328,12 @@ function (_EventEmitter) {
330
328
value : function scenesChanged ( ) {
331
329
this . getSceneList ( ) ;
332
330
}
331
+ } , {
332
+ key : "handleHeartbeat" ,
333
+ value : function handleHeartbeat ( heartbeat ) {
334
+ this . heartbeat = heartbeat ;
335
+ this . obsStreaming = heartbeat . streaming ;
336
+ }
333
337
} ] ) ;
334
338
335
339
return ObsSwitcher ;
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ class ObsSwitcher extends EventEmitter {
46
46
this . obs . on ( "StreamStatus" , this . setStreamStatus . bind ( this ) ) ;
47
47
this . obs . on ( "StreamStopped" , this . streamStopped . bind ( this ) ) ;
48
48
this . obs . on ( "StreamStarted" , this . streamStarted . bind ( this ) ) ;
49
- this . obs . on ( "Heartbeat" , heartbeat => ( this . heartbeat = heartbeat ) ) ;
49
+ this . obs . on ( "Heartbeat" , this . handleHeartbeat . bind ( this ) ) ;
50
50
this . obs . on ( "ScenesChanged" , this . scenesChanged . bind ( this ) ) ;
51
51
52
52
log . info ( "Connecting & authenticating" ) ;
@@ -193,6 +193,11 @@ class ObsSwitcher extends EventEmitter {
193
193
scenesChanged ( ) {
194
194
this . getSceneList ( ) ;
195
195
}
196
+
197
+ handleHeartbeat ( heartbeat ) {
198
+ this . heartbeat = heartbeat ;
199
+ this . obsStreaming = heartbeat . streaming ;
200
+ }
196
201
}
197
202
198
203
export default ObsSwitcher ;
You can’t perform that action at this time.
0 commit comments