@reactoo/watchtogether-sdk-js 2.6.76 → 2.6.78

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.
@@ -0,0 +1,393 @@
1
+ [
2
+ {
3
+ "order": 0,
4
+ "search": [
5
+ "london",
6
+ "holloway",
7
+ "arsenal",
8
+ "f.c.",
9
+ "football",
10
+ "club",
11
+ "the",
12
+ "gunners",
13
+ "emirates",
14
+ "stadium",
15
+ "fc"
16
+ ],
17
+ "id": "arsenal",
18
+ "group": null,
19
+ "name": "Arsenal"
20
+ },
21
+ {
22
+ "order": 1,
23
+ "search": [
24
+ "birmingham",
25
+ "aston",
26
+ "villa",
27
+ "f.c.",
28
+ "football",
29
+ "club",
30
+ "the",
31
+ "villans",
32
+ "lions",
33
+ "park",
34
+ "fc"
35
+ ],
36
+ "id": "aston_villa",
37
+ "group": null,
38
+ "name": "Aston Villa"
39
+ },
40
+ {
41
+ "order": 2,
42
+ "search": [
43
+ "bournemouth",
44
+ "afc",
45
+ "the",
46
+ "cherries",
47
+ "dean",
48
+ "court"
49
+ ],
50
+ "id": "afc_bournemouth",
51
+ "group": null,
52
+ "name": "AFC Bournemouth"
53
+ },
54
+ {
55
+ "order": 3,
56
+ "search": [
57
+ "london",
58
+ "brentford",
59
+ "f.c.",
60
+ "football",
61
+ "club",
62
+ "the",
63
+ "bees",
64
+ "gtech",
65
+ "community",
66
+ "england",
67
+ "stadium",
68
+ "fc"
69
+ ],
70
+ "id": "brentford",
71
+ "group": null,
72
+ "name": "Brentford"
73
+ },
74
+ {
75
+ "order": 4,
76
+ "search": [
77
+ "falmer",
78
+ "brighton",
79
+ "&",
80
+ "hove",
81
+ "albion",
82
+ "f.c.",
83
+ "football",
84
+ "club",
85
+ "the",
86
+ "seagulls",
87
+ "stadium",
88
+ "and",
89
+ "fc"
90
+ ],
91
+ "id": "brighton_and_hove_albion",
92
+ "group": null,
93
+ "name": "Brighton & Hove Albion"
94
+ },
95
+ {
96
+ "order": 5,
97
+ "search": [
98
+ "burnley",
99
+ "f.c.",
100
+ "football",
101
+ "club",
102
+ "the",
103
+ "clarets",
104
+ "turf",
105
+ "moor",
106
+ "fc"
107
+ ],
108
+ "id": "burnley",
109
+ "group": null,
110
+ "name": "Burnley"
111
+ },
112
+ {
113
+ "order": 6,
114
+ "search": [
115
+ "london",
116
+ "fulham",
117
+ "chelsea",
118
+ "f.c.",
119
+ "football",
120
+ "club",
121
+ "the",
122
+ "blues",
123
+ "stamford",
124
+ "bridge",
125
+ "fc"
126
+ ],
127
+ "id": "chelsea",
128
+ "group": null,
129
+ "name": "Chelsea"
130
+ },
131
+ {
132
+ "order": 7,
133
+ "search": [
134
+ "london",
135
+ "selhurst",
136
+ "crystal",
137
+ "palace",
138
+ "f.c.",
139
+ "football",
140
+ "club",
141
+ "the",
142
+ "eagles",
143
+ "glaziers",
144
+ "park",
145
+ "fc"
146
+ ],
147
+ "id": "crystal_palace",
148
+ "group": null,
149
+ "name": "Crystal Palace"
150
+ },
151
+ {
152
+ "order": 8,
153
+ "search": [
154
+ "liverpool",
155
+ "walton",
156
+ "everton",
157
+ "f.c.",
158
+ "football",
159
+ "club",
160
+ "the",
161
+ "blues",
162
+ "toffees",
163
+ "people",
164
+ "s",
165
+ "school",
166
+ "of",
167
+ "science",
168
+ "goodison",
169
+ "park",
170
+ "fc"
171
+ ],
172
+ "id": "everton",
173
+ "group": null,
174
+ "name": "Everton"
175
+ },
176
+ {
177
+ "order": 9,
178
+ "search": [
179
+ "london",
180
+ "fulham",
181
+ "f.c.",
182
+ "football",
183
+ "club",
184
+ "the",
185
+ "cottagers",
186
+ "craven",
187
+ "cottage",
188
+ "fc"
189
+ ],
190
+ "id": "fulham",
191
+ "group": null,
192
+ "name": "Fulham"
193
+ },
194
+ {
195
+ "order": 10,
196
+ "search": [
197
+ "liverpool",
198
+ "anfield",
199
+ "f.c.",
200
+ "football",
201
+ "club",
202
+ "the",
203
+ "reds",
204
+ "fc"
205
+ ],
206
+ "id": "liverpool",
207
+ "group": null,
208
+ "name": "Liverpool"
209
+ },
210
+ {
211
+ "order": 11,
212
+ "search": [
213
+ "luton",
214
+ "town",
215
+ "f.c.",
216
+ "football",
217
+ "club",
218
+ "the",
219
+ "hatters",
220
+ "kenilworth",
221
+ "road",
222
+ "fc"
223
+ ],
224
+ "id": "luton_town",
225
+ "group": null,
226
+ "name": "Luton Town"
227
+ },
228
+ {
229
+ "order": 12,
230
+ "search": [
231
+ "manchester",
232
+ "bradford",
233
+ "city",
234
+ "f.c.",
235
+ "football",
236
+ "club",
237
+ "the",
238
+ "citizens",
239
+ "cityzens",
240
+ "blues",
241
+ "sky",
242
+ "of",
243
+ "stadium",
244
+ "man",
245
+ "fc"
246
+ ],
247
+ "id": "manchester_city",
248
+ "group": null,
249
+ "name": "Manchester City"
250
+ },
251
+ {
252
+ "order": 13,
253
+ "search": [
254
+ "manchester",
255
+ "old",
256
+ "trafford",
257
+ "united",
258
+ "f.c.",
259
+ "football",
260
+ "club",
261
+ "the",
262
+ "red",
263
+ "devils",
264
+ "man",
265
+ "utd",
266
+ "fc"
267
+ ],
268
+ "id": "manchester_united",
269
+ "group": null,
270
+ "name": "Manchester United"
271
+ },
272
+ {
273
+ "order": 14,
274
+ "search": [
275
+ "newcastle",
276
+ "upon",
277
+ "tyne",
278
+ "united",
279
+ "f.c.",
280
+ "football",
281
+ "club",
282
+ "the",
283
+ "magpies",
284
+ "st",
285
+ "james",
286
+ "park",
287
+ "fc"
288
+ ],
289
+ "id": "newcastle_united",
290
+ "group": null,
291
+ "name": "Newcastle United"
292
+ },
293
+ {
294
+ "order": 15,
295
+ "search": [
296
+ "west",
297
+ "bridgford",
298
+ "nottingham",
299
+ "forest",
300
+ "f.c.",
301
+ "football",
302
+ "club",
303
+ "the",
304
+ "reds",
305
+ "tricky",
306
+ "trees",
307
+ "garibaldi",
308
+ "city",
309
+ "ground",
310
+ "fc"
311
+ ],
312
+ "id": "nottingham_forest",
313
+ "group": null,
314
+ "name": "Nottingham Forest"
315
+ },
316
+ {
317
+ "order": 16,
318
+ "search": [
319
+ "sheffield",
320
+ "united",
321
+ "f.c.",
322
+ "football",
323
+ "club",
324
+ "the",
325
+ "blades",
326
+ "bramall",
327
+ "lane",
328
+ "sufc",
329
+ "fc"
330
+ ],
331
+ "id": "sheffield_united",
332
+ "group": null,
333
+ "name": "Sheffield United"
334
+ },
335
+ {
336
+ "order": 17,
337
+ "search": [
338
+ "london",
339
+ "tottenham",
340
+ "hotspur",
341
+ "f.c.",
342
+ "football",
343
+ "club",
344
+ "the",
345
+ "lilywhites",
346
+ "stadium",
347
+ "spurs",
348
+ "fc"
349
+ ],
350
+ "id": "tottenham_hotspur",
351
+ "group": null,
352
+ "name": "Tottenham Hotspur"
353
+ },
354
+ {
355
+ "order": 18,
356
+ "search": [
357
+ "london",
358
+ "stratford",
359
+ "west",
360
+ "ham",
361
+ "united",
362
+ "f.c.",
363
+ "football",
364
+ "club",
365
+ "the",
366
+ "irons",
367
+ "hammers",
368
+ "stadium",
369
+ "fc"
370
+ ],
371
+ "id": "west_ham_united",
372
+ "group": null,
373
+ "name": "West Ham United"
374
+ },
375
+ {
376
+ "order": 19,
377
+ "search": [
378
+ "wolverhampton",
379
+ "wanderers",
380
+ "f.c.",
381
+ "football",
382
+ "club",
383
+ "wolves",
384
+ "the",
385
+ "molineux",
386
+ "stadium",
387
+ "fc"
388
+ ],
389
+ "id": "wolverhampton_wanderers",
390
+ "group": null,
391
+ "name": "Wolverhampton Wanderers"
392
+ }
393
+ ]
@@ -101,6 +101,20 @@
101
101
  <button type="button" onclick="disableEmojiSparking()">Disable Emoji Sparking</button>
