Skip to content
This repository was archived by the owner on Oct 23, 2024. It is now read-only.

Commit 0f8bc0e

Browse files
authored
Fix VAD not working issue (#849)
* Fix VAD not working issue 780
1 parent 12d3099 commit 0f8bc0e

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

source/agent/conference/conference.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1893,14 +1893,22 @@ var Conference = function (rpcClient, selfRpcId) {
18931893
if ((room_id === roomId) && roomController) {
18941894
if (typeof target.view === 'string') {
18951895
const view = target.view;
1896+
const input = streams[activeInputStream] ?
1897+
activeInputStream : trackOwners[activeInputStream];
18961898
room_config.views.forEach((viewSettings) => {
18971899
if (viewSettings.label === view && viewSettings.video.keepActiveInputPrimary) {
1898-
roomController.setPrimary(activeInputStream, view);
1900+
if(streams[input].info.type === "webrtc") {
1901+
const videoTrackIds = streams[input].media.tracks.filter(t => t.type === 'video').map(t => t.id);
1902+
videoTrackIds.forEach(id => {
1903+
roomController.setPrimary(id, view);
1904+
});
1905+
} else {
1906+
roomController.setPrimary(activeInputStream, view);
1907+
}
1908+
18991909
}
19001910
});
19011911

1902-
const input = streams[activeInputStream] ?
1903-
activeInputStream : trackOwners[activeInputStream];
19041912
const mixedId = roomController.getMixedStream(view);
19051913
if (streams[mixedId] instanceof MixedStream) {
19061914
if (streams[mixedId].info.activeInput !== input) {

0 commit comments

Comments
 (0)