From ea79da0d5366f8e914a0450246a95773fc903c6b Mon Sep 17 00:00:00 2001 From: Alexey Khit Date: Sun, 4 Dec 2022 22:38:21 +0300 Subject: [PATCH] Rename modes to mode in JS player --- www/video-rtc.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/www/video-rtc.js b/www/video-rtc.js index 9baff098..ae1deda9 100644 --- a/www/video-rtc.js +++ b/www/video-rtc.js @@ -111,7 +111,7 @@ class VideoRTC extends HTMLElement { * Supported modes (webrtc, mse, mse2, mp4, mjpeg). * @type {string} */ - this.modes = "webrtc,mse,mp4"; + this.mode = "webrtc,mse,mp4"; /** * Run stream when not displayed on the screen. Default `false`. @@ -352,21 +352,21 @@ class VideoRTC extends HTMLElement { // CONNECTING => OPEN this.wsState = WebSocket.OPEN; - if (this.modes.indexOf("mse") >= 0 && "MediaSource" in window) { // iPhone - if (this.modes.indexOf("mse2") >= 0 && MediaSource.canConstructInDedicatedWorker) { + if (this.mode.indexOf("mse") >= 0 && "MediaSource" in window) { // iPhone + if (this.mode.indexOf("mse2") >= 0 && MediaSource.canConstructInDedicatedWorker) { this.internalMSE2(); } else { this.internalMSE(); } - } else if (this.modes.indexOf("mp4") >= 0) { + } else if (this.mode.indexOf("mp4") >= 0) { this.internalMP4(); } - if (this.modes.indexOf("webrtc") >= 0 && "RTCPeerConnection" in window) { // macOS Desktop app + if (this.mode.indexOf("webrtc") >= 0 && "RTCPeerConnection" in window) { // macOS Desktop app this.internalRTC(); } - if (this.modes.indexOf("mjpeg") >= 0) { + if (this.mode.indexOf("mjpeg") >= 0) { this.internalMJPEG(); } });