102
102
  <button type="button" onclick="burstEmojiSparking()">Burst Emoji Sparking</button>
103
103
  </div>
104
+
105
+ <div class="heading --advanced">Affiliation</div>
106
+ <div class="form-group --advanced">
107
+ <button type="button" onclick="assignRandomCountry()">Assign Random Country</button>
108
+ <button type="button" onclick="assignRandomCountry('asia')">Assign Random Country (Asia)</button>
109
+ <button type="button" onclick="assignRandomCountry('europe')">Assign Random Country (Europe)</button>
110
+ <button type="button" onclick="assignRandomCountry('africa')">Assign Random Country (Africa)</button>
111
+ <button type="button" onclick="assignRandomCountry('north_america')">Assign Random Country (North America)</button>
112
+ <button type="button" onclick="assignRandomCountry('south_america')">Assign Random Country (South America)</button>
113
+ <button type="button" onclick="assignRandomCountry('oceania')">Assign Random Country (Oceania)</button>
114
+ </div>
115
+ <div class="form-group --advanced">
116
+ <button type="button" onclick="assignRandomPremierLeagueClub()">Assign Random Premier League Club</button>
117
+ </div>
104
118
  </div>
105
119
 
106
120
  <div class="participants-list-container">
@@ -772,6 +786,35 @@
772
786
  });
