@reactoo/watchtogether-sdk-js 2.7.9 → 2.7.10

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.
@@ -225,95 +225,95 @@
225
225
  })
226
226
  })
227
227
  .then(r => Instance.room.createSession({constructId, roomId:r.roomId, pinHash: r.pinHash, role:'participant', options: {
228
- simulcast: true,
229
- simulcastSettings: {
230
- "default" : {
231
- mode: "controlled", // controlled, manual, browserController
232
- defaultSubstream: 0, // 2 lowest quality, 0 highest quality
233
- bitrates: [
234
- {
235
- "rid": "l",
236
- "active": true,
237
- "maxBitrate": 180000,
238
- "maxFramerate": 20,
239
- "scaleResolutionDownBy": 3.3333333333333335,
240
- "priority": "low"
241
- },
242
- {
243
- "rid": "m",
244
- "active": true,
245
- "maxBitrate": 500000,
246
- "maxFramerate": 25,
247
- "scaleResolutionDownBy": 1.3333333333333335,
248
- "priority": "low"
249
- },
250
- {
251
- "rid": "h",
252
- "active": true,
253
- "maxBitrate": 2000000,
254
- "maxFramerate": 30,
255
- "priority": "low"
256
- }
257
- ]
258
- },
259
- "*camera*" : {
260
- mode: "controlled",
261
- defaultSubstream: 0,
262
- bitrates: [
263
- {
264
- "rid": "l",
265
- "active": true,
266
- "maxBitrate": 180000,
267
- "maxFramerate": 20,
268
- "scaleResolutionDownBy": 3.3333333333333335,
269
- "priority": "low"
270
- },
271
- {
272
- "rid": "m",
273
- "active": true,
274
- "maxBitrate": 500000,
275
- "maxFramerate": 25,
276
- "scaleResolutionDownBy": 1.3333333333333335,
277
- "priority": "low"
278
- },
279
- {
280
- "rid": "h",
281
- "active": true,
282
- "maxBitrate": 2000000,
283
- "maxFramerate": 30,
284
- "priority": "low"
285
- }
286
- ]
287
- },
288
- "*screen*": {
289
- mode: "manual",
290
- defaultSubstream: 0,
291
- bitrates: [
292
- {
293
- "rid": "l",
294
- "active": true,
295
- "maxBitrate": 270000,
296
- "maxFramerate": 5,
297
- "scaleResolutionDownBy": 1.3333333333333335,
298
- "priority": "low"
299
- },
300
- {
301
- "rid": "m",
302
- "active": true,
303
- "maxBitrate": 500000,
304
- "maxFramerate": 10,
305
- "priority": "low"
306
- },
307
- {
308
- "rid": "h",
309
- "active": true,
310
- "maxBitrate": 2000000,
311
- "maxFramerate": 30,
312
- "priority": "low"
313
- }
314
- ]
315
- }
316
- },
228
+ // simulcast: true,
229
+ // simulcastSettings: {
230
+ // "default" : {
231
+ // mode: "controlled", // controlled, manual, browserControlled
232
+ // defaultSubstream: 0, // 2 lowest quality, 0 highest quality
233
+ // bitrates: [
234
+ // {
235
+ // "rid": "l",
236
+ // "active": true,
237
+ // "maxBitrate": 180000,
238
+ // "maxFramerate": 20,
239
+ // "scaleResolutionDownBy": 3.3333333333333335,
240
+ // "priority": "low"
241
+ // },
242
+ // {
243
+ // "rid": "m",
244
+ // "active": true,
245
+ // "maxBitrate": 500000,
246
+ // "maxFramerate": 25,
247
+ // "scaleResolutionDownBy": 1.3333333333333335,
248
+ // "priority": "low"
249
+ // },
250
+ // {
251
+ // "rid": "h",
252
+ // "active": true,
253
+ // "maxBitrate": 2000000,
254
+ // "maxFramerate": 30,
255
+ // "priority": "low"
256
+ // }
257
+ // ]
258
+ // },
259
+ // "*camera*" : {
260
+ // mode: "controlled",
261
+ // defaultSubstream: 0,
262
+ // bitrates: [
263
+ // {
264
+ // "rid": "l",
265
+ // "active": true,
266
+ // "maxBitrate": 180000,
267
+ // "maxFramerate": 20,
268
+ // "scaleResolutionDownBy": 3.3333333333333335,
269
+ // "priority": "low"
270
+ // },
271
+ // {
272
+ // "rid": "m",
273
+ // "active": true,
274
+ // "maxBitrate": 500000,
275
+ // "maxFramerate": 25,
276
+ // "scaleResolutionDownBy": 1.3333333333333335,
277
+ // "priority": "low"
278
+ // },
279
+ // {
280
+ // "rid": "h",
281
+ // "active": true,
282
+ // "maxBitrate": 2000000,
283
+ // "maxFramerate": 30,
284
+ // "priority": "low"
285
+ // }
286
+ // ]
287
+ // },
288
+ // "*screen*": {
289
+ // mode: "manual",
290
+ // defaultSubstream: 0,
291
+ // bitrates: [
292
+ // {
293
+ // "rid": "l",
294
+ // "active": true,
295
+ // "maxBitrate": 270000,
296
+ // "maxFramerate": 5,
297
+ // "scaleResolutionDownBy": 1.3333333333333335,
298
+ // "priority": "low"
299
+ // },
300
+ // {
301
+ // "rid": "m",
302
+ // "active": true,
303
+ // "maxBitrate": 500000,
304
+ // "maxFramerate": 10,
305
+ // "priority": "low"
306
+ // },
307
+ // {
308
+ // "rid": "h",
309
+ // "active": true,
310
+ // "maxBitrate": 2000000,
311
+ // "maxFramerate": 30,
312
+ // "priority": "low"
313
+ // }
314
+ // ]
315
+ // }
316
+ // },
317
317
  //subscriptionRules: {participant: {videoWall: [], watchTogether: []}}
318
318
  }}))
