File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -506,14 +506,15 @@ function MonitorStream(monitorData) {
506
506
}
507
507
if ( - 1 == src . search ( 'connkey' ) ) {
508
508
src += '&connkey=' + this . connKey ;
509
+
509
510
}
511
+ stream . onerror = this . img_onerror . bind ( this ) ;
512
+ stream . onload = this . img_onload . bind ( this ) ;
513
+
510
514
if ( stream . src != src ) {
511
- console . log ( "Setting to streaming: " + src ) ;
512
515
stream . src = '' ;
513
516
stream . src = src ;
514
517
}
515
- stream . onerror = this . img_onerror . bind ( this ) ;
516
- stream . onload = this . img_onload . bind ( this ) ;
517
518
this . started = true ;
518
519
this . streamListenerBind ( ) ;
519
520
this . activePlayer = 'zms' ;
@@ -547,7 +548,9 @@ function MonitorStream(monitorData) {
547
548
stream . src = src ;
548
549
}
549
550
}
550
- this . streamCommand ( CMD_STOP ) ;
551
+ if ( stream . src ) {
552
+ this . streamCommand ( CMD_STOP ) ;
553
+ }
551
554
} else if ( - 1 !== this . activePlayer . indexOf ( 'go2rtc' ) ) {
552
555
if ( ! ( stream . wsState === WebSocket . CLOSED && stream . pcState === WebSocket . CLOSED ) ) {
553
556
try {
@@ -656,7 +659,7 @@ function MonitorStream(monitorData) {
656
659
stream . onload = null ;
657
660
658
661
// this.stop tells zms to stop streaming, but the process remains. We need to turn the stream into an image.
659
- if ( stream . src && ( - 1 !== this . player . indexOf ( 'zms' ) ) ) {
662
+ if ( stream . src && ( - 1 !== this . activePlayer . indexOf ( 'zms' ) ) ) {
660
663
stream . src = '' ;
661
664
// Make zms exit
662
665
this . streamCommand ( CMD_QUIT ) ;
You can’t perform that action at this time.
0 commit comments