mirror of
https://github.com/ianramzy/decentralized-video-chat.git
synced 2024-11-23 10:39:20 +08:00
auto swap back to webcam after screen share
This commit is contained in:
parent
4c8c7fd37b
commit
124e49947c
@ -493,7 +493,7 @@ function swap() {
|
||||
navigator.mediaDevices
|
||||
.getDisplayMedia({
|
||||
video: true,
|
||||
audio: true,
|
||||
audio: false,
|
||||
})
|
||||
.then(function (stream) {
|
||||
mode = "screen";
|
||||
@ -524,6 +524,9 @@ function swap() {
|
||||
|
||||
function switchStreamHelper(stream) {
|
||||
let videoTrack = stream.getVideoTracks()[0];
|
||||
videoTrack.onended = function () {
|
||||
swap();
|
||||
};
|
||||
if (VideoChat.connected) {
|
||||
const sender = VideoChat.peerConnection.getSenders().find(function (s) {
|
||||
return s.track.kind === videoTrack.kind;
|
||||
|
Loading…
Reference in New Issue
Block a user