773
787
  }
774
788
 
789
+ function assignRandomCountry(continent = null) {
790
+ fetch('./affiliation/country/affiliation-data.json').then(response => response.json())
791
+ .then(countries => {
792
+ participants.filter(p => p).forEach(participant => {
793
+ const continentCountries = continent ? countries.filter(country => country.continent === continent) : countries;
794
+ const randomCountry = continentCountries[Math.floor(Math.random()*continentCountries.length)];
795
+
796
+ participant.sdkInstance.user.getUserSelf()
797
+ .then(response => {
798
+ participant.sdkInstance.user.updateUserSelf({customAttributes: {...response.data.customAttributes, country: randomCountry.id}});
799
+ });
800
+ });
801
+ });
802
+ }
803
+
804
+ function assignRandomPremierLeagueClub() {
805
+ fetch('./affiliation/premier-league-club/affiliation-data.json').then(response => response.json())
806
+ .then(premierLeagueClubs => {
807
+ participants.filter(p => p).forEach(participant => {
808
+ const randomPremierLeagueClubs = premierLeagueClubs[Math.floor(Math.random()*premierLeagueClubs.length)];
809
+
810
+ participant.sdkInstance.user.getUserSelf()
811
+ .then(response => {
812
+ participant.sdkInstance.user.updateUserSelf({customAttributes: {...response.data.customAttributes, premierLeagueClub: randomPremierLeagueClubs.id}});
813
+ });
814
+ });
815
+ });
816
+ }
817
+
775
818
  // ====================== Initialization ==============================
