Skip to content

Commit

Permalink
fix: update local camera
Browse files Browse the repository at this point in the history
Revert rollup

Update tsconfig.json
  • Loading branch information
jamsea committed Oct 1, 2024
1 parent 9169d84 commit 70999e7
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/VCSWebRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -645,11 +645,23 @@ export default class DailyVCSWebRenderer {
} else {
videoEl = document.createElement('video');
this.placeVideoSourceInDOM(videoEl, video.track.id);
videoEl.setAttribute('autoplay', 'true');
videoEl.setAttribute('playsinline', 'true');
videoEl.setAttribute('controls', 'false');
}
videoEl.srcObject = mediaStream;
videoEl.setAttribute('autoplay', 'true');
videoEl.setAttribute('playsinline', 'true');
videoEl.setAttribute('controls', 'false');

if (!videoEl.srcObject) {
videoEl.srcObject = mediaStream;
}

const srcObject = videoEl.srcObject as MediaStream;
const currentVideoTrack = srcObject.getTracks()[0];

if (currentVideoTrack.id !== video.track.id) {
srcObject.removeTrack(currentVideoTrack);
srcObject.addTrack(video.track);
}

//console.log('created video el for %s', video.id);
}

Expand Down

0 comments on commit 70999e7

Please sign in to comment.