Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
WebApp/client/package-lock.json | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/WebApp/client/package-lock.json b/WebApp/client/package-lock.json
index 686fdc073..18f83f48e 100644
--- a/WebApp/client/package-lock.json
+++ b/WebApp/client/package-lock.json
@@ -4032,9 +4032,9 @@
"dev": true
},
"node_modules/json5": {
- "version": "2.2.1",
- "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz",
- "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==",
+ "version": "2.2.3",
+ "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz",
+ "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==",
"dev": true,
"bin": {
"json5": "lib/cli.js"
@@ -8638,9 +8638,9 @@
"dev": true
},
"json5": {
- "version": "2.2.1",
- "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz",
- "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==",
+ "version": "2.2.3",
+ "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz",
+ "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==",
"dev": true
},
"kleur": {
From 22a662dee7991303597d4a78196ff8835a969f08 Mon Sep 17 00:00:00 2001
From: Kazuki Matsumoto <1132081+karasusan@users.noreply.github.com>
Date: Tue, 10 Jan 2023 18:31:00 +0900
Subject: [PATCH 020/117] fix NullReferenceException in InputRemoting (#831)
---
WebApp/client/src/inputdevice.js | 8 ++++----
WebApp/client/src/sender.js | 8 ++++----
.../Runtime/Scripts/InputSystem/InputRemoting.cs | 5 +++--
3 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/WebApp/client/src/inputdevice.js b/WebApp/client/src/inputdevice.js
index 3a9dfd67e..a7f32f628 100644
--- a/WebApp/client/src/inputdevice.js
+++ b/WebApp/client/src/inputdevice.js
@@ -43,7 +43,7 @@ export class InputDevice {
* name;
* layout;
* deviceId;
- * variants;
+ * usages;
* description;
*
* _inputState;
@@ -54,14 +54,14 @@ export class InputDevice {
* @param {Number} name
* @param {String} layout
* @param {Number} deviceId
- * @param {String} variants
+ * @param {String[]} usages
* @param {Object} description
*/
- constructor(name, layout, deviceId, variants, description) {
+ constructor(name, layout, deviceId, usages, description) {
this.name = name;
this.layout = layout;
this.deviceId = deviceId;
- this.variants = variants;
+ this.usages = usages;
this.description = description;
this._inputState = null;
diff --git a/WebApp/client/src/sender.js b/WebApp/client/src/sender.js
index 88d909166..3ca3eb841 100644
--- a/WebApp/client/src/sender.js
+++ b/WebApp/client/src/sender.js
@@ -38,7 +38,7 @@ export class Sender extends LocalInputManager {
m_Version: "",
m_Capabilities: ""
};
- this.mouse = new Mouse("Mouse", "Mouse", 1, "", descriptionMouse);
+ this.mouse = new Mouse("Mouse", "Mouse", 1, null, descriptionMouse);
this._devices.push(this.mouse);
this._elem.addEventListener('click', this._onMouseEvent.bind(this), false);
@@ -58,7 +58,7 @@ export class Sender extends LocalInputManager {
m_Version: "",
m_Capabilities: ""
};
- this.keyboard = new Keyboard("Keyboard", "Keyboard", 2, "", descriptionKeyboard);
+ this.keyboard = new Keyboard("Keyboard", "Keyboard", 2, null, descriptionKeyboard);
this._devices.push(this.keyboard);
document.addEventListener('keyup', this._onKeyEvent.bind(this), false);
@@ -75,7 +75,7 @@ export class Sender extends LocalInputManager {
m_Version: "",
m_Capabilities: ""
};
- this.gamepad = new Gamepad("Gamepad", "Gamepad", 3, "", descriptionGamepad);
+ this.gamepad = new Gamepad("Gamepad", "Gamepad", 3, null, descriptionGamepad);
this._devices.push(this.gamepad);
window.addEventListener("gamepadconnected", this._onGamepadEvent.bind(this), false);
@@ -94,7 +94,7 @@ export class Sender extends LocalInputManager {
m_Version: "",
m_Capabilities: ""
};
- this.touchscreen = new Touchscreen("Touchscreen", "Touchscreen", 4, "", descriptionTouch);
+ this.touchscreen = new Touchscreen("Touchscreen", "Touchscreen", 4, null, descriptionTouch);
this._devices.push(this.touchscreen);
this._elem.addEventListener('touchend', this._onTouchEvent.bind(this), false);
diff --git a/com.unity.renderstreaming/Runtime/Scripts/InputSystem/InputRemoting.cs b/com.unity.renderstreaming/Runtime/Scripts/InputSystem/InputRemoting.cs
index 66b2e3feb..da06f6c4f 100644
--- a/com.unity.renderstreaming/Runtime/Scripts/InputSystem/InputRemoting.cs
+++ b/com.unity.renderstreaming/Runtime/Scripts/InputSystem/InputRemoting.cs
@@ -653,8 +653,9 @@ public static void Process(InputRemoting Receiver, Message msg)
var deviceFlagsRemote = 1 << 3;
device.SetDeviceFlags(device.GetDeviceFlags() | deviceFlagsRemote);
- foreach (var usage in data.usages)
- Receiver.m_LocalManager.AddDeviceUsage(device, usage);
+ if(data.usages != null)
+ foreach (var usage in data.usages)
+ Receiver.m_LocalManager.AddDeviceUsage(device, usage);
// Remember it.
var record = new RemoteInputDevice
From d0930e3880c264d0cff4840c2d19223457eca37a Mon Sep 17 00:00:00 2001
From: Kazuki Matsumoto <1132081+karasusan@users.noreply.github.com>
Date: Tue, 10 Jan 2023 18:31:15 +0900
Subject: [PATCH 021/117] fix: Fix TypeError in Bidirectional sample on Firefox
(#832)
* Fix TypeError in Bidirectional sample on Firefox 108
* fix
* fix
* fix
---
WebApp/client/public/bidirectional/js/main.js | 14 ++++++++------
WebApp/client/public/bidirectional/js/sendvideo.js | 10 +++++-----
WebApp/client/src/pointercorrect.js | 10 +++++-----
WebApp/client/src/renderstreaming.js | 6 +++---
WebApp/client/src/signaling.js | 4 ++--
WebApp/client/src/touchflags.js | 2 +-
WebApp/client/src/touchphase.js | 2 +-
7 files changed, 25 insertions(+), 23 deletions(-)
diff --git a/WebApp/client/public/bidirectional/js/main.js b/WebApp/client/public/bidirectional/js/main.js
index 15f01785d..9c50395d8 100644
--- a/WebApp/client/public/bidirectional/js/main.js
+++ b/WebApp/client/public/bidirectional/js/main.js
@@ -57,10 +57,6 @@ setupButton.addEventListener('click', setUp);
const hangUpButton = document.getElementById('hangUpButton');
hangUpButton.addEventListener('click', hangUp);
-window.addEventListener('beforeunload', async () => {
- await sendVideo.stop();
-}, true);
-
setupConfig();
async function setupConfig() {
@@ -84,7 +80,6 @@ async function startVideo() {
cameraWidthInput.disabled = true;
cameraHeightInput.disabled = true;
startButton.disabled = true;
- setupButton.disabled = false;
let width = 0;
let height = 0;
@@ -98,6 +93,9 @@ async function startVideo() {
}
await sendVideo.startLocalVideo(videoSelect.value, audioSelect.value, width, height);
+
+ // enable setup button after initializing local video.
+ setupButton.disabled = false;
}
async function setUp() {
@@ -127,6 +125,10 @@ async function setUp() {
}
};
+ window.addEventListener('beforeunload', async () => {
+ await renderstreaming.stop();
+ }, true);
+
await renderstreaming.start();
await renderstreaming.createConnection(connectionId);
}
@@ -280,4 +282,4 @@ function clearStatsMessage() {
remoteVideoStatsDiv.innerHTML = '';
messageDiv.style.display = 'none';
messageDiv.innerHTML = '';
-}
\ No newline at end of file
+}
diff --git a/WebApp/client/public/bidirectional/js/sendvideo.js b/WebApp/client/public/bidirectional/js/sendvideo.js
index b6cd6c285..8cea080b3 100644
--- a/WebApp/client/public/bidirectional/js/sendvideo.js
+++ b/WebApp/client/public/bidirectional/js/sendvideo.js
@@ -7,10 +7,10 @@ export class SendVideo {
}
/**
- * @param {MediaTrackConstraints} videoSource
- * @param {MediaTrackConstraints} audioSource
- * @param {number} videoWidth
- * @param {number} videoHeight
+ * @param {MediaTrackConstraints} videoSource
+ * @param {MediaTrackConstraints} audioSource
+ * @param {number} videoWidth
+ * @param {number} videoHeight
*/
async startLocalVideo(videoSource, audioSource, videoWidth, videoHeight) {
try {
@@ -42,7 +42,7 @@ export class SendVideo {
}
/**
- * @param {MediaStreamTrack} track
+ * @param {MediaStreamTrack} track
*/
addRemoteTrack(track) {
if (this.remoteVideo.srcObject == null) {
diff --git a/WebApp/client/src/pointercorrect.js b/WebApp/client/src/pointercorrect.js
index b0ba3649e..ee33a3022 100644
--- a/WebApp/client/src/pointercorrect.js
+++ b/WebApp/client/src/pointercorrect.js
@@ -5,7 +5,7 @@ export const LetterBoxType = {
export class PointerCorrector {
/**
- * @param {Number} videoWidth
+ * @param {Number} videoWidth
* @param {Number} videoHeight
* @param {DOMRect} rect
*/
@@ -63,7 +63,7 @@ export class PointerCorrector {
}
/**
- * @param {Number} videoWidth
+ * @param {Number} videoWidth
* @param {Number} videoHeight
* @param {DOMRect} rect
*/
@@ -99,8 +99,8 @@ export class PointerCorrector {
/**
* Returns rectangle for displaying video with the origin at the left-top of the element.
* Not considered applying CSS like `object-fit`.
- * @returns {Object}
- */
+ * @returns {Object}
+ */
get contentRect() {
const letterBoxType = this.letterBoxType;
const letterBoxSize = this.letterBoxSize;
@@ -116,4 +116,4 @@ export class PointerCorrector {
_reset() {
this._contentRect = this.contentRect;
}
-}
\ No newline at end of file
+}
diff --git a/WebApp/client/src/renderstreaming.js b/WebApp/client/src/renderstreaming.js
index ba933eeb6..628169446 100644
--- a/WebApp/client/src/renderstreaming.js
+++ b/WebApp/client/src/renderstreaming.js
@@ -88,7 +88,7 @@ export class RenderStreaming {
/**
* if not set argument, a generated uuid is used.
- * @param {string | null} connectionId
+ * @param {string | null} connectionId
*/
async createConnection(connectionId) {
this._connectionId = connectionId ? connectionId : uuid4();
@@ -150,7 +150,7 @@ export class RenderStreaming {
}
/**
- * @param {string} label
+ * @param {string} label
* @returns {RTCDataChannel | null}
*/
createDataChannel(label) {
@@ -158,7 +158,7 @@ export class RenderStreaming {
}
/**
- * @param {MediaStreamTrack} track
+ * @param {MediaStreamTrack} track
* @returns {RTCRtpSender | null}
*/
addTrack(track) {
diff --git a/WebApp/client/src/signaling.js b/WebApp/client/src/signaling.js
index 12d000d3a..657d1b5a2 100644
--- a/WebApp/client/src/signaling.js
+++ b/WebApp/client/src/signaling.js
@@ -76,7 +76,7 @@ export class Signaling extends EventTarget {
break;
default:
break;
- }
+ }
}
await this.sleep(this.interval);
}
@@ -344,4 +344,4 @@ export class WebSocketSignaling extends EventTarget {
Logger.log(sendJson);
this.websocket.send(sendJson);
}
-}
\ No newline at end of file
+}
diff --git a/WebApp/client/src/touchflags.js b/WebApp/client/src/touchflags.js
index 39d469b42..154ea6447 100644
--- a/WebApp/client/src/touchflags.js
+++ b/WebApp/client/src/touchflags.js
@@ -4,4 +4,4 @@ export const TouchFlags =
PrimaryTouch: 1 << 4,
Tap: 1 << 5,
OrphanedPrimaryTouch: 1 << 6,
-};
\ No newline at end of file
+};
diff --git a/WebApp/client/src/touchphase.js b/WebApp/client/src/touchphase.js
index 01a4b4df5..e461dcda0 100644
--- a/WebApp/client/src/touchphase.js
+++ b/WebApp/client/src/touchphase.js
@@ -5,4 +5,4 @@ export const TouchPhase = {
Ended: 3,
Canceled: 4,
Stationary: 5
- };
\ No newline at end of file
+ };
From 579f88d4e7c0a408f1ea5e26e8d15565ab260517 Mon Sep 17 00:00:00 2001
From: Kazuki Matsumoto <1132081+karasusan@users.noreply.github.com>
Date: Thu, 12 Jan 2023 09:30:48 +0900
Subject: [PATCH 022/117] fix: Add autocomplete attribute into input elements
to avoid issue of "disabled" attribute on Firefox (#834)
* wip
(cherry picked from commit f73792b9c689bac448c1a85ce4db2b21ccdf5187)
* set autocomplete attribute for firefox
* add null check
* fix
---
WebApp/client/public/bidirectional/index.html | 23 ++++++++++---------
WebApp/client/public/bidirectional/js/main.js | 12 ++++++----
WebApp/client/public/multiplay/index.html | 6 ++---
WebApp/client/public/multiplay/js/main.js | 4 +++-
WebApp/client/public/receiver/index.html | 8 +++----
WebApp/client/src/peer.js | 2 +-
WebApp/client/src/renderstreaming.js | 10 ++++++++
7 files changed, 40 insertions(+), 25 deletions(-)
diff --git a/WebApp/client/public/bidirectional/index.html b/WebApp/client/public/bidirectional/index.html
index e275d5b06..7881ab586 100644
--- a/WebApp/client/public/bidirectional/index.html
+++ b/WebApp/client/public/bidirectional/index.html
@@ -16,23 +16,24 @@ Bidirectional Sample
-
-
+
+
+
+
-
+
-
-
+
+
-
-
-
+
+
+
@@ -54,7 +55,7 @@
Remote
Codec preferences:
-
@@ -80,4 +81,4 @@ Remote