@reactoo/watchtogether-sdk-js 2.5.62 → 2.5.65

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.5.62",
3
+ "version": "2.5.65",
4
4
  "description": "Javascript SDK for Reactoo",
5
5
  "main": "src/index.js",
6
6
  "unpkg": "dist/watchtogether-sdk.min.js",
@@ -184,11 +184,15 @@ let roomSession = function ({roomId, pinHash, role}, room, wt) {
184
184
  } else if (msg.user_action === 'chat_message') {
185
185
  emitter.emit('chatMessage', msg);
186
186
  } else if (msg.user_action === 'remote_muted') {
187
- if (msg.from !== room.userId) {
188
- emitter.emit('remoteMuted', {userId: decodeJanusDisplay(msg.from)?.userId, ...(msg.text && JSON.parse(msg.text))})
187
+ const fromUserId = decodeJanusDisplay(msg.from)?.userId;
188
+ const ownUserId = decodeJanusDisplay(room.userId)?.userId;
189
+ if (fromUserId !== ownUserId) {
190
+ emitter.emit('remoteMuted', {role: decodeJanusDisplay(msg.from)?.role, userId: decodeJanusDisplay(msg.from)?.userId, ...(msg.text && JSON.parse(msg.text))})
189
191
  }
190
192
  } else if (msg.user_action === 'remote_muted_request') {
191
- if (msg.from !== room.userId) {
193
+ const fromUserId = decodeJanusDisplay(msg.from)?.userId;
194
+ const ownUserId = decodeJanusDisplay(room.userId)?.userId;
195
+ if (fromUserId !== ownUserId) {
192
196
  this.__sendMuteStatus();
193
197
  }
194
198
  }
@@ -594,11 +594,6 @@ const syncModule = function ({room, emitter} = {}) {
594
594
  room.off('addLocalParticipant', handleAddLocalParticipant);
595
595
  room.off('addRemoteParticipant', handleAddRemoteParticipant);
596
596
  room.off('data', parseDataEvents);
597
-
598
- if(typeof _playerInterface?.destroy === 'function') {
599
- _playerInterface?.destroy()
600
- }
601
-
602
597
  _playerInterface = null;
603
598
 
604
599
  _emitter.clear();
@@ -828,9 +828,9 @@ class RoomSession {
828
828
  this._isDataChannelOpen = false;
829
829
  this.isPublished = false;
830
830
  this.emit('published', {status: false, hasStream: false});
831
- this.emit('removeLocalParticipant', {id: handleId, userId: decodeJanusDisplay(handle.userId)?.userId});
831
+ this.emit('removeLocalParticipant', {id: handleId, userId: decodeJanusDisplay(handle.userId)?.userId, role: decodeJanusDisplay(handle.userId)?.role});
832
832
  } else {
833
- this.emit(this._getRemoveParticipantEventName(handleId), {id: handleId, userId: decodeJanusDisplay(handle.userId)?.userId});
833
+ this.emit(this._getRemoveParticipantEventName(handleId), {id: handleId, userId: decodeJanusDisplay(handle.userId)?.userId, role: decodeJanusDisplay(handle.userId)?.role});
834
834
  }
835
835
 
836
836
  if (removeHandle) {