@reactoo/watchtogether-sdk-js 2.5.50 → 2.5.56

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.
@@ -119,7 +119,7 @@
119
119
  console.log('Iot message:', r);
120
120
  });
121
121
 
122
- Instance.auth.deviceLogin() // login as browser
122
+ Instance.auth.deviceLogin(true) // login as browser
123
123
  .then(r => Instance.iot.iotLogin()) // login to mqtt
124
124
  .then(r => {
125
125
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reactoo/watchtogether-sdk-js",
3
- "version": "2.5.50",
3
+ "version": "2.5.56",
4
4
  "description": "Javascript SDK for Reactoo",
5
5
  "main": "src/index.js",
6
6
  "unpkg": "dist/watchtogether-sdk.min.js",
@@ -43,6 +43,7 @@
43
43
  },
44
44
  "dependencies": {
45
45
  "@fingerprintjs/fingerprintjs": "^3.3.2",
46
+ "@fingerprintjs/fingerprintjs-pro": "^3.7.0",
46
47
  "aws-iot-device-sdk": "^2.2.11",
47
48
  "serialize-error": "9.1.0",
48
49
  "swagger-client": "^3.18.0",
@@ -33,8 +33,8 @@ let auth = function () {
33
33
  return this.__privates.providerAuth;
34
34
  },
35
35
 
36
- deviceLogin: (salt) => {
37
- return getBrowserFingerprint(this.__instanceType, salt)
36
+ deviceLogin: ( usePrecise = false, salt = 'ThisIsSaltyAF') => {
37
+ return getBrowserFingerprint(this.__instanceType, usePrecise, salt)
38
38
  .then( deviceId => Promise.all([deviceId, this.__privates.auth.__client]))
39
39
  .then(([deviceId, client]) => client.apis.auth.deviceSignIn({},{requestBody:{deviceId, domain: location.hostname}}))
40
40
  .then(response => {
@@ -16,6 +16,7 @@ import syncDoris from "../modules/sync-modules/sync-doris";
16
16
  import syncDisabled from "../modules/sync-modules/sync-disabled";
17
17
  import syncDaznDash from "../modules/sync-modules/sync-dazn-dash";
18
18
  import syncUniversal from "../modules/sync-modules/sync-universal";
19
+ import syncModule from "../modules/sync-modules/sync-module";
19
20
 
20
21
  let roomSession = function ({roomId, pinHash, role}, room, wt) {
21
22
 
@@ -194,6 +195,7 @@ let roomSession = function ({roomId, pinHash, role}, room, wt) {
194
195
  }
195
196
  },
196
197
 
198
+ // DAZN interface
197
199
  renderPlayer: function (playerWrapper, fullscreenElement, roomId) {
198
200
  try {
199
201
  this.syncModule = syncUniversal({room, wt, roomSession: this, emitter});
@@ -209,25 +211,38 @@ let roomSession = function ({roomId, pinHash, role}, room, wt) {
209
211
 
210
212
  this.detachPlayer();
211
213
 
212
- if (type === 'hlsjs') {
214
+ if(type === 'universal') {
215
+ this.syncModule = syncModule({room, emitter});
216
+ if (this.syncModule.__events) {
217
+ addEvents(this.syncModule.__events);
218
+ }
219
+ this.syncModule.initialize(inputs);
220
+ }
221
+
222
+ // Everything below is for legacy player and will be removed in the future
223
+
224
+ else if (type === 'hlsjs') {
213
225
  this.syncModule = syncHlsJs({room, wt, roomSession: this, emitter});
214
226
  if (this.syncModule.__events) {
215
227
  addEvents(this.syncModule.__events);
216
228
  }
217
229
  this.syncModule.initialize(inputs);
218
- } else if (type === 'hlsjs-vod') {
230
+ }
231
+ else if (type === 'hlsjs-vod') {
219
232
  this.syncModule = syncVodHlsJs({room, wt, roomSession: this, emitter});
220
233
  if (this.syncModule.__events) {
221
234
  addEvents(this.syncModule.__events);
222
235
  }
223
236
  this.syncModule.initialize(inputs);
224
- } else if (type === 'hlsnative-vod') {
237
+ }
238
+ else if (type === 'hlsnative-vod') {
225
239
  this.syncModule = syncVodNativeHls({room, wt, roomSession: this, emitter});
226
240
  if (this.syncModule.__events) {
227
241
  addEvents(this.syncModule.__events);
228
242
  }
229
243
  this.syncModule.initialize(inputs);
230
- } else if (type === 'hlsnative') {
244
+ }
245
+ else if (type === 'hlsnative') {
231
246
  this.syncModule = syncNativeHls({room, wt, roomSession: this, emitter});
232
247
  if (this.syncModule.__events) {
233
248
  addEvents(this.syncModule.__events);
@@ -263,13 +278,15 @@ let roomSession = function ({roomId, pinHash, role}, room, wt) {
263
278
  addEvents(this.syncModule.__events);
264
279
  }
265
280
  this.syncModule.initialize(inputs);
266
- } else if (type === 'dazn-dash') {
281
+ }
282
+ else if (type === 'dazn-dash') {
267
283
  this.syncModule = syncDaznDash({room, wt, roomSession: this, emitter});
268
284
  if (this.syncModule.__events) {
269
285
  addEvents(this.syncModule.__events);
270
286
  }
271
287
  this.syncModule.initialize(inputs);
272
- } else if (type === 'disabled') {
288
+ }
289
+ else if (type === 'disabled') {
273
290
  this.syncModule = syncDisabled({room, wt, roomSession: this, emitter});
274
291
  if (this.syncModule.__events) {
275
292
  addEvents(this.syncModule.__events);