319
319
  .then(session => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reactoo/watchtogether-sdk-js",
3
- "version": "2.7.9",
3
+ "version": "2.7.10",
4
4
  "description": "Javascript SDK for Reactoo",
5
5
  "main": "src/index.js",
6
6
  "unpkg": "dist/watchtogether-sdk.min.js",
@@ -43,7 +43,7 @@ let user = function () {
43
43
  .then(([client, response]) => Promise.all([client, response.data.signedUrlSegments.reduce((acc, url, index) => acc.then(() => client.http({url, method: response.data.httpMethod, headers: {"Content-Type":files[index].type}, body:files[index]})), Promise.resolve())]))
44
44
  .then(([client]) => client.apis.video.publishVideo({_id:id, roomId}, {requestBody:{_id:id, roomId, privateAttributes}}))
45
45
  },
46
-
46
+
47
47
  getReactionById: (id) => {
48
48
  return this.__privates.auth.__client
49
49
  .then(client => client.apis.reaction.getReactionById({id}))
@@ -67,18 +67,31 @@ let user = function () {
67
67
  .then(client => client.apis.video.getVideoById({id}))
68
68
  },
69
69
 
70
- getVideos: ({roomId, userId, type, size, startKey, includeUserModels = false, includeRoomQueueStatus} = {}) => {
71
- let apiParams = {
72
- ...(roomId && {roomId}),
73
- ...(userId && {userId}),
74
- ...(size && {size}),
75
- ...(startKey && {startKey}),
76
- ...(includeRoomQueueStatus && {includeRoomQueueStatus}),
77
- includeUserModels,
78
- type
79
- };
80
- return this.__privates.auth.__client
81
- .then(client => client.apis.video.getVideos(apiParams))
70
+ getVideos: ({roomId, userId, type, size, startKey, ids, includeUserModels = false, includeRoomQueueStatus} = {}) => {
71
+ return chunkArray(ids, 50)
72
+ .reduce((promiseChain, idsChunk) => {
73
+ return promiseChain.then(chainResponse => {
74
+ let apiParams = {
75
+ ...(roomId && {roomId}),
76
+ ...(userId && {userId}),
77
+ ...(size && {size}),
78
+ ...(idsChunk?.length && {ids: idsChunk.join(',')}),
79
+ ...(startKey && {startKey}),
80
+ ...(includeRoomQueueStatus && {includeRoomQueueStatus}),
81
+ includeUserModels,
82
+ type
83
+ };
84
+ return this.__privates.auth.__client
85
+ .then(client => client.apis.video.getVideos(apiParams))
86
+ .then(response => type === 'ids' ? {
87
+ data: {
88
+ items: [...chainResponse.data.items, ...response.data.items],
89
+ size: chainResponse.data.size + response.data.size,
90
+ startKey: null,
91
+ },
92
+ } : response);
93
+ });
94
+ }, Promise.resolve({data: {items: [], size: 0, startKey: null}}));
82
95
  },
83
96
 
84
97
  deleteVideo: (id) => {
@@ -185,7 +185,7 @@ class RoomSession {
185
185
  this.simulcast = false;
186
186
  this.defaultSimulcastSettings = {
187
187
  "default" : {
188
- mode: "controlled", // controlled, manual, browserController
188
+ mode: "controlled", // controlled, manual, browserControlled
189
189
  defaultSubstream: 0, // 2 lowest quality, 0 highest quality
190
190
  bitrates: [
191
191
  {