776
819
 
777
820
  document.addEventListener("DOMContentLoaded", function() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reactoo/watchtogether-sdk-js",
3
- "version": "2.6.76",
3
+ "version": "2.6.78",
4
4
  "description": "Javascript SDK for Reactoo",
5
5
  "main": "src/index.js",
6
6
  "unpkg": "dist/watchtogether-sdk.min.js",
@@ -204,14 +204,8 @@ class Iot {
204
204
  event === "video_uploaded" ||
205
205
  event === "change_user_devices" ||
206
206
  event === "queue" ||
207
- event === "title_changed"
208
- ) {
209
- this.emit('message', {event, ...payload, roomId})
210
- }
211
- else if(event === 'joined' || event === 'leaving') {
212
- this.emit('message', {event, ...payload, isObserver:!!payload.isObserver, roomId});
213
- }
214
- else if(
207
+ event === "title_changed" ||
208
+ event === "videowall_changed" ||
215
209
  event === 'left' || //user removed room a.k.a. left the room
216
210
  event === 'kicked' ||
217
211
  event === 'banned' ||
@@ -222,12 +216,15 @@ class Iot {
222
216
  event === 'messageRemoved' ||
223
217
  event === 'messageReported' ||
224
218
  event === 'chatClear' ||
225
- event === 'handRaised' || event === 'handLowered' || event === 'handsCleared'
219
+ event === 'handRaised' ||
220
+ event === 'handLowered' ||
221
+ event === 'handsCleared' ||
222
+ event === 'volume_set'
226
223
  ) {
227
- this.emit('message', {event, ...payload});
224
+ this.emit('message', {event, ...payload, roomId})
228
225
  }
229
- else if(event === 'volume_set') {
230
- this.emit('message', {event, ...payload});
226
+ else if(event === 'joined' || event === 'leaving') {
227
+ this.emit('message', {event, ...payload, isObserver:!!payload.isObserver, roomId});
231
228
  }
232
229
  }
233
230
  else if(topic[1] === 'instanceroom') { // instance
@@ -1634,7 +1634,7 @@ class RoomSession {
1634
1634
 
1635
1635
  if(p.webrtcStuff?.stats?.[mid]?.length > this._downStatsLength) {
1636
1636
  const downMedianStats = this._calculateMedianStats(p.webrtcStuff.stats[mid].slice(this._downStatsLength * -1));
1637
- if(downMedianStats?.framesPerSecond < Math.floor(settingsForCurrentSubstream.maxFramerate * 0.7) || downMedianStats?.freezeDurationSinceLast > (this._downStatsLength * this._statsInterval * 0.33) / 1000 || downMedianStats?.freezeCountSinceLast > 5 || downMedianStats?.jitter > maxJitter(settingsForCurrentSubstream.maxFramerate)) {
1637
+ if(downMedianStats?.framesPerSecond < Math.floor(settingsForCurrentSubstream.maxFramerate * 0.7) || downMedianStats?.freezeDurationSinceLast > (this._downStatsLength * this._statsInterval * 0.33) / 1000 || downMedianStats?.freezeCountSinceLast > 5 /* || downMedianStats?.jitter > maxJitter(settingsForCurrentSubstream.maxFramerate) */) {
1638
1638
  directionDecision = -1;
1639
1639
  }
1640
1640
  }