@reactoo/watchtogether-sdk-js 2.5.43 → 2.5.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -48,6 +48,11 @@
|
|
|
48
48
|
<input type="text" id="instance-type" onchange="applySettingsFromForm()">
|
|
49
49
|
</div>
|
|
50
50
|
|
|
51
|
+
<div class="form-group">
|
|
52
|
+
<label for="swagger-url">Swagger URL</label>
|
|
53
|
+
<input type="text" id="swagger-url" onchange="applySettingsFromForm()">
|
|
54
|
+
</div>
|
|
55
|
+
|
|
51
56
|
<div class="form-group">
|
|
52
57
|
<label for="fetch-names">Fetch participants names</label>
|
|
53
58
|
<input type="checkbox" id="fetch-names" onchange="applySettingsFromForm()">
|
|
@@ -95,11 +100,12 @@
|
|
|
95
100
|
participantsOrderRandomization: false,
|
|
96
101
|
minParticipantsCount: 1,
|
|
97
102
|
maxParticipantsCount: 32,
|
|
98
|
-
instanceType: "reactooDemo",
|
|
99
103
|
roomId: "",
|
|
100
104
|
pinHash: "",
|
|
101
105
|
connectionDelay: 1,
|
|
102
106
|
parallelQueues: 1, // number of parallel queues for joining participants - only applied when connectionDelay is 0
|
|
107
|
+
instanceType: "reactooDemo",
|
|
108
|
+
swaggerUrl: "https://api.reactoo.com/v3/swagger.json",
|
|
103
109
|
fetchNames: false,
|
|
104
110
|
participantsNames: [],
|
|
105
111
|
};
|
|
@@ -119,6 +125,7 @@
|
|
|
119
125
|
connectionDelay: document.getElementById("connection-delay"),
|
|
120
126
|
parallelQueues: document.getElementById("parallel-queues"),
|
|
121
127
|
instanceType: document.getElementById("instance-type"),
|
|
128
|
+
swaggerUrl: document.getElementById("swagger-url"),
|
|
122
129
|
fetchNames: document.getElementById("fetch-names"),
|
|
123
130
|
participantsNames: document.getElementById("participants-names"),
|
|
124
131
|
},
|
|
@@ -144,17 +151,18 @@
|
|
|
144
151
|
|
|
145
152
|
function applySettingsFromForm() {
|
|
146
153
|
settings = {
|
|
147
|
-
participantsCount: parseInt(elements.form.participantsCount.value) ||
|
|
154
|
+
participantsCount: parseInt(elements.form.participantsCount.value) || defaultSettings.participantsCount,
|
|
148
155
|
participantsOrderRandomization: elements.form.participantsOrderRandomization.checked,
|
|
149
|
-
minParticipantsCount: parseInt(settings.minParticipantsCount) ||
|
|
150
|
-
maxParticipantsCount: parseInt(settings.maxParticipantsCount) ||
|
|
151
|
-
roomId: elements.form.roomId.value ||
|
|
152
|
-
pinHash: elements.form.pinHash.value ||
|
|
153
|
-
connectionDelay: parseFloat(elements.form.connectionDelay.value) ||
|
|
154
|
-
parallelQueues: parseInt(elements.form.parallelQueues.value) ||
|
|
155
|
-
instanceType: elements.form.instanceType.value ||
|
|
156
|
+
minParticipantsCount: parseInt(settings.minParticipantsCount) || defaultSettings.minParticipantsCount,
|
|
157
|
+
maxParticipantsCount: parseInt(settings.maxParticipantsCount) || defaultSettings.maxParticipantsCount,
|
|
158
|
+
roomId: elements.form.roomId.value || defaultSettings.roomId,
|
|
159
|
+
pinHash: elements.form.pinHash.value || defaultSettings.pinHash,
|
|
160
|
+
connectionDelay: parseFloat(elements.form.connectionDelay.value) || defaultSettings.connectionDelay,
|
|
161
|
+
parallelQueues: parseInt(elements.form.parallelQueues.value) || defaultSettings.parallelQueues,
|
|
162
|
+
instanceType: elements.form.instanceType.value || defaultSettings.instanceType,
|
|
163
|
+
swaggerUrl: elements.form.swaggerUrl.value || defaultSettings.swaggerUrl,
|
|
156
164
|
fetchNames: elements.form.fetchNames.checked,
|
|
157
|
-
participantsNames: elements.form.participantsNames.value.split("\n"),
|
|
165
|
+
participantsNames: elements.form.participantsNames.value.split("\n") || "",
|
|
158
166
|
};
|
|
159
167
|
|
|
160
168
|
setSettingsToUrl(false);
|
|
@@ -201,6 +209,7 @@
|
|
|
201
209
|
elements.form.connectionDelay.value = settings.connectionDelay;
|
|
202
210
|
elements.form.parallelQueues.value = settings.parallelQueues;
|
|
203
211
|
elements.form.instanceType.value = settings.instanceType;
|
|
212
|
+
elements.form.swaggerUrl.value = settings.swaggerUrl;
|
|
204
213
|
elements.form.fetchNames.checked = settings.fetchNames;
|
|
205
214
|
elements.form.participantsNames.value = settings.participantsNames.join("\n");
|
|
206
215
|
}
|
|
@@ -234,7 +243,7 @@
|
|
|
234
243
|
|
|
235
244
|
const gifUrl = `./persons_gifs/${gifId}.gif`;
|
|
236
245
|
const frameIndex = 0;
|
|
237
|
-
const sdkInstance = WatchTogetherSDK({debug:true, storagePrefix: `participant_${gifId}
|
|
246
|
+
const sdkInstance = WatchTogetherSDK({debug: true, storagePrefix: `participant_${gifId}`, apiUrl: settings.swaggerUrl})({instanceType: settings.instanceType});
|
|
238
247
|
|
|
239
248
|
const containerElement = document.createElement('div');
|
|
240
249
|
containerElement.classList.add('participant-container');
|
package/package.json
CHANGED
package/src/models/room.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import roomSession from './room-session';
|
|
4
4
|
import streamingSession from "./streaming-session";
|
|
5
|
+
import {decodeJanusDisplay} from "../modules/wt-utils";
|
|
5
6
|
|
|
6
7
|
let room = function () {
|
|
7
8
|
|
|
@@ -54,7 +55,7 @@ let room = function () {
|
|
|
54
55
|
}))
|
|
55
56
|
},
|
|
56
57
|
|
|
57
|
-
createRoom: ({title, description, isPublic, isStudioLayout, wtChannelId, isHd, disableSync, reduceRoomControls, hasStudioChat, maxParticipants, customAttributes, chatRoomId, linkedRoomId, type, dotAttribute} = {}) => {
|
|
58
|
+
createRoom: ({title, description, isPublic, isRouter, isStudioLayout, wtChannelId, isHd, disableSync, reduceRoomControls, hasStudioChat, maxParticipants, customAttributes, chatRoomId, linkedRoomId, type, dotAttribute} = {}) => {
|
|
58
59
|
let _da = dotAttribute
|
|
59
60
|
? (Array.isArray(dotAttribute)
|
|
60
61
|
? dotAttribute.reduce((p, cv) => (p[cv.name] = cv.value) && p || p, {})
|
|
@@ -65,6 +66,7 @@ let room = function () {
|
|
|
65
66
|
requestBody: {
|
|
66
67
|
title,
|
|
67
68
|
description,
|
|
69
|
+
isRouter,
|
|
68
70
|
isPublic,
|
|
69
71
|
isStudioLayout,
|
|
70
72
|
wtChannelId,
|
|
@@ -83,7 +85,7 @@ let room = function () {
|
|
|
83
85
|
}))
|
|
84
86
|
},
|
|
85
87
|
|
|
86
|
-
updateRoom: ({roomId, title, description, isPublic, recordings, slug, password, maxParticipants, setInstanceType = false, wtChannelId, isHd, isStudioLayout, hasStudioChat, reduceRoomControls, chatRoomId, linkedRoomId, type, disableSync, defaultRegion, customAttributes, dotAttribute} = {}) => {
|
|
88
|
+
updateRoom: ({roomId, title, description, isPublic, isRouter, recordings, slug, password, maxParticipants, setInstanceType = false, wtChannelId, isHd, isStudioLayout, hasStudioChat, reduceRoomControls, chatRoomId, linkedRoomId, type, disableSync, defaultRegion, customAttributes, dotAttribute} = {}) => {
|
|
87
89
|
let _da = dotAttribute
|
|
88
90
|
? (Array.isArray(dotAttribute)
|
|
89
91
|
? dotAttribute.reduce((p, cv) => (p[cv.name] = cv.value) && p || p, {})
|
|
@@ -97,6 +99,7 @@ let room = function () {
|
|
|
97
99
|
slug,
|
|
98
100
|
password,
|
|
99
101
|
isPublic,
|
|
102
|
+
isRouter,
|
|
100
103
|
isHd,
|
|
101
104
|
isStudioLayout,
|
|
102
105
|
hasStudioChat,
|
|
@@ -300,7 +303,7 @@ let room = function () {
|
|
|
300
303
|
return roomSessions.find(session => session.roomId === roomId) || null
|
|
301
304
|
},
|
|
302
305
|
getSessionByUserId: (userId) => {
|
|
303
|
-
return roomSessions.find(session => session.userId === userId) || null
|
|
306
|
+
return roomSessions.find(session => decodeJanusDisplay(session.userId)?.userId === userId) || null
|
|
304
307
|
},
|
|
305
308
|
getSessionByStreamId: (streamId) => {
|
|
306
309
|
return roomSessions.find(session => session.streamId === streamId) || null
|
package/src/modules/wt-room.js
CHANGED
|
@@ -98,9 +98,9 @@ class RoomSession {
|
|
|
98
98
|
participant: {
|
|
99
99
|
"watchparty": ['participant', 'talkback'],
|
|
100
100
|
"commentary": ['participant', 'talkback'],
|
|
101
|
-
"videowall": ['host', '
|
|
102
|
-
"videowall-queue": ['host', '
|
|
103
|
-
"videowall-queue-video": ['host', '
|
|
101
|
+
"videowall": ['host', 'talkback', 'observerSolo1', 'observerSolo2', 'observerSolo3'],
|
|
102
|
+
"videowall-queue": ['host', 'talkback', 'observerSolo1', 'observerSolo2', 'observerSolo3'],
|
|
103
|
+
"videowall-queue-video": ['host', 'talkback', 'observerSolo1', 'observerSolo2', 'observerSolo3']
|
|
104
104
|
},
|
|
105
105
|
monitor: {
|
|
106
106
|
"watchparty": ['participant'],
|
|
@@ -123,6 +123,27 @@ class RoomSession {
|
|
|
123
123
|
"videowall-queue": ['participant'],
|
|
124
124
|
"videowall-queue-video": ['participant'],
|
|
125
125
|
},
|
|
126
|
+
observerSolo1: {
|
|
127
|
+
"watchparty": ['participant'],
|
|
128
|
+
"commentary": ['participant'],
|
|
129
|
+
"videowall": ['participant'],
|
|
130
|
+
"videowall-queue": ['participant'],
|
|
131
|
+
"videowall-queue-video": ['participant'],
|
|
132
|
+
},
|
|
133
|
+
observerSolo2: {
|
|
134
|
+
"watchparty": ['participant'],
|
|
135
|
+
"commentary": ['participant'],
|
|
136
|
+
"videowall": ['participant'],
|
|
137
|
+
"videowall-queue": ['participant'],
|
|
138
|
+
"videowall-queue-video": ['participant'],
|
|
139
|
+
},
|
|
140
|
+
observerSolo3: {
|
|
141
|
+
"watchparty": ['participant'],
|
|
142
|
+
"commentary": ['participant'],
|
|
143
|
+
"videowall": ['participant'],
|
|
144
|
+
"videowall-queue": ['participant'],
|
|
145
|
+
"videowall-queue-video": ['participant'],
|
|
146
|
+
},
|
|
126
147
|
host: {
|
|
127
148
|
"watchparty": [],
|
|
128
149
|
"commentary": [],
|