@reactoo/watchtogether-sdk-js 2.5.97 → 2.5.99

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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * @reactoo/watchtogether-sdk-js
3
- * @version 2.5.97
3
+ * @version 2.5.99
4
4
  */
5
5
  (function webpackUniversalModuleDefinition(root, factory) {
6
6
  if(typeof exports === 'object' && typeof module === 'object')
@@ -10054,7 +10054,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n\n\nlet iot = function () {\n
10054
10054
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
10055
10055
 
10056
10056
  "use strict";
10057
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _modules_wt_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../modules/wt-utils */ \"./src/modules/wt-utils.js\");\n/* harmony import */ var _modules_wt_emitter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../modules/wt-emitter */ \"./src/modules/wt-emitter.js\");\n/* harmony import */ var _modules_sync_modules_sync_hls__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../modules/sync-modules/sync-hls */ \"./src/modules/sync-modules/sync-hls.js\");\n/* harmony import */ var _modules_sync_modules_sync_hls_vod__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../modules/sync-modules/sync-hls-vod */ \"./src/modules/sync-modules/sync-hls-vod.js\");\n/* harmony import */ var _modules_sync_modules_sync_native_hls_vod__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../modules/sync-modules/sync-native-hls-vod */ \"./src/modules/sync-modules/sync-native-hls-vod.js\");\n/* harmony import */ var _modules_sync_modules_sync_native_hls__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../modules/sync-modules/sync-native-hls */ \"./src/modules/sync-modules/sync-native-hls.js\");\n/* harmony import */ var _modules_sync_modules_sync_shaka_dash__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../modules/sync-modules/sync-shaka-dash */ \"./src/modules/sync-modules/sync-shaka-dash.js\");\n/* harmony import */ var _modules_sync_modules_sync_shaka_dash_vod__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../modules/sync-modules/sync-shaka-dash-vod */ \"./src/modules/sync-modules/sync-shaka-dash-vod.js\");\n/* harmony import */ var _modules_sync_modules_sync_dash__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../modules/sync-modules/sync-dash */ \"./src/modules/sync-modules/sync-dash.js\");\n/* harmony import */ var _modules_sync_modules_sync_dash_vod__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../modules/sync-modules/sync-dash-vod */ \"./src/modules/sync-modules/sync-dash-vod.js\");\n/* harmony import */ var _modules_sync_modules_sync_doris__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../modules/sync-modules/sync-doris */ \"./src/modules/sync-modules/sync-doris.js\");\n/* harmony import */ var _modules_sync_modules_sync_disabled__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../modules/sync-modules/sync-disabled */ \"./src/modules/sync-modules/sync-disabled.js\");\n/* harmony import */ var _modules_sync_modules_sync_dazn_dash__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../modules/sync-modules/sync-dazn-dash */ \"./src/modules/sync-modules/sync-dazn-dash.js\");\n/* harmony import */ var _modules_sync_modules_sync_dazn__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../modules/sync-modules/sync-dazn */ \"./src/modules/sync-modules/sync-dazn.js\");\n/* harmony import */ var _modules_sync_modules_sync_module__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../modules/sync-modules/sync-module */ \"./src/modules/sync-modules/sync-module.js\");\n\n\n\n\n\n// SYNCHRONISATION MODULES\n\n\n\n\n\n\n\n\n\n\n\n\n\nlet roomSession = function (_ref, room, wt) {\n let {\n roomId,\n pinHash,\n role\n } = _ref;\n let primaryRoomId = roomId;\n let publicCustomEvents = ['changePlayerSource', 'chatMessage', 'userUpdate', 'reconnecting', 'connecting', 'remoteMuted', 'scaling'];\n const addEvents = events => {\n publicCustomEvents = [...publicCustomEvents, ...events];\n };\n const removeEvents = events => {\n publicCustomEvents = publicCustomEvents.filter(ev => events.indexOf(ev) === -1);\n };\n const emitter = Object(_modules_wt_emitter__WEBPACK_IMPORTED_MODULE_1__[\"default\"])();\n let alpTimeoutId = null;\n let abortController = null;\n let ___; // return object\n\n room.on('addLocalParticipant', () => {\n // TODO: this doesnt seem to be fixable until we switch to different type of messaging\n // At some random case we don't get message back if we don't wait\n\n clearTimeout(alpTimeoutId);\n alpTimeoutId = setTimeout(() => {\n ___.__requestMuteStatus();\n }, 2000);\n });\n room.on('localMuted', _ref2 => {\n let {\n type,\n value\n } = _ref2;\n ___.sendSystemMessage('remote_muted', {\n type,\n value\n });\n });\n room.on('data', data => {\n ___.__parseDataEvents(data);\n });\n return ___ = {\n syncModule: null,\n playerInterface: null,\n get userId() {\n return room.userId;\n },\n get roomId() {\n return roomId;\n },\n get sessionId() {\n return room.sessionId;\n },\n get constructId() {\n return room.constructId;\n },\n destroy: function () {\n clearTimeout(alpTimeoutId);\n this.detachPlayer();\n return room.destroy().finally(() => {\n this.$clear();\n return true;\n });\n },\n iceRestart: function () {\n return room._iceRestart(room.handleId);\n },\n connect: function () {\n var _abortController;\n let {\n reactooRoomId = null\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n emitter.emit('connecting', true);\n clearTimeout(alpTimeoutId);\n abortController = new AbortController();\n return wt.room.__joinRoom({\n roomId: reactooRoomId || primaryRoomId,\n pinHash,\n role\n }, (_abortController = abortController) === null || _abortController === void 0 ? void 0 : _abortController.signal).then(roomData => {\n var _roomData$data;\n // Happens when we reroute user to a different room\n if ((roomData === null || roomData === void 0 ? void 0 : (_roomData$data = roomData.data) === null || _roomData$data === void 0 ? void 0 : _roomData$data.reactooRoomId) !== roomId) {\n roomId = roomData.data.reactooRoomId;\n emitter.emit('changeRoomId', roomId);\n }\n room.setRoomType(roomData.data.roomType);\n return room.connect(roomData.data.roomId, roomData.data.pin, roomData.data.href, roomData.data.iceServers, roomData.data.accessToken, roomData.data.display, roomData.data.userId, roomData.data.webrtcVersion, roomData.data.bitrate ? parseInt(roomData.data.bitrate) : 0, roomData.data.recordingFilename, roomData.data.simulcast, roomData.data.simulcastBitrates || {});\n }).finally(() => {\n emitter.emit('connecting', false);\n });\n },\n disconnect: function (dontWaitForResponses) {\n var _abortController2, _abortController2$abo;\n clearTimeout(alpTimeoutId);\n (_abortController2 = abortController) === null || _abortController2 === void 0 ? void 0 : (_abortController2$abo = _abortController2.abort) === null || _abortController2$abo === void 0 ? void 0 : _abortController2$abo.call(_abortController2);\n return room.disconnect(dontWaitForResponses);\n },\n //TODO: refactor restart method\n restart: function () {\n var _handle$webrtcStuff;\n let {\n isObserver = false,\n reactooRoomId = null\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n emitter.emit('reconnecting', true);\n room.isRestarting = true;\n let wasPublished = room.isPublished;\n let handle = room._getHandle(room.handleId);\n let stream = null;\n if (handle !== null && handle !== void 0 && (_handle$webrtcStuff = handle.webrtcStuff) !== null && _handle$webrtcStuff !== void 0 && _handle$webrtcStuff.stream && wasPublished) {\n stream = handle.webrtcStuff.stream;\n }\n return this.disconnect().then(() => Object(_modules_wt_utils__WEBPACK_IMPORTED_MODULE_0__[\"wait\"])(1000)) //TODO: remove 1000ms wait by waiting for proper events from janus\n .then(() => this.connect({\n reactooRoomId\n })).then(() => {\n if (isObserver) {\n return this.publishLocal(null);\n } else if (stream) {\n return this.publishLocal(stream);\n } else return Promise.resolve();\n }).then(() => {\n room.isRestarting = false;\n emitter.emit('reconnecting', false);\n return 1;\n }).catch(error => {\n room.isRestarting = false;\n emitter.emit('reconnecting', false);\n emitter.emit('error', {\n type: 'error',\n id: 26,\n message: 'reconnecting failed',\n data: error\n });\n return Promise.reject(0);\n });\n },\n getStats: function () {\n let type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n return room._getStats(type);\n },\n getRoomParticipants: function () {\n return room._participants;\n },\n __parseDataEvents: function () {\n let msg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n if (msg.videoroom === 'message') {\n if (msg.action === 'pending_shutdown' || msg.action === 'shutting_down') {\n emitter.emit('scaling');\n this.restart(); // current videoroom was reassigned to a different WebRTC instance\n } else if (msg.action === 'force_restart') {\n this.restart();\n } else if (msg.action === 'user_update_displayname' || msg.action === 'user_update_avatar' || msg.action === 'user_update_customattributes' || msg.action === 'user_update_privateattributes') {\n emitter.emit('userUpdate', msg.text);\n } else if (msg.action === 'bitrate_changed') {\n this.setBitrateCap(msg.text);\n } else if (msg.user_action === 'chat_message') {\n emitter.emit('chatMessage', msg);\n } else if (msg.user_action === 'remote_muted') {\n var _decodeJanusDisplay, _decodeJanusDisplay2;\n const fromUserId = (_decodeJanusDisplay = Object(_modules_wt_utils__WEBPACK_IMPORTED_MODULE_0__[\"decodeJanusDisplay\"])(msg.from)) === null || _decodeJanusDisplay === void 0 ? void 0 : _decodeJanusDisplay.userId;\n const ownUserId = (_decodeJanusDisplay2 = Object(_modules_wt_utils__WEBPACK_IMPORTED_MODULE_0__[\"decodeJanusDisplay\"])(room.userId)) === null || _decodeJanusDisplay2 === void 0 ? void 0 : _decodeJanusDisplay2.userId;\n if (fromUserId !== ownUserId) {\n var _decodeJanusDisplay3, _decodeJanusDisplay4;\n emitter.emit('remoteMuted', {\n role: (_decodeJanusDisplay3 = Object(_modules_wt_utils__WEBPACK_IMPORTED_MODULE_0__[\"decodeJanusDisplay\"])(msg.from)) === null || _decodeJanusDisplay3 === void 0 ? void 0 : _decodeJanusDisplay3.role,\n userId: (_decodeJanusDisplay4 = Object(_modules_wt_utils__WEBPACK_IMPORTED_MODULE_0__[\"decodeJanusDisplay\"])(msg.from)) === null || _decodeJanusDisplay4 === void 0 ? void 0 : _decodeJanusDisplay4.userId,\n ...(msg.text && JSON.parse(msg.text))\n });\n }\n } else if (msg.user_action === 'remote_muted_request') {\n var _decodeJanusDisplay5, _decodeJanusDisplay6;\n const fromUserId = (_decodeJanusDisplay5 = Object(_modules_wt_utils__WEBPACK_IMPORTED_MODULE_0__[\"decodeJanusDisplay\"])(msg.from)) === null || _decodeJanusDisplay5 === void 0 ? void 0 : _decodeJanusDisplay5.userId;\n const ownUserId = (_decodeJanusDisplay6 = Object(_modules_wt_utils__WEBPACK_IMPORTED_MODULE_0__[\"decodeJanusDisplay\"])(room.userId)) === null || _decodeJanusDisplay6 === void 0 ? void 0 : _decodeJanusDisplay6.userId;\n if (fromUserId !== ownUserId) {\n this.__sendMuteStatus();\n }\n }\n }\n },\n // DAZN interface\n renderPlayer: function (playerWrapper, fullscreenElement, roomId) {\n try {\n this.syncModule = Object(_modules_sync_modules_sync_dazn__WEBPACK_IMPORTED_MODULE_13__[\"default\"])({\n room,\n wt,\n roomSession: this,\n emitter\n });\n this.playerInterface = wt.__privates.playerFactory(playerWrapper, fullscreenElement, this.syncModule.getHandlers(), {\n roomId\n });\n this.syncModule.initialize({\n playerInterface: this.playerInterface\n });\n return true;\n } catch (e) {\n return false;\n }\n },\n attachPlayer: function (type, inputs) {\n this.detachPlayer();\n if (type === 'universal') {\n this.syncModule = Object(_modules_sync_modules_sync_module__WEBPACK_IMPORTED_MODULE_14__[\"default\"])({\n room,\n emitter\n });\n if (this.syncModule.__events) {\n addEvents(this.syncModule.__events);\n }\n this.syncModule.initialize(inputs);\n }\n\n // Everything below is for legacy player and will be removed in the future\n else if (type === 'hlsjs') {\n this.syncModule = Object(_modules_sync_modules_sync_hls__WEBPACK_IMPORTED_MODULE_2__[\"default\"])({\n room,\n wt,\n roomSession: this,\n emitter\n });\n if (this.syncModule.__events) {\n addEvents(this.syncModule.__events);\n }\n this.syncModule.initialize(inputs);\n } else if (type === 'hlsjs-vod') {\n this.syncModule = Object(_modules_sync_modules_sync_hls_vod__WEBPACK_IMPORTED_MODULE_3__[\"default\"])({\n room,\n wt,\n roomSession: this,\n emitter\n });\n if (this.syncModule.__events) {\n addEvents(this.syncModule.__events);\n }\n this.syncModule.initialize(inputs);\n } else if (type === 'hlsnative-vod') {\n this.syncModule = Object(_modules_sync_modules_sync_native_hls_vod__WEBPACK_IMPORTED_MODULE_4__[\"default\"])({\n room,\n wt,\n roomSession: this,\n emitter\n });\n if (this.syncModule.__events) {\n addEvents(this.syncModule.__events);\n }\n this.syncModule.initialize(inputs);\n } else if (type === 'hlsnative') {\n this.syncModule = Object(_modules_sync_modules_sync_native_hls__WEBPACK_IMPORTED_MODULE_5__[\"default\"])({\n room,\n wt,\n roomSession: this,\n emitter\n });\n if (this.syncModule.__events) {\n addEvents(this.syncModule.__events);\n }\n this.syncModule.initialize(inputs);\n } else if (type === 'shaka-dash-vod') {\n this.syncModule = Object(_modules_sync_modules_sync_shaka_dash_vod__WEBPACK_IMPORTED_MODULE_7__[\"default\"])({\n room,\n wt,\n roomSession: this,\n emitter\n });\n if (this.syncModule.__events) {\n addEvents(this.syncModule.__events);\n }\n this.syncModule.initialize(inputs);\n } else if (type === 'shaka-dash') {\n this.syncModule = Object(_modules_sync_modules_sync_shaka_dash__WEBPACK_IMPORTED_MODULE_6__[\"default\"])({\n room,\n wt,\n roomSession: this,\n emitter\n });\n if (this.syncModule.__events) {\n addEvents(this.syncModule.__events);\n }\n this.syncModule.initialize(inputs);\n } else if (type === 'dashjs') {\n this.syncModule = Object(_modules_sync_modules_sync_dash__WEBPACK_IMPORTED_MODULE_8__[\"default\"])({\n room,\n wt,\n roomSession: this,\n emitter\n });\n if (this.syncModule.__events) {\n addEvents(this.syncModule.__events);\n }\n this.syncModule.initialize(inputs);\n } else if (type === 'dashjs-vod') {\n this.syncModule = Object(_modules_sync_modules_sync_dash_vod__WEBPACK_IMPORTED_MODULE_9__[\"default\"])({\n room,\n wt,\n roomSession: this,\n emitter\n });\n if (this.syncModule.__events) {\n addEvents(this.syncModule.__events);\n }\n this.syncModule.initialize(inputs);\n } else if (type === 'doris') {\n this.syncModule = Object(_modules_sync_modules_sync_doris__WEBPACK_IMPORTED_MODULE_10__[\"default\"])({\n room,\n wt,\n roomSession: this,\n emitter\n });\n if (this.syncModule.__events) {\n addEvents(this.syncModule.__events);\n }\n this.syncModule.initialize(inputs);\n } else if (type === 'dazn-dash') {\n this.syncModule = Object(_modules_sync_modules_sync_dazn_dash__WEBPACK_IMPORTED_MODULE_12__[\"default\"])({\n room,\n wt,\n roomSession: this,\n emitter\n });\n if (this.syncModule.__events) {\n addEvents(this.syncModule.__events);\n }\n this.syncModule.initialize(inputs);\n } else if (type === 'disabled') {\n this.syncModule = Object(_modules_sync_modules_sync_disabled__WEBPACK_IMPORTED_MODULE_11__[\"default\"])({\n room,\n wt,\n roomSession: this,\n emitter\n });\n if (this.syncModule.__events) {\n addEvents(this.syncModule.__events);\n }\n this.syncModule.initialize(inputs);\n } else {\n room._log('Synchronisation type not recognised');\n }\n },\n detachPlayer: function () {\n if (this.syncModule) {\n this.playerInterface = null;\n this.syncModule.destroy();\n if (this.syncModule.__events) {\n removeEvents(this.syncModule.__events);\n }\n this.syncModule = null;\n }\n },\n publishLocal: function () {\n let stream = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n return room.publishLocal(stream);\n },\n unpublishLocal: () => {\n return room.unpublishLocal();\n },\n toggleAudio: value => {\n return room.toggleAudio(value);\n },\n toggleVideo: () => {\n return room.toggleVideo();\n },\n selectSubStream: (handleId, substream) => {\n return room.selectSubStream(handleId, substream);\n },\n setBitrateCap: bitrate => {\n if (role === 'host') {\n return;\n }\n return room.sendMessage(room.handleId, {\n \"body\": {\n \"request\": \"configure\",\n \"bitrate\": parseInt(bitrate)\n }\n }).catch(() => null);\n },\n sendSystemMessage: function (action) {\n let value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n let to = arguments.length > 2 ? arguments[2] : undefined;\n let set_master = arguments.length > 3 ? arguments[3] : undefined;\n return room.sendMessage(room.handleId, {\n body: {\n action,\n request: \"message\",\n room: room.roomId,\n timestamp: new Date().getTime(),\n text: JSON.stringify(value),\n ...(to && Array.isArray(to) ? {\n tos: to\n } : {\n to\n }),\n ...(set_master && {\n set_master\n })\n }\n });\n },\n sendChatMessage: (text, to) => {\n return room.sendMessage(room.handleId, {\n body: {\n action: \"chat_message\",\n request: \"message\",\n room: room.roomId,\n timestamp: new Date().getTime(),\n text,\n ...(to && Array.isArray(to) ? {\n tos: to\n } : {\n to\n })\n }\n });\n },\n __requestMuteStatus: function () {\n this.sendSystemMessage('remote_muted_request');\n },\n __sendMuteStatus: function () {\n this.sendSystemMessage('remote_muted', {\n type: 'video',\n value: room.isVideoMuted\n });\n this.sendSystemMessage('remote_muted', {\n type: 'audio',\n value: room.isAudioMuted\n });\n },\n $on: (key, callback, that) => {\n emitter.on(key, callback, that || this);\n room.on(key, callback, that || this);\n },\n $off: (key, callback, that) => {\n emitter.on(key, callback, that || this);\n room.on(key, callback, that || this);\n },\n $clear: function () {\n room.clear();\n emitter.clear();\n }\n };\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (roomSession);\n\n//# sourceURL=webpack://WatchTogetherSDK/./src/models/room-session.js?");
10057
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _modules_wt_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../modules/wt-utils */ \"./src/modules/wt-utils.js\");\n/* harmony import */ var _modules_wt_emitter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../modules/wt-emitter */ \"./src/modules/wt-emitter.js\");\n/* harmony import */ var _modules_sync_modules_sync_hls__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../modules/sync-modules/sync-hls */ \"./src/modules/sync-modules/sync-hls.js\");\n/* harmony import */ var _modules_sync_modules_sync_hls_vod__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../modules/sync-modules/sync-hls-vod */ \"./src/modules/sync-modules/sync-hls-vod.js\");\n/* harmony import */ var _modules_sync_modules_sync_native_hls_vod__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../modules/sync-modules/sync-native-hls-vod */ \"./src/modules/sync-modules/sync-native-hls-vod.js\");\n/* harmony import */ var _modules_sync_modules_sync_native_hls__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../modules/sync-modules/sync-native-hls */ \"./src/modules/sync-modules/sync-native-hls.js\");\n/* harmony import */ var _modules_sync_modules_sync_shaka_dash__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../modules/sync-modules/sync-shaka-dash */ \"./src/modules/sync-modules/sync-shaka-dash.js\");\n/* harmony import */ var _modules_sync_modules_sync_shaka_dash_vod__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../modules/sync-modules/sync-shaka-dash-vod */ \"./src/modules/sync-modules/sync-shaka-dash-vod.js\");\n/* harmony import */ var _modules_sync_modules_sync_dash__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../modules/sync-modules/sync-dash */ \"./src/modules/sync-modules/sync-dash.js\");\n/* harmony import */ var _modules_sync_modules_sync_dash_vod__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../modules/sync-modules/sync-dash-vod */ \"./src/modules/sync-modules/sync-dash-vod.js\");\n/* harmony import */ var _modules_sync_modules_sync_doris__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../modules/sync-modules/sync-doris */ \"./src/modules/sync-modules/sync-doris.js\");\n/* harmony import */ var _modules_sync_modules_sync_disabled__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../modules/sync-modules/sync-disabled */ \"./src/modules/sync-modules/sync-disabled.js\");\n/* harmony import */ var _modules_sync_modules_sync_dazn_dash__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../modules/sync-modules/sync-dazn-dash */ \"./src/modules/sync-modules/sync-dazn-dash.js\");\n/* harmony import */ var _modules_sync_modules_sync_dazn__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../modules/sync-modules/sync-dazn */ \"./src/modules/sync-modules/sync-dazn.js\");\n/* harmony import */ var _modules_sync_modules_sync_module__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../modules/sync-modules/sync-module */ \"./src/modules/sync-modules/sync-module.js\");\n\n\n\n\n\n// SYNCHRONISATION MODULES\n\n\n\n\n\n\n\n\n\n\n\n\n\nlet roomSession = function (_ref, room, wt) {\n let {\n roomId,\n pinHash,\n role\n } = _ref;\n let primaryRoomId = roomId;\n let publicCustomEvents = ['changePlayerSource', 'chatMessage', 'userUpdate', 'reconnecting', 'connecting', 'remoteMuted', 'scaling'];\n const addEvents = events => {\n publicCustomEvents = [...publicCustomEvents, ...events];\n };\n const removeEvents = events => {\n publicCustomEvents = publicCustomEvents.filter(ev => events.indexOf(ev) === -1);\n };\n const emitter = Object(_modules_wt_emitter__WEBPACK_IMPORTED_MODULE_1__[\"default\"])();\n let alpTimeoutId = null;\n let abortController = null;\n let ___; // return object\n\n room.on('addLocalParticipant', () => {\n // TODO: this doesnt seem to be fixable until we switch to different type of messaging\n // At some random case we don't get message back if we don't wait\n\n clearTimeout(alpTimeoutId);\n alpTimeoutId = setTimeout(() => {\n ___.__requestMuteStatus();\n }, 2000);\n });\n room.on('localMuted', _ref2 => {\n let {\n type,\n value\n } = _ref2;\n ___.sendSystemMessage('remote_muted', {\n type,\n value\n });\n });\n room.on('data', data => {\n ___.__parseDataEvents(data);\n });\n return ___ = {\n syncModule: null,\n playerInterface: null,\n get userId() {\n return room.userId;\n },\n get roomId() {\n return roomId;\n },\n get sessionId() {\n return room.sessionId;\n },\n get constructId() {\n return room.constructId;\n },\n kill: function () {\n clearTimeout(alpTimeoutId);\n this.detachPlayer();\n return room.destroy().finally(() => {\n this.$clear();\n return true;\n });\n },\n destroy: function () {\n return wt.room.destroySession(room.constructId);\n },\n iceRestart: function () {\n return room._iceRestart(room.handleId);\n },\n connect: function () {\n var _abortController;\n let {\n reactooRoomId = null\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n emitter.emit('connecting', true);\n clearTimeout(alpTimeoutId);\n abortController = new AbortController();\n return wt.room.__joinRoom({\n roomId: reactooRoomId || primaryRoomId,\n pinHash,\n role\n }, (_abortController = abortController) === null || _abortController === void 0 ? void 0 : _abortController.signal).then(roomData => {\n var _roomData$data;\n // Happens when we reroute user to a different room\n if ((roomData === null || roomData === void 0 ? void 0 : (_roomData$data = roomData.data) === null || _roomData$data === void 0 ? void 0 : _roomData$data.reactooRoomId) !== roomId) {\n roomId = roomData.data.reactooRoomId;\n emitter.emit('changeRoomId', roomId);\n }\n room.setRoomType(roomData.data.roomType);\n return room.connect(roomData.data.roomId, roomData.data.pin, roomData.data.href, roomData.data.iceServers, roomData.data.accessToken, roomData.data.display, roomData.data.userId, roomData.data.webrtcVersion, roomData.data.bitrate ? parseInt(roomData.data.bitrate) : 0, roomData.data.recordingFilename, roomData.data.simulcast, roomData.data.simulcastBitrates || {});\n }).finally(() => {\n emitter.emit('connecting', false);\n });\n },\n disconnect: function (dontWaitForResponses) {\n var _abortController2, _abortController2$abo;\n clearTimeout(alpTimeoutId);\n (_abortController2 = abortController) === null || _abortController2 === void 0 ? void 0 : (_abortController2$abo = _abortController2.abort) === null || _abortController2$abo === void 0 ? void 0 : _abortController2$abo.call(_abortController2);\n return room.disconnect(dontWaitForResponses);\n },\n //TODO: refactor restart method\n restart: function () {\n var _handle$webrtcStuff;\n let {\n isObserver = false,\n reactooRoomId = null\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n emitter.emit('reconnecting', true);\n room.isRestarting = true;\n let wasPublished = room.isPublished;\n let handle = room._getHandle(room.handleId);\n let stream = null;\n if (handle !== null && handle !== void 0 && (_handle$webrtcStuff = handle.webrtcStuff) !== null && _handle$webrtcStuff !== void 0 && _handle$webrtcStuff.stream && wasPublished) {\n stream = handle.webrtcStuff.stream;\n }\n return this.disconnect().then(() => Object(_modules_wt_utils__WEBPACK_IMPORTED_MODULE_0__[\"wait\"])(1000)) //TODO: remove 1000ms wait by waiting for proper events from janus\n .then(() => this.connect({\n reactooRoomId\n })).then(() => {\n if (isObserver) {\n return this.publishLocal(null);\n } else if (stream) {\n return this.publishLocal(stream);\n } else return Promise.resolve();\n }).then(() => {\n room.isRestarting = false;\n emitter.emit('reconnecting', false);\n return 1;\n }).catch(error => {\n room.isRestarting = false;\n emitter.emit('reconnecting', false);\n emitter.emit('error', {\n type: 'error',\n id: 26,\n message: 'reconnecting failed',\n data: error\n });\n return Promise.reject(0);\n });\n },\n getStats: function () {\n let type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n return room._getStats(type);\n },\n getRoomParticipants: function () {\n return room._participants;\n },\n __parseDataEvents: function () {\n let msg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n if (msg.videoroom === 'message') {\n if (msg.action === 'pending_shutdown' || msg.action === 'shutting_down') {\n emitter.emit('scaling');\n this.restart(); // current videoroom was reassigned to a different WebRTC instance\n } else if (msg.action === 'force_restart') {\n this.restart();\n } else if (msg.action === 'user_update_displayname' || msg.action === 'user_update_avatar' || msg.action === 'user_update_customattributes' || msg.action === 'user_update_privateattributes') {\n emitter.emit('userUpdate', msg.text);\n } else if (msg.action === 'bitrate_changed') {\n this.setBitrateCap(msg.text);\n } else if (msg.user_action === 'chat_message') {\n emitter.emit('chatMessage', msg);\n } else if (msg.user_action === 'remote_muted') {\n var _decodeJanusDisplay, _decodeJanusDisplay2;\n const fromUserId = (_decodeJanusDisplay = Object(_modules_wt_utils__WEBPACK_IMPORTED_MODULE_0__[\"decodeJanusDisplay\"])(msg.from)) === null || _decodeJanusDisplay === void 0 ? void 0 : _decodeJanusDisplay.userId;\n const ownUserId = (_decodeJanusDisplay2 = Object(_modules_wt_utils__WEBPACK_IMPORTED_MODULE_0__[\"decodeJanusDisplay\"])(room.userId)) === null || _decodeJanusDisplay2 === void 0 ? void 0 : _decodeJanusDisplay2.userId;\n if (fromUserId !== ownUserId) {\n var _decodeJanusDisplay3, _decodeJanusDisplay4;\n emitter.emit('remoteMuted', {\n role: (_decodeJanusDisplay3 = Object(_modules_wt_utils__WEBPACK_IMPORTED_MODULE_0__[\"decodeJanusDisplay\"])(msg.from)) === null || _decodeJanusDisplay3 === void 0 ? void 0 : _decodeJanusDisplay3.role,\n userId: (_decodeJanusDisplay4 = Object(_modules_wt_utils__WEBPACK_IMPORTED_MODULE_0__[\"decodeJanusDisplay\"])(msg.from)) === null || _decodeJanusDisplay4 === void 0 ? void 0 : _decodeJanusDisplay4.userId,\n ...(msg.text && JSON.parse(msg.text))\n });\n }\n } else if (msg.user_action === 'remote_muted_request') {\n var _decodeJanusDisplay5, _decodeJanusDisplay6;\n const fromUserId = (_decodeJanusDisplay5 = Object(_modules_wt_utils__WEBPACK_IMPORTED_MODULE_0__[\"decodeJanusDisplay\"])(msg.from)) === null || _decodeJanusDisplay5 === void 0 ? void 0 : _decodeJanusDisplay5.userId;\n const ownUserId = (_decodeJanusDisplay6 = Object(_modules_wt_utils__WEBPACK_IMPORTED_MODULE_0__[\"decodeJanusDisplay\"])(room.userId)) === null || _decodeJanusDisplay6 === void 0 ? void 0 : _decodeJanusDisplay6.userId;\n if (fromUserId !== ownUserId) {\n this.__sendMuteStatus();\n }\n }\n }\n },\n // DAZN interface\n renderPlayer: function (playerWrapper, fullscreenElement, roomId) {\n try {\n this.syncModule = Object(_modules_sync_modules_sync_dazn__WEBPACK_IMPORTED_MODULE_13__[\"default\"])({\n room,\n wt,\n roomSession: this,\n emitter\n });\n this.playerInterface = wt.__privates.playerFactory(playerWrapper, fullscreenElement, this.syncModule.getHandlers(), {\n roomId\n });\n this.syncModule.initialize({\n playerInterface: this.playerInterface\n });\n return true;\n } catch (e) {\n return false;\n }\n },\n attachPlayer: function (type, inputs) {\n this.detachPlayer();\n if (type === 'universal') {\n this.syncModule = Object(_modules_sync_modules_sync_module__WEBPACK_IMPORTED_MODULE_14__[\"default\"])({\n room,\n emitter\n });\n if (this.syncModule.__events) {\n addEvents(this.syncModule.__events);\n }\n this.syncModule.initialize(inputs);\n }\n\n // Everything below is for legacy player and will be removed in the future\n else if (type === 'hlsjs') {\n this.syncModule = Object(_modules_sync_modules_sync_hls__WEBPACK_IMPORTED_MODULE_2__[\"default\"])({\n room,\n wt,\n roomSession: this,\n emitter\n });\n if (this.syncModule.__events) {\n addEvents(this.syncModule.__events);\n }\n this.syncModule.initialize(inputs);\n } else if (type === 'hlsjs-vod') {\n this.syncModule = Object(_modules_sync_modules_sync_hls_vod__WEBPACK_IMPORTED_MODULE_3__[\"default\"])({\n room,\n wt,\n roomSession: this,\n emitter\n });\n if (this.syncModule.__events) {\n addEvents(this.syncModule.__events);\n }\n this.syncModule.initialize(inputs);\n } else if (type === 'hlsnative-vod') {\n this.syncModule = Object(_modules_sync_modules_sync_native_hls_vod__WEBPACK_IMPORTED_MODULE_4__[\"default\"])({\n room,\n wt,\n roomSession: this,\n emitter\n });\n if (this.syncModule.__events) {\n addEvents(this.syncModule.__events);\n }\n this.syncModule.initialize(inputs);\n } else if (type === 'hlsnative') {\n this.syncModule = Object(_modules_sync_modules_sync_native_hls__WEBPACK_IMPORTED_MODULE_5__[\"default\"])({\n room,\n wt,\n roomSession: this,\n emitter\n });\n if (this.syncModule.__events) {\n addEvents(this.syncModule.__events);\n }\n this.syncModule.initialize(inputs);\n } else if (type === 'shaka-dash-vod') {\n this.syncModule = Object(_modules_sync_modules_sync_shaka_dash_vod__WEBPACK_IMPORTED_MODULE_7__[\"default\"])({\n room,\n wt,\n roomSession: this,\n emitter\n });\n if (this.syncModule.__events) {\n addEvents(this.syncModule.__events);\n }\n this.syncModule.initialize(inputs);\n } else if (type === 'shaka-dash') {\n this.syncModule = Object(_modules_sync_modules_sync_shaka_dash__WEBPACK_IMPORTED_MODULE_6__[\"default\"])({\n room,\n wt,\n roomSession: this,\n emitter\n });\n if (this.syncModule.__events) {\n addEvents(this.syncModule.__events);\n }\n this.syncModule.initialize(inputs);\n } else if (type === 'dashjs') {\n this.syncModule = Object(_modules_sync_modules_sync_dash__WEBPACK_IMPORTED_MODULE_8__[\"default\"])({\n room,\n wt,\n roomSession: this,\n emitter\n });\n if (this.syncModule.__events) {\n addEvents(this.syncModule.__events);\n }\n this.syncModule.initialize(inputs);\n } else if (type === 'dashjs-vod') {\n this.syncModule = Object(_modules_sync_modules_sync_dash_vod__WEBPACK_IMPORTED_MODULE_9__[\"default\"])({\n room,\n wt,\n roomSession: this,\n emitter\n });\n if (this.syncModule.__events) {\n addEvents(this.syncModule.__events);\n }\n this.syncModule.initialize(inputs);\n } else if (type === 'doris') {\n this.syncModule = Object(_modules_sync_modules_sync_doris__WEBPACK_IMPORTED_MODULE_10__[\"default\"])({\n room,\n wt,\n roomSession: this,\n emitter\n });\n if (this.syncModule.__events) {\n addEvents(this.syncModule.__events);\n }\n this.syncModule.initialize(inputs);\n } else if (type === 'dazn-dash') {\n this.syncModule = Object(_modules_sync_modules_sync_dazn_dash__WEBPACK_IMPORTED_MODULE_12__[\"default\"])({\n room,\n wt,\n roomSession: this,\n emitter\n });\n if (this.syncModule.__events) {\n addEvents(this.syncModule.__events);\n }\n this.syncModule.initialize(inputs);\n } else if (type === 'disabled') {\n this.syncModule = Object(_modules_sync_modules_sync_disabled__WEBPACK_IMPORTED_MODULE_11__[\"default\"])({\n room,\n wt,\n roomSession: this,\n emitter\n });\n if (this.syncModule.__events) {\n addEvents(this.syncModule.__events);\n }\n this.syncModule.initialize(inputs);\n } else {\n room._log('Synchronisation type not recognised');\n }\n },\n detachPlayer: function () {\n if (this.syncModule) {\n this.playerInterface = null;\n this.syncModule.destroy();\n if (this.syncModule.__events) {\n removeEvents(this.syncModule.__events);\n }\n this.syncModule = null;\n }\n },\n publishLocal: function () {\n let stream = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n return room.publishLocal(stream);\n },\n unpublishLocal: () => {\n return room.unpublishLocal();\n },\n toggleAudio: value => {\n return room.toggleAudio(value);\n },\n toggleVideo: () => {\n return room.toggleVideo();\n },\n selectSubStream: (handleId, substream) => {\n return room.selectSubStream(handleId, substream);\n },\n setBitrateCap: bitrate => {\n if (role === 'host') {\n return;\n }\n return room.sendMessage(room.handleId, {\n \"body\": {\n \"request\": \"configure\",\n \"bitrate\": parseInt(bitrate)\n }\n }).catch(() => null);\n },\n sendSystemMessage: function (action) {\n let value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n let to = arguments.length > 2 ? arguments[2] : undefined;\n let set_master = arguments.length > 3 ? arguments[3] : undefined;\n return room.sendMessage(room.handleId, {\n body: {\n action,\n request: \"message\",\n room: room.roomId,\n timestamp: new Date().getTime(),\n text: JSON.stringify(value),\n ...(to && Array.isArray(to) ? {\n tos: to\n } : {\n to\n }),\n ...(set_master && {\n set_master\n })\n }\n });\n },\n sendChatMessage: (text, to) => {\n return room.sendMessage(room.handleId, {\n body: {\n action: \"chat_message\",\n request: \"message\",\n room: room.roomId,\n timestamp: new Date().getTime(),\n text,\n ...(to && Array.isArray(to) ? {\n tos: to\n } : {\n to\n })\n }\n });\n },\n __requestMuteStatus: function () {\n this.sendSystemMessage('remote_muted_request');\n },\n __sendMuteStatus: function () {\n this.sendSystemMessage('remote_muted', {\n type: 'video',\n value: room.isVideoMuted\n });\n this.sendSystemMessage('remote_muted', {\n type: 'audio',\n value: room.isAudioMuted\n });\n },\n $on: (key, callback, that) => {\n emitter.on(key, callback, that || this);\n room.on(key, callback, that || this);\n },\n $off: (key, callback, that) => {\n emitter.on(key, callback, that || this);\n room.on(key, callback, that || this);\n },\n $clear: function () {\n room.clear();\n emitter.clear();\n }\n };\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (roomSession);\n\n//# sourceURL=webpack://WatchTogetherSDK/./src/models/room-session.js?");
10058
10058
 
10059
10059
  /***/ }),
