@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.
- package/dist/watchtogether-sdk.js +35 -11
- package/dist/watchtogether-sdk.min.js +2 -2
- package/example/index.html +1 -1
- package/package.json +2 -1
- package/src/models/auth.js +2 -2
- package/src/models/room-session.js +23 -6
- package/src/modules/sync-modules/sync-module.js +607 -0
- package/src/modules/wt-room.js +3 -3
- package/src/modules/wt-utils.js +32 -12
package/example/index.html
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reactoo/watchtogether-sdk-js",
|
|
3
|
-
"version": "2.5.
|
|
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",
|
package/src/models/auth.js
CHANGED
|
@@ -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
|
|
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
|
-
}
|
|
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
|
-
}
|
|
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
|
-
}
|
|
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
|
-
}
|
|
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
|
-
}
|
|
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);
|