Skip to content

Commit 8e46bc0

Browse files
Merge pull request #4397 from IgorA100/patch-552676
Fix: Change stream channel for Player=Auto on Watch page
2 parents 9370d56 + d2a51e7 commit 8e46bc0

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

web/js/MonitorStream.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ function MonitorStream(monitorData) {
522522
}
523523
console.debug(`! ${dateTimeToISOLocal(new Date())} Stream for ID=${this.id} STOPPED`);
524524
//if ( 1 ) {
525-
if (-1 === this.player.indexOf('rtsp2web')) {
525+
if (-1 === this.activePlayer.indexOf('rtsp2web')) {
526526
if (stream.src) {
527527
let src = stream.src;
528528
if (-1 === src.indexOf('mode=')) {
@@ -541,15 +541,15 @@ function MonitorStream(monitorData) {
541541
this.statusCmdTimer = clearInterval(this.statusCmdTimer);
542542
this.streamCmdTimer = clearInterval(this.streamCmdTimer);
543543
this.started = false;
544-
if (-1 !== this.player.indexOf('go2rtc')) {
544+
if (-1 !== this.activePlayer.indexOf('go2rtc')) {
545545
if (!(stream.wsState === WebSocket.CLOSED && stream.pcState === WebSocket.CLOSED)) {
546546
try {
547547
stream.ondisconnect();
548548
} catch (e) {
549549
console.warn(e);
550550
}
551551
}
552-
} else if (-1 !== this.player.indexOf('rtsp2web')) {
552+
} else if (-1 !== this.activePlayer.indexOf('rtsp2web')) {
553553
if (this.webrtc) {
554554
if (this.webrtc.close) this.webrtc.close();
555555
stream.src = '';
@@ -563,7 +563,7 @@ function MonitorStream(monitorData) {
563563
if (this.RTSP2WebType == 'MSE') {
564564
this.stopMse();
565565
}
566-
} else if (-1 !== this.player.indexOf('janus')) {
566+
} else if (-1 !== this.activePlayer.indexOf('janus')) {
567567
stream.src = '';
568568
stream.srcObject = null;
569569
janus = null;

web/skins/classic/views/js/watch.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1310,8 +1310,7 @@ function panZoomEventPanzoomchange(event) {
13101310
}
13111311

13121312
function monitorChangeStreamChannel() {
1313-
//if (currentMonitor.RTSP2WebEnabled) {
1314-
if ((monitorStream.player) && (-1 !== monitorStream.player.indexOf('go2rtc') || -1 !== monitorStream.player.indexOf('rtsp2web'))) {
1313+
if ((monitorStream.activePlayer) && (-1 !== monitorStream.activePlayer.indexOf('go2rtc') || -1 !== monitorStream.activePlayer.indexOf('rtsp2web'))) {
13151314
streamCmdStop(true);
13161315
const streamChannel = $j('#streamChannel').val();
13171316
setCookie('zmStreamChannel', streamChannel);

0 commit comments

Comments
 (0)