@reactoo/watchtogether-sdk-js 2.4.36 → 2.4.43
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 +490 -181
- package/dist/watchtogether-sdk.min.js +2 -2
- package/example/index.html +0 -27
- package/package.json +7 -7
- package/src/models/room-session.js +8 -7
- package/src/models/user.js +5 -3
- package/src/modules/wt-room.js +10 -8
package/example/index.html
CHANGED
|
@@ -153,33 +153,6 @@
|
|
|
153
153
|
})
|
|
154
154
|
.then(r => Instance.room.createSession({roomId:r.roomId, pinHash: r.pinHash})) // pin hash is not needed if you're owner of the room
|
|
155
155
|
.then(session => {
|
|
156
|
-
Instance.user.getUserSelf().then(r => {
|
|
157
|
-
Instance.room.getRoomChatList({roomId})
|
|
158
|
-
.then(r => console.log('wooo',r))
|
|
159
|
-
|
|
160
|
-
})
|
|
161
|
-
|
|
162
|
-
;
|
|
163
|
-
|
|
164
|
-
Instance.user.getVideos({type:'room', roomId, includeUserModels: true});
|
|
165
|
-
|
|
166
|
-
// Instance.user.getUserSelf().then(r => {
|
|
167
|
-
// console.log(r.data._id);
|
|
168
|
-
// return Instance.room.queue({roomId, operation:'join', userId:r.data._id});
|
|
169
|
-
// }).then(r => {
|
|
170
|
-
// console.log(r.data);
|
|
171
|
-
// return Instance.room.queue({roomId, operation:'status'});
|
|
172
|
-
// })
|
|
173
|
-
// .then(r => {
|
|
174
|
-
// console.log(r.data);
|
|
175
|
-
// return Instance.room.queue({roomId,userId:'eu-west-1:f3532bdd-cc3a-4c62-a77e-4f1f544d8fa9', operation:'approve'});
|
|
176
|
-
// })
|
|
177
|
-
// .then(r => {
|
|
178
|
-
// console.log(r.data);
|
|
179
|
-
// })
|
|
180
|
-
|
|
181
|
-
//
|
|
182
|
-
|
|
183
156
|
|
|
184
157
|
|
|
185
158
|
sessionHandler = session;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reactoo/watchtogether-sdk-js",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.43",
|
|
4
4
|
"description": "Javascript SDK for Reactoo",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"unpkg": "dist/watchtogether-sdk.min.js",
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
},
|
|
26
26
|
"homepage": "https://github.com/picitujeromanov/WR-SDK",
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@babel/core": "^7.16.
|
|
29
|
-
"@babel/plugin-proposal-class-properties": "^7.16.
|
|
30
|
-
"@babel/plugin-proposal-optional-chaining": "^7.16.
|
|
31
|
-
"@babel/plugin-proposal-private-property-in-object": "^7.16.
|
|
32
|
-
"@babel/preset-env": "^7.16.
|
|
28
|
+
"@babel/core": "^7.16.5",
|
|
29
|
+
"@babel/plugin-proposal-class-properties": "^7.16.5",
|
|
30
|
+
"@babel/plugin-proposal-optional-chaining": "^7.16.5",
|
|
31
|
+
"@babel/plugin-proposal-private-property-in-object": "^7.16.5",
|
|
32
|
+
"@babel/preset-env": "^7.16.5",
|
|
33
33
|
"acorn": "^6.4.2",
|
|
34
34
|
"babel-core": "^6.26.3",
|
|
35
35
|
"babel-loader": "^8.2.3",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"aws-iot-device-sdk": "^2.2.11",
|
|
47
47
|
"paho-mqtt": "^1.1.0",
|
|
48
48
|
"serialize-error": "^7.0.1",
|
|
49
|
-
"swagger-client": "^3.
|
|
49
|
+
"swagger-client": "^3.18.0",
|
|
50
50
|
"webrtc-adapter": "^7.7.1"
|
|
51
51
|
},
|
|
52
52
|
"browserslist": [
|
|
@@ -29,11 +29,7 @@ let roomSession = function ({roomId, pinHash, isTalkback, isMonitor, isInstructo
|
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
const emitter = _emitter_();
|
|
32
|
-
|
|
33
32
|
let alpTimeoutId = null;
|
|
34
|
-
let publishRetry = 0;
|
|
35
|
-
const maxPublishRetry = 3;
|
|
36
|
-
|
|
37
33
|
let ___; // return object
|
|
38
34
|
|
|
39
35
|
room.on('addLocalParticipant', () => {
|
|
@@ -171,9 +167,14 @@ let roomSession = function ({roomId, pinHash, isTalkback, isMonitor, isInstructo
|
|
|
171
167
|
},
|
|
172
168
|
|
|
173
169
|
renderPlayer: function (playerWrapper, fullscreenElement, roomId) {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
170
|
+
try {
|
|
171
|
+
this.syncModule = syncUniversal({room, wt, roomSession: this, emitter});
|
|
172
|
+
this.playerInterface = wt.__privates.playerFactory(playerWrapper, fullscreenElement, this.syncModule.getHandlers(), {roomId});
|
|
173
|
+
this.syncModule.initialize({playerInterface: this.playerInterface});
|
|
174
|
+
return true;
|
|
175
|
+
} catch (e) {
|
|
176
|
+
return false;
|
|
177
|
+
}
|
|
177
178
|
},
|
|
178
179
|
|
|
179
180
|
attachPlayer: function (type, inputs) {
|
package/src/models/user.js
CHANGED
|
@@ -111,16 +111,18 @@ let user = function () {
|
|
|
111
111
|
|
|
112
112
|
track: ({eventType = 'ERROR', message} = {}) => {
|
|
113
113
|
return this.__privates.auth.__client
|
|
114
|
-
.then(client => client.apis.wt.track({},{
|
|
114
|
+
.then(client => client.apis.wt.track({},{
|
|
115
|
+
requestBody:{
|
|
115
116
|
"eventType": eventType,
|
|
116
117
|
"appType": "web",
|
|
117
|
-
"deviceType": `desktop${navigator.maxTouchPoints ? '/
|
|
118
|
+
"deviceType": `desktop${navigator.maxTouchPoints ? '/touch' : ''}`,
|
|
118
119
|
"os": navigator.platform,
|
|
119
120
|
"browser": navigator.userAgent,
|
|
120
121
|
"domain": location.host,
|
|
121
122
|
"url": location.href,
|
|
122
123
|
"message": serializeError(message)
|
|
123
|
-
}
|
|
124
|
+
}
|
|
125
|
+
}));
|
|
124
126
|
},
|
|
125
127
|
|
|
126
128
|
getTranslation: ({namespace = 'wt'} = {}) => {
|
package/src/modules/wt-room.js
CHANGED
|
@@ -164,12 +164,7 @@ class RoomSession {
|
|
|
164
164
|
}
|
|
165
165
|
};
|
|
166
166
|
|
|
167
|
-
constructor(enableDebugFlag, type = 'reactooroom', options = {
|
|
168
|
-
classroomObserverSubscribeToInstructor: false,
|
|
169
|
-
classroomInstructorSubscribeToParticipants: false,
|
|
170
|
-
safariBugHotfixEnabled: true
|
|
171
|
-
}) {
|
|
172
|
-
|
|
167
|
+
constructor(enableDebugFlag, type = 'reactooroom', options = {}) {
|
|
173
168
|
this.server = null;
|
|
174
169
|
this.iceServers = null;
|
|
175
170
|
this.token = null;
|
|
@@ -182,7 +177,14 @@ class RoomSession {
|
|
|
182
177
|
this.isMonitor = false; // currently used just for classroom context so monitor user only subscribes to participants and not trainer (for other monitor this flag is not necessary)
|
|
183
178
|
this.recordingFilename = null;
|
|
184
179
|
this.pluginName = RoomSession.sessionTypes()[type];
|
|
185
|
-
this.options =
|
|
180
|
+
this.options = {
|
|
181
|
+
...{
|
|
182
|
+
classroomObserverSubscribeToInstructor: false,
|
|
183
|
+
classroomInstructorSubscribeToParticipants: false,
|
|
184
|
+
safariBugHotfixEnabled: adapter.browserDetails.browser === 'safari' && adapter.browserDetails.version < 605
|
|
185
|
+
},
|
|
186
|
+
options
|
|
187
|
+
};
|
|
186
188
|
//this.pluginName = this.#sessionTypes[type];
|
|
187
189
|
|
|
188
190
|
Object.assign(this, emitter());
|
|
@@ -2001,7 +2003,7 @@ class RoomSession {
|
|
|
2001
2003
|
}
|
|
2002
2004
|
let config = handle.webrtcStuff;
|
|
2003
2005
|
|
|
2004
|
-
if(this.options.safariBugHotfixEnabled
|
|
2006
|
+
if(this.options.safariBugHotfixEnabled) {
|
|
2005
2007
|
this.isVideoMuted = !this.isVideoMuted;
|
|
2006
2008
|
}
|
|
2007
2009
|
else if (this.isUnifiedPlan) {
|