@reactoo/watchtogether-sdk-js 2.8.21 → 2.8.23

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reactoo/watchtogether-sdk-js",
3
- "version": "2.8.21",
3
+ "version": "2.8.23",
4
4
  "description": "Javascript SDK for Reactoo",
5
5
  "main": "dist/watchtogether-sdk.min.js",
6
6
  "module": "dist/watchtogether-sdk.min.js",
@@ -444,6 +444,11 @@ let roomSession = function ({roomId, pinHash, role, options = {}}, room, wt) {
444
444
  },
445
445
 
446
446
  __sendMuteStatus: function () {
447
+
448
+ if(room.getMyUserRole() !== 'participant') {
449
+ return;
450
+ }
451
+
447
452
  for(const val of room.isMuted) {
448
453
  this.sendSystemMessage('remote_muted', {...val});
449
454
  }
@@ -224,15 +224,24 @@ class RoomSession {
224
224
  Object.assign(this, emitter());
225
225
  this.options = {...options};
226
226
  this.defaultDataChannelLabel = 'JanusDataChannel'
227
+ this.sessionId = null;
227
228
  this.server = null;
229
+ this.protocol = null;
228
230
  this.iceServers = null;
229
231
  this.token = null;
230
232
  this.roomId = null;
231
233
  this.pin = null;
232
234
  this.userId = null;
235
+ this.id = null;
236
+ this.display = null;
237
+ this.userRole = null;
233
238
  this.initialBitrate = 0;
234
239
  this.enableDtx = false;
235
240
  this.simulcast = false;
241
+ this.webrtcVersion = null;
242
+ this.recordingFilename = null;
243
+ this.simulcastSettings = null;
244
+ this.useWebsockets = null;
236
245
 
237
246
 
238
247
  this.defaultSimulcastSettings = {
@@ -2005,6 +2014,7 @@ class RoomSession {
2005
2014
  this.pin = pin;
2006
2015
  this.id = null;
2007
2016
  this.display = display;
2017
+ this.userRole = decodeJanusDisplay(this.display)?.role || 'participant'
2008
2018
  this.userId = userId;
2009
2019
  this.webrtcVersion = webrtcVersion;
2010
2020
  this.initialBitrate = initialBitrate;
@@ -3210,6 +3220,10 @@ class RoomSession {
3210
3220
  }
3211
3221
  }
3212
3222
 
3223
+ getMyUserRole() {
3224
+ return this.userRole;
3225
+ }
3226
+
3213
3227
  requestKeyFrame(handleId, mid) {
3214
3228
  this.sendMessage(handleId, {
3215
3229
  "body": {