@reactoo/watchtogether-sdk-js 2.5.45 → 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) || 0,
154
+ participantsCount: parseInt(elements.form.participantsCount.value) || defaultSettings.participantsCount,
148
155
  participantsOrderRandomization: elements.form.participantsOrderRandomization.checked,
149
- minParticipantsCount: parseInt(settings.minParticipantsCount) || 1,
150
- maxParticipantsCount: parseInt(settings.maxParticipantsCount) || 32,
151
- roomId: elements.form.roomId.value || "",
152
- pinHash: elements.form.pinHash.value || "",
153
- connectionDelay: parseFloat(elements.form.connectionDelay.value) || 0,
154
- parallelQueues: parseInt(elements.form.parallelQueues.value) || 1,
155
- instanceType: elements.form.instanceType.value || "reactooDemo",
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}`})({instanceType: settings.instanceType});
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reactoo/watchtogether-sdk-js",
3
- "version": "2.5.45",
3
+ "version": "2.5.46",
4
4
  "description": "Javascript SDK for Reactoo",
5
5
  "main": "src/index.js",
6
6
  "unpkg": "dist/watchtogether-sdk.min.js",
@@ -98,9 +98,9 @@ class RoomSession {
98
98
  participant: {
99
99
  "watchparty": ['participant', 'talkback'],
100
100
  "commentary": ['participant', 'talkback'],
101
- "videowall": ['host', 'observer', 'talkback'],
102
- "videowall-queue": ['host', 'observer', 'talkback'],
103
- "videowall-queue-video": ['host', 'observer', 'talkback']
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": [],