@reactoo/watchtogether-sdk-js 2.8.20 → 2.8.22

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.20",
3
+ "version": "2.8.22",
4
4
  "description": "Javascript SDK for Reactoo",
5
5
  "main": "dist/watchtogether-sdk.min.js",
6
6
  "module": "dist/watchtogether-sdk.min.js",
@@ -61,6 +61,12 @@ let roomSession = function ({roomId, pinHash, role, options = {}}, room, wt) {
61
61
  ___.__parseDataMessageEvents(data);
62
62
  })
63
63
 
64
+ room.on('error', (e) => {
65
+ if(e?.type === 'error') {
66
+ ___.disconnect(true);
67
+ }
68
+ });
69
+
64
70
  return (___ = {
65
71
 
66
72
  syncModule: null,
@@ -438,6 +444,11 @@ let roomSession = function ({roomId, pinHash, role, options = {}}, room, wt) {
438
444
  },
439
445
 
440
446
  __sendMuteStatus: function () {
447
+
448
+ if(room.getMyUserRole() !== 'participant') {
449
+ return;
450
+ }
451
+
441
452
  for(const val of room.isMuted) {
442
453
  this.sendSystemMessage('remote_muted', {...val});
443
454
  }
@@ -3210,6 +3210,10 @@ class RoomSession {
3210
3210
  }
3211
3211
  }
3212
3212
 
3213
+ getMyUserRole() {
3214
+ return decodeJanusDisplay(this.display)?.role || 'participant';
3215
+ }
3216
+
3213
3217
  requestKeyFrame(handleId, mid) {
3214
3218
  this.sendMessage(handleId, {
3215
3219
  "body": {