10060
10060
 
@@ -10066,7 +10066,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _mod
10066
10066
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
10067
10067
 
10068
10068
  "use strict";
10069
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _room_session__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./room-session */ \"./src/models/room-session.js\");\n/* harmony import */ var _streaming_session__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./streaming-session */ \"./src/models/streaming-session.js\");\n/* harmony import */ var _modules_wt_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../modules/wt-utils */ \"./src/modules/wt-utils.js\");\n\n\n\n\n\nlet room = function () {\n var _this = this;\n let roomSessions = [];\n let setExitListeners = () => {\n window.addEventListener('pagehide', event => {\n if (!event.persisted) {\n this.room.destroySessions();\n }\n });\n window.addEventListener('beforeunload', () => {\n this.room.destroySessions();\n });\n };\n setExitListeners();\n return {\n //TODO:deprecated\n integration: function () {\n let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _this.__privates.auth.__client.then(client => client.apis.system.integration({\n type: _this.__instanceType\n }, {\n requestBody: {\n ...data\n },\n requestInterceptor: req => {\n if (!req.headers) {\n req.headers = {};\n }\n req.headers['Authorization'] = 'Bearer ' + localStorage.getItem('rwt_idToken');\n return req;\n }\n }));\n },\n //TODO:deprecated\n getAnalytics: function () {\n let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _this.__privates.auth.__client.then(client => client.apis.system.getAnalytics({\n instanceType: _this.__instanceType,\n ...data\n }));\n },\n sendChatMessage: _ref => {\n let {\n roomId,\n message,\n options,\n senderUserId\n } = _ref;\n return this.__privates.auth.__client.then(client => client.apis.wt.sendRoomMessage({}, {\n requestBody: {\n roomId,\n message,\n options,\n senderUserId\n }\n }));\n },\n createRoom: function () {\n let {\n title,\n description,\n isPublic,\n isRouter,\n isStudioLayout,\n wtChannelId,\n isHd,\n disableSync,\n reduceRoomControls,\n hasStudioChat,\n maxParticipants,\n customAttributes,\n chatRoomId,\n linkedRoomId,\n type,\n dotAttribute\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n let _da = dotAttribute ? Array.isArray(dotAttribute) ? dotAttribute.reduce((p, cv) => (p[cv.name] = cv.value) && p || p, {}) : {\n [dotAttribute.name]: dotAttribute.value\n } : {};\n return _this.__privates.auth.__client.then(client => client.apis.wt.createRoom({}, {\n requestBody: {\n title,\n description,\n isRouter,\n isPublic,\n isStudioLayout,\n wtChannelId,\n isHd,\n disableSync,\n reduceRoomControls,\n chatRoomId,\n linkedRoomId,\n hasStudioChat,\n maxParticipants,\n type,\n customAttributes,\n ..._da,\n instanceType: _this.__instanceType\n }\n }));\n },\n updateRoom: function () {\n let {\n roomId,\n title,\n description,\n isPublic,\n isRouter,\n recordings,\n slug,\n password,\n maxParticipants,\n setInstanceType = false,\n wtChannelId,\n isHd,\n isStudioLayout,\n hasStudioChat,\n reduceRoomControls,\n chatRoomId,\n linkedRoomId,\n type,\n disableSync,\n defaultRegion,\n customAttributes,\n dotAttribute\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n let _da = dotAttribute ? Array.isArray(dotAttribute) ? dotAttribute.reduce((p, cv) => (p[cv.name] = cv.value) && p || p, {}) : {\n [dotAttribute.name]: dotAttribute.value\n } : {};\n return _this.__privates.auth.__client.then(client => client.apis.wt.updateRoom({\n id: roomId\n }, {\n requestBody: {\n title,\n description,\n slug,\n password,\n isPublic,\n isRouter,\n isHd,\n isStudioLayout,\n hasStudioChat,\n maxParticipants,\n reduceRoomControls,\n chatRoomId,\n linkedRoomId,\n type,\n disableSync,\n defaultRegion,\n customAttributes,\n wtChannelId,\n ..._da,\n ...(setInstanceType && {\n instanceType: setInstanceType === true ? _this.__instanceType : setInstanceType\n }),\n ...(recordings && {\n recordings\n })\n }\n }));\n },\n deleteRoom: roomId => {\n return this.__privates.auth.__client.then(client => client.apis.wt.deleteRoom({\n id: roomId\n }));\n },\n leaveRoom: roomId => {\n return this.__privates.auth.__client.then(client => client.apis.wt.leave({\n roomId\n }));\n },\n updateLayout: _ref2 => {\n let {\n roomId,\n operation,\n name,\n attributeName,\n value,\n target\n } = _ref2;\n //operation : clearLayouts, setLayout, setLayouts, unsetLayout, setName, setTarget, setStyle, setAttribute, unsetAttribute,'sendMessage'\n\n return this.__privates.auth.__client.then(client => client.apis.wt.updateLayout({}, {\n requestBody: {\n roomId,\n operation,\n name,\n attributeName,\n value,\n target\n }\n }));\n },\n getInviteUrl: (roomId, domain, url) => {\n return this.__privates.auth.__client.then(client => client.apis.wt.invite({}, {\n requestBody: {\n roomId,\n domain: domain || location.host,\n url: url || location.href\n }\n }));\n },\n getRoomChatList: function () {\n let {\n roomId,\n type = \"normal\",\n size = 50,\n startKey = null\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n let apiParams = {\n roomId,\n type,\n size,\n ...(startKey && {\n startKey\n })\n };\n return _this.__privates.auth.__client.then(client => client.apis.wt.getRoomChatList(apiParams));\n },\n getRoomsList: function () {\n let {\n type = 'participant',\n activeOnly = null,\n instanceType = _this.__instanceType,\n size = 20,\n startKey = null,\n includeWtEventModels = false,\n demo = false,\n viewType = 'list',\n wtChannelId = undefined\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n let apiParams = {\n type,\n instanceType,\n size,\n includeWtEventModels,\n demo,\n viewType,\n ...(wtChannelId && {\n wtChannelId\n }),\n ...(activeOnly && {\n activeOnly\n }),\n ...(startKey && {\n startKey\n })\n };\n return _this.__privates.auth.__client.then(client => client.apis.wt.getRoomList(apiParams));\n },\n setUser: _ref3 => {\n let {\n messageId,\n userId,\n roomId,\n flag,\n timestamp,\n option\n } = _ref3;\n //leave, kick, ban, unban, approve, report\n return this.__privates.auth.__client.then(client => client.apis.wt.setUser({\n messageId,\n userId,\n roomId,\n flag,\n timestamp,\n option\n }));\n },\n getRoomById: function (id) {\n let pinHash = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;\n let showPublic = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;\n let demo = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n let signal = arguments.length > 4 ? arguments[4] : undefined;\n return _this.__privates.auth.__client.then(client => client.apis.wt.getRoom({\n id,\n pinHash,\n \"public\": showPublic,\n demo\n }, {\n ...(signal ? {\n requestInterceptor: req => {\n req.signal = signal;\n return req;\n }\n } : {})\n }));\n },\n getRoomBySlug: function (slug) {\n let password = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;\n let showPublic = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;\n let demo = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n return _this.__privates.auth.__client.then(client => client.apis.wt.getRoom({\n slug,\n password,\n \"public\": showPublic,\n demo\n }));\n },\n roomRecorder: function () {\n let {\n roomId,\n operation = 'get',\n config,\n outputs,\n destinationIds\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _this.__privates.auth.__client.then(client => client.apis.wt.recordRoom({}, {\n requestBody: {\n roomId,\n operation,\n config,\n outputs,\n destinationIds\n }\n }));\n },\n __joinRoom: function () {\n let {\n roomId,\n pinHash,\n instanceType = _this.__instanceType,\n role = 'participant',\n customBearer = undefined\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n let signal = arguments.length > 1 ? arguments[1] : undefined;\n return _this.__privates.auth.__client.then(client => client.apis.wt.join({\n roomId,\n pinHash,\n instanceType,\n role,\n platform: _this.browser === 'firefox' ? 'web-firefox' : 'web'\n }, {\n ...(signal ? {\n requestInterceptor: req => {\n req.signal = signal;\n return req;\n }\n } : {})\n }));\n },\n isSafariSupported: () => {\n return this.__privates.room.safariVp8;\n },\n isWebrtcSupported: () => {\n return this.__privates.room.isWebrtcSupported;\n },\n createStreamingSession: function () {\n let {\n constructId,\n roomId,\n pinHash,\n streamId,\n href,\n iceServers,\n accessToken\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _this.__privates.room.whenInitialized.then(lib => _streaming_session__WEBPACK_IMPORTED_MODULE_1__[\"default\"].call(_this, {\n roomId,\n pinHash,\n streamId,\n href,\n iceServers,\n accessToken\n }, lib.createSession(constructId, 'streaming'), _this)).then(newSession => {\n let existingSessionIndex = roomSessions.findIndex(session => session.constructId === newSession.constructId);\n if (existingSessionIndex > -1) {\n return _this.room.destroySession(newSession.constructId).then(() => {\n roomSessions.push(newSession);\n return newSession;\n });\n } else {\n roomSessions.push(newSession);\n return newSession;\n }\n });\n },\n createSession: _ref4 => {\n let {\n constructId,\n roomId,\n pinHash,\n role,\n options\n } = _ref4;\n return this.__privates.room.whenInitialized.then(lib => _room_session__WEBPACK_IMPORTED_MODULE_0__[\"default\"].call(this, {\n roomId,\n pinHash,\n role\n }, lib.createSession(constructId, 'reactooroom', options), this)).then(newSession => {\n let existingSessionIndex = roomSessions.findIndex(session => session.constructId === newSession.constructId);\n if (existingSessionIndex > -1) {\n return this.room.destroySession(newSession.constructId).then(() => {\n roomSessions.push(newSession);\n return newSession;\n });\n } else {\n roomSessions.push(newSession);\n return newSession;\n }\n });\n },\n getSessions: () => {\n return roomSessions;\n },\n getSessionByConstructId: constructId => {\n return roomSessions.find(session => session.constructId === constructId) || null;\n },\n getSessionBySessionId: sessionId => {\n return roomSessions.find(session => session.sessionId === sessionId) || null;\n },\n getSessionByRoomId: roomId => {\n return roomSessions.find(session => session.roomId === roomId) || null;\n },\n getSessionByUserId: userId => {\n return roomSessions.find(session => {\n var _decodeJanusDisplay;\n return ((_decodeJanusDisplay = Object(_modules_wt_utils__WEBPACK_IMPORTED_MODULE_2__[\"decodeJanusDisplay\"])(session.userId)) === null || _decodeJanusDisplay === void 0 ? void 0 : _decodeJanusDisplay.userId) === userId;\n }) || null;\n },\n getSessionByStreamId: streamId => {\n return roomSessions.find(session => session.streamId === streamId) || null;\n },\n destroySession: constructId => {\n let sessionIndex = roomSessions.findIndex(session => session.constructId === constructId);\n if (sessionIndex > -1) {\n return roomSessions[sessionIndex].destroy().finally(() => {\n roomSessions.splice(sessionIndex, 1);\n return true;\n });\n }\n return Promise.resolve();\n },\n destroySessionBySessionId: sessionId => {\n let sessionIndex = roomSessions.findIndex(session => session.sessionId === sessionId);\n if (sessionIndex > -1) {\n return roomSessions[sessionIndex].destroy().finally(() => {\n roomSessions.splice(sessionIndex, 1);\n return true;\n });\n }\n return Promise.resolve();\n },\n destroySessions: () => {\n roomSessions.forEach(session => session.destroy().catch(e => this.log(e)));\n roomSessions.length = 0;\n },\n queue: function () {\n let {\n roomId,\n operation,\n userId\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n //Enum: \"status\" \"join\" \"approve\" \"reject\" \"block\" \"unblock\"\n return _this.__privates.auth.__client.then(client => client.apis.wt.queue({}, {\n requestBody: {\n roomId,\n operation,\n userId\n }\n }));\n },\n getDefaultRegions: () => {\n return this.__privates.auth.__client.then(client => {\n var _client$spec, _client$spec$componen, _client$spec$componen2, _client$spec$componen3, _client$spec$componen4, _client$spec$componen5;\n return [...(((_client$spec = client.spec) === null || _client$spec === void 0 ? void 0 : (_client$spec$componen = _client$spec.components) === null || _client$spec$componen === void 0 ? void 0 : (_client$spec$componen2 = _client$spec$componen.schemas) === null || _client$spec$componen2 === void 0 ? void 0 : (_client$spec$componen3 = _client$spec$componen2.WtRoom) === null || _client$spec$componen3 === void 0 ? void 0 : (_client$spec$componen4 = _client$spec$componen3.properties) === null || _client$spec$componen4 === void 0 ? void 0 : (_client$spec$componen5 = _client$spec$componen4.defaultRegion) === null || _client$spec$componen5 === void 0 ? void 0 : _client$spec$componen5.enum) || [''])];\n });\n }\n };\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (room);\n\n//# sourceURL=webpack://WatchTogetherSDK/./src/models/room.js?");
10069
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _room_session__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./room-session */ \"./src/models/room-session.js\");\n/* harmony import */ var _streaming_session__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./streaming-session */ \"./src/models/streaming-session.js\");\n/* harmony import */ var _modules_wt_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../modules/wt-utils */ \"./src/modules/wt-utils.js\");\n\n\n\n\n\nlet room = function () {\n var _this = this;\n let roomSessions = [];\n let setExitListeners = () => {\n window.addEventListener('pagehide', event => {\n if (!event.persisted) {\n this.room.destroySessions();\n }\n });\n window.addEventListener('beforeunload', () => {\n this.room.destroySessions();\n });\n };\n setExitListeners();\n return {\n //TODO:deprecated\n integration: function () {\n let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _this.__privates.auth.__client.then(client => client.apis.system.integration({\n type: _this.__instanceType\n }, {\n requestBody: {\n ...data\n },\n requestInterceptor: req => {\n if (!req.headers) {\n req.headers = {};\n }\n req.headers['Authorization'] = 'Bearer ' + localStorage.getItem('rwt_idToken');\n return req;\n }\n }));\n },\n //TODO:deprecated\n getAnalytics: function () {\n let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _this.__privates.auth.__client.then(client => client.apis.system.getAnalytics({\n instanceType: _this.__instanceType,\n ...data\n }));\n },\n sendChatMessage: _ref => {\n let {\n roomId,\n message,\n options,\n senderUserId\n } = _ref;\n return this.__privates.auth.__client.then(client => client.apis.wt.sendRoomMessage({}, {\n requestBody: {\n roomId,\n message,\n options,\n senderUserId\n }\n }));\n },\n createRoom: function () {\n let {\n title,\n description,\n isPublic,\n isRouter,\n isStudioLayout,\n wtChannelId,\n isHd,\n disableSync,\n reduceRoomControls,\n hasStudioChat,\n maxParticipants,\n customAttributes,\n chatRoomId,\n linkedRoomId,\n type,\n dotAttribute\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n let _da = dotAttribute ? Array.isArray(dotAttribute) ? dotAttribute.reduce((p, cv) => (p[cv.name] = cv.value) && p || p, {}) : {\n [dotAttribute.name]: dotAttribute.value\n } : {};\n return _this.__privates.auth.__client.then(client => client.apis.wt.createRoom({}, {\n requestBody: {\n title,\n description,\n isRouter,\n isPublic,\n isStudioLayout,\n wtChannelId,\n isHd,\n disableSync,\n reduceRoomControls,\n chatRoomId,\n linkedRoomId,\n hasStudioChat,\n maxParticipants,\n type,\n customAttributes,\n ..._da,\n instanceType: _this.__instanceType\n }\n }));\n },\n updateRoom: function () {\n let {\n roomId,\n title,\n description,\n isPublic,\n isRouter,\n recordings,\n slug,\n password,\n maxParticipants,\n setInstanceType = false,\n wtChannelId,\n isHd,\n isStudioLayout,\n hasStudioChat,\n reduceRoomControls,\n chatRoomId,\n linkedRoomId,\n type,\n disableSync,\n defaultRegion,\n customAttributes,\n dotAttribute\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n let _da = dotAttribute ? Array.isArray(dotAttribute) ? dotAttribute.reduce((p, cv) => (p[cv.name] = cv.value) && p || p, {}) : {\n [dotAttribute.name]: dotAttribute.value\n } : {};\n return _this.__privates.auth.__client.then(client => client.apis.wt.updateRoom({\n id: roomId\n }, {\n requestBody: {\n title,\n description,\n slug,\n password,\n isPublic,\n isRouter,\n isHd,\n isStudioLayout,\n hasStudioChat,\n maxParticipants,\n reduceRoomControls,\n chatRoomId,\n linkedRoomId,\n type,\n disableSync,\n defaultRegion,\n customAttributes,\n wtChannelId,\n ..._da,\n ...(setInstanceType && {\n instanceType: setInstanceType === true ? _this.__instanceType : setInstanceType\n }),\n ...(recordings && {\n recordings\n })\n }\n }));\n },\n deleteRoom: roomId => {\n return this.__privates.auth.__client.then(client => client.apis.wt.deleteRoom({\n id: roomId\n }));\n },\n leaveRoom: roomId => {\n return this.__privates.auth.__client.then(client => client.apis.wt.leave({\n roomId\n }));\n },\n updateLayout: _ref2 => {\n let {\n roomId,\n operation,\n name,\n attributeName,\n value,\n target\n } = _ref2;\n //operation : clearLayouts, setLayout, setLayouts, unsetLayout, setName, setTarget, setStyle, setAttribute, unsetAttribute,'sendMessage'\n\n return this.__privates.auth.__client.then(client => client.apis.wt.updateLayout({}, {\n requestBody: {\n roomId,\n operation,\n name,\n attributeName,\n value,\n target\n }\n }));\n },\n getInviteUrl: (roomId, domain, url) => {\n return this.__privates.auth.__client.then(client => client.apis.wt.invite({}, {\n requestBody: {\n roomId,\n domain: domain || location.host,\n url: url || location.href\n }\n }));\n },\n getRoomChatList: function () {\n let {\n roomId,\n type = \"normal\",\n size = 50,\n startKey = null\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n let apiParams = {\n roomId,\n type,\n size,\n ...(startKey && {\n startKey\n })\n };\n return _this.__privates.auth.__client.then(client => client.apis.wt.getRoomChatList(apiParams));\n },\n getRoomsList: function () {\n let {\n type = 'participant',\n activeOnly = null,\n instanceType = _this.__instanceType,\n size = 20,\n startKey = null,\n includeWtEventModels = false,\n demo = false,\n viewType = 'list',\n wtChannelId = undefined\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n let apiParams = {\n type,\n instanceType,\n size,\n includeWtEventModels,\n demo,\n viewType,\n ...(wtChannelId && {\n wtChannelId\n }),\n ...(activeOnly && {\n activeOnly\n }),\n ...(startKey && {\n startKey\n })\n };\n return _this.__privates.auth.__client.then(client => client.apis.wt.getRoomList(apiParams));\n },\n setUser: _ref3 => {\n let {\n messageId,\n userId,\n roomId,\n flag,\n timestamp,\n option\n } = _ref3;\n //leave, kick, ban, unban, approve, report\n return this.__privates.auth.__client.then(client => client.apis.wt.setUser({\n messageId,\n userId,\n roomId,\n flag,\n timestamp,\n option\n }));\n },\n getRoomById: function (id) {\n let pinHash = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;\n let showPublic = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;\n let demo = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n let signal = arguments.length > 4 ? arguments[4] : undefined;\n return _this.__privates.auth.__client.then(client => client.apis.wt.getRoom({\n id,\n pinHash,\n \"public\": showPublic,\n demo\n }, {\n ...(signal ? {\n requestInterceptor: req => {\n req.signal = signal;\n return req;\n }\n } : {})\n }));\n },\n getRoomBySlug: function (slug) {\n let password = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;\n let showPublic = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;\n let demo = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n return _this.__privates.auth.__client.then(client => client.apis.wt.getRoom({\n slug,\n password,\n \"public\": showPublic,\n demo\n }));\n },\n roomRecorder: function () {\n let {\n roomId,\n operation = 'get',\n config,\n outputs,\n destinationIds\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _this.__privates.auth.__client.then(client => client.apis.wt.recordRoom({}, {\n requestBody: {\n roomId,\n operation,\n config,\n outputs,\n destinationIds\n }\n }));\n },\n __joinRoom: function () {\n let {\n roomId,\n pinHash,\n instanceType = _this.__instanceType,\n role = 'participant',\n customBearer = undefined\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n let signal = arguments.length > 1 ? arguments[1] : undefined;\n return _this.__privates.auth.__client.then(client => client.apis.wt.join({\n roomId,\n pinHash,\n instanceType,\n role,\n platform: _this.browser === 'firefox' ? 'web-firefox' : 'web'\n }, {\n ...(signal ? {\n requestInterceptor: req => {\n req.signal = signal;\n return req;\n }\n } : {})\n }));\n },\n isSafariSupported: () => {\n return this.__privates.room.safariVp8;\n },\n isWebrtcSupported: () => {\n return this.__privates.room.isWebrtcSupported;\n },\n createStreamingSession: function () {\n let {\n constructId,\n roomId,\n pinHash,\n streamId,\n href,\n iceServers,\n accessToken\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _this.__privates.room.whenInitialized.then(lib => _streaming_session__WEBPACK_IMPORTED_MODULE_1__[\"default\"].call(_this, {\n roomId,\n pinHash,\n streamId,\n href,\n iceServers,\n accessToken\n }, lib.createSession(constructId, 'streaming'), _this)).then(newSession => {\n let existingSessionIndex = roomSessions.findIndex(session => session.constructId === newSession.constructId);\n if (existingSessionIndex > -1) {\n return _this.room.destroySession(newSession.constructId).then(() => {\n roomSessions.push(newSession);\n return newSession;\n });\n } else {\n roomSessions.push(newSession);\n return newSession;\n }\n });\n },\n createSession: _ref4 => {\n let {\n constructId,\n roomId,\n pinHash,\n role,\n options\n } = _ref4;\n return this.__privates.room.whenInitialized.then(lib => _room_session__WEBPACK_IMPORTED_MODULE_0__[\"default\"].call(this, {\n roomId,\n pinHash,\n role\n }, lib.createSession(constructId, 'reactooroom', options), this)).then(newSession => {\n let existingSessionIndex = roomSessions.findIndex(session => session.constructId === newSession.constructId);\n if (existingSessionIndex > -1) {\n return this.room.destroySession(newSession.constructId).then(() => {\n roomSessions.push(newSession);\n return newSession;\n });\n } else {\n roomSessions.push(newSession);\n return newSession;\n }\n });\n },\n getSessions: () => {\n return roomSessions;\n },\n getSessionByConstructId: constructId => {\n return roomSessions.find(session => session.constructId === constructId) || null;\n },\n getSessionBySessionId: sessionId => {\n return roomSessions.find(session => session.sessionId === sessionId) || null;\n },\n getSessionByRoomId: roomId => {\n return roomSessions.find(session => session.roomId === roomId) || null;\n },\n getSessionByUserId: userId => {\n return roomSessions.find(session => {\n var _decodeJanusDisplay;\n return ((_decodeJanusDisplay = Object(_modules_wt_utils__WEBPACK_IMPORTED_MODULE_2__[\"decodeJanusDisplay\"])(session.userId)) === null || _decodeJanusDisplay === void 0 ? void 0 : _decodeJanusDisplay.userId) === userId;\n }) || null;\n },\n getSessionByStreamId: streamId => {\n return roomSessions.find(session => session.streamId === streamId) || null;\n },\n destroySession: constructId => {\n let sessionIndex = roomSessions.findIndex(session => session.constructId === constructId);\n if (sessionIndex > -1) {\n return roomSessions[sessionIndex].kill().finally(() => {\n roomSessions.splice(sessionIndex, 1);\n return true;\n });\n }\n return Promise.resolve();\n },\n destroySessionBySessionId: sessionId => {\n let sessionIndex = roomSessions.findIndex(session => session.sessionId === sessionId);\n if (sessionIndex > -1) {\n return roomSessions[sessionIndex].kill().finally(() => {\n roomSessions.splice(sessionIndex, 1);\n return true;\n });\n }\n return Promise.resolve();\n },\n destroySessions: () => {\n roomSessions.forEach(session => session.destroy().catch(e => this.log(e)));\n roomSessions.length = 0;\n },\n queue: function () {\n let {\n roomId,\n operation,\n userId\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n //Enum: \"status\" \"join\" \"approve\" \"reject\" \"block\" \"unblock\"\n return _this.__privates.auth.__client.then(client => client.apis.wt.queue({}, {\n requestBody: {\n roomId,\n operation,\n userId\n }\n }));\n },\n getDefaultRegions: () => {\n return this.__privates.auth.__client.then(client => {\n var _client$spec, _client$spec$componen, _client$spec$componen2, _client$spec$componen3, _client$spec$componen4, _client$spec$componen5;\n return [...(((_client$spec = client.spec) === null || _client$spec === void 0 ? void 0 : (_client$spec$componen = _client$spec.components) === null || _client$spec$componen === void 0 ? void 0 : (_client$spec$componen2 = _client$spec$componen.schemas) === null || _client$spec$componen2 === void 0 ? void 0 : (_client$spec$componen3 = _client$spec$componen2.WtRoom) === null || _client$spec$componen3 === void 0 ? void 0 : (_client$spec$componen4 = _client$spec$componen3.properties) === null || _client$spec$componen4 === void 0 ? void 0 : (_client$spec$componen5 = _client$spec$componen4.defaultRegion) === null || _client$spec$componen5 === void 0 ? void 0 : _client$spec$componen5.enum) || [''])];\n });\n }\n };\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (room);\n\n//# sourceURL=webpack://WatchTogetherSDK/./src/models/room.js?");
10070
10070
 
