@reactoo/watchtogether-sdk-js 2.8.0-beta.1 → 2.8.0-beta.3
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 +48103 -47969
- package/dist/watchtogether-sdk.js.map +1 -1
- package/dist/watchtogether-sdk.min.js +2 -2
- package/example/index.html +5 -0
- package/package.json +1 -1
- package/src/modules/wt-room-sfu.js +7 -5
package/example/index.html
CHANGED
|
@@ -559,6 +559,11 @@
|
|
|
559
559
|
})
|
|
560
560
|
}
|
|
561
561
|
|
|
562
|
+
window.getUserTalkIntercomChannels = function (id) {
|
|
563
|
+
let ch = Instance.room.getSessionByConstructId(constructId)?.getUserTalkIntercomChannels(id);
|
|
564
|
+
console.log(ch);
|
|
565
|
+
}
|
|
566
|
+
|
|
562
567
|
window.setListenIntercomChannels = function(groups) {
|
|
563
568
|
Instance.room.getSessionByConstructId(constructId).setListenIntercomChannels(groups)
|
|
564
569
|
}
|
package/package.json
CHANGED
|
@@ -2144,9 +2144,10 @@ class RoomSession {
|
|
|
2144
2144
|
|
|
2145
2145
|
event.streams[0].onremovetrack = (ev) => {
|
|
2146
2146
|
|
|
2147
|
-
this._log('Remote track removed', ev);
|
|
2148
|
-
|
|
2149
2147
|
const trackIndex = config?.tracks?.findIndex(t => t.id === ev.track.id);
|
|
2148
|
+
|
|
2149
|
+
this._log('Remote track removed', ev, trackIndex);
|
|
2150
|
+
|
|
2150
2151
|
if(trackIndex > -1) {
|
|
2151
2152
|
config.tracks.splice(trackIndex, 1);
|
|
2152
2153
|
}
|
|
@@ -2202,10 +2203,11 @@ class RoomSession {
|
|
|
2202
2203
|
return;
|
|
2203
2204
|
|
|
2204
2205
|
event.track.onended = (ev) => {
|
|
2205
|
-
this._log('Remote track ended', ev);
|
|
2206
2206
|
|
|
2207
2207
|
const trackIndex = config?.tracks?.findIndex(t => t.id === ev.target.id);
|
|
2208
2208
|
|
|
2209
|
+
this._log('Remote track ended', ev, trackIndex);
|
|
2210
|
+
|
|
2209
2211
|
if(trackIndex > -1) {
|
|
2210
2212
|
config.tracks.splice(trackIndex, 1);
|
|
2211
2213
|
}
|
|
@@ -3089,14 +3091,14 @@ class RoomSession {
|
|
|
3089
3091
|
|
|
3090
3092
|
getUserTalkIntercomChannels(userId) {
|
|
3091
3093
|
let talkIntercomChannels = []
|
|
3092
|
-
let transceiver = this.#subscriberHandle.webrtcStuff.transceiverMap.find(t => t.
|
|
3094
|
+
let transceiver = this.#subscriberHandle.webrtcStuff.transceiverMap.find(t => t.feed_display && decodeJanusDisplay(t.feed_display)?.userId === userId && t.feed_description);
|
|
3093
3095
|
|
|
3094
3096
|
if(!transceiver) {
|
|
3095
3097
|
return talkIntercomChannels;
|
|
3096
3098
|
}
|
|
3097
3099
|
|
|
3098
3100
|
try {
|
|
3099
|
-
let description = JSON.parse(transceiver.
|
|
3101
|
+
let description = JSON.parse(transceiver.feed_description);
|
|
3100
3102
|
if(description.intercomGroups) {
|
|
3101
3103
|
description.intercomGroups.forEach(group => {
|
|
3102
3104
|
if(!talkIntercomChannels.includes(group)) {
|