10071
10071
  /***/ }),
10072
10072
 
@@ -10078,7 +10078,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _roo
10078
10078
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
10079
10079
 
10080
10080
  "use strict";
10081
- eval("__webpack_require__.r(__webpack_exports__);\n\n\nlet streamingSession = function () {\n let {\n roomId,\n pinHash,\n streamId,\n href,\n iceServers,\n accessToken\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n let room = arguments.length > 1 ? arguments[1] : undefined;\n let wt = arguments.length > 2 ? arguments[2] : undefined;\n let ___;\n return ___ = {\n get userId() {\n return room.userId;\n },\n get roomId() {\n return roomId;\n },\n get sessionId() {\n return room.sessionId;\n },\n get constructId() {\n return room.constructId;\n },\n destroy: function () {\n return wt.room.destroySession(room.constructId).finally(() => {\n this.$clear();\n return true;\n });\n },\n connect: function () {\n if (roomId) {\n return Promise.all([wt.room.getRoomById(roomId, pinHash), wt.user.getUserSelf()]).then(_ref => {\n let [roomData, r] = _ref;\n return room.startStream(roomData.data.wtChannel.streamId, roomData.data.wtChannel.href, roomData.data.wtChannel.iceServers, roomData.data.wtChannel.accessToken, r.data._id);\n });\n } else if (href) {\n return wt.user.getUserSelf().then(r => room.startStream(streamId, href, iceServers, accessToken, r.data._id));\n } else return Promise.reject('Bad Input');\n },\n disconnect: function () {\n return room.stopStream();\n },\n $on: (key, callback, that) => {\n return room.on(key, callback, that || this);\n },\n $off: (key, callback, that) => {\n return room.off(key, callback, that || this);\n },\n $clear: function () {\n room.clear();\n }\n };\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (streamingSession);\n\n//# sourceURL=webpack://WatchTogetherSDK/./src/models/streaming-session.js?");
10081
+ eval("__webpack_require__.r(__webpack_exports__);\n\n\nlet streamingSession = function () {\n let {\n roomId,\n pinHash,\n streamId,\n href,\n iceServers,\n accessToken\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n let room = arguments.length > 1 ? arguments[1] : undefined;\n let wt = arguments.length > 2 ? arguments[2] : undefined;\n let ___;\n return ___ = {\n get userId() {\n return room.userId;\n },\n get roomId() {\n return roomId;\n },\n get sessionId() {\n return room.sessionId;\n },\n get constructId() {\n return room.constructId;\n },\n kill: function () {\n return room.destroy().finally(() => {\n this.$clear();\n return true;\n });\n },\n destroy: function () {\n return wt.room.destroySession(room.constructId);\n },\n connect: function () {\n if (roomId) {\n return Promise.all([wt.room.getRoomById(roomId, pinHash), wt.user.getUserSelf()]).then(_ref => {\n let [roomData, r] = _ref;\n return room.startStream(roomData.data.wtChannel.streamId, roomData.data.wtChannel.href, roomData.data.wtChannel.iceServers, roomData.data.wtChannel.accessToken, r.data._id);\n });\n } else if (href) {\n return wt.user.getUserSelf().then(r => room.startStream(streamId, href, iceServers, accessToken, r.data._id));\n } else return Promise.reject('Bad Input');\n },\n disconnect: function () {\n return room.stopStream();\n },\n $on: (key, callback, that) => {\n return room.on(key, callback, that || this);\n },\n $off: (key, callback, that) => {\n return room.off(key, callback, that || this);\n },\n $clear: function () {\n room.clear();\n }\n };\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (streamingSession);\n\n//# sourceURL=webpack://WatchTogetherSDK/./src/models/streaming-session.js?");
10082
10082
 
10083
10083
  /***/ }),
10084
10084