Skip to content

Commit

Permalink
[call-me] - fix
Browse files Browse the repository at this point in the history
  • Loading branch information
miroslavpejic85 committed Jan 5, 2025
1 parent adf9f45 commit a7fe5a8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "call-me",
"version": "1.0.43",
"version": "1.0.44",
"description": "Your Go-To for Instant Video Calls",
"author": "Miroslav Pejic - miroslav.pejic.85@gmail.com",
"license": "AGPLv3",
Expand Down
14 changes: 14 additions & 0 deletions public/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,8 @@ function swapCamera() {
// Refresh video streams
refreshLocalVideoStream(newStream);
refreshPeerVideoStreams(newStream);
// Check video/audio status
checkVideoAudioStatus();
})
.catch((error) => {
handleError('Failed to swap the camera.', error);
Expand Down Expand Up @@ -442,6 +444,18 @@ function refreshPeerVideoStreams(newStream) {
}
}

// Check video audio status
function checkVideoAudioStatus() {
if (videoBtn.classList.contains('btn-danger')) {
const videoTrack = stream.getVideoTracks()[0];
videoTrack.enabled = false;
}
if (audioBtn.classList.contains('btn-danger')) {
const audioTrack = stream.getAudioTracks()[0];
audioTrack.enabled = false;
}
}

// Handle hang-up button click
function handleHangUpClick() {
sendMsg({ type: 'leave', name: socket.recipient });
Expand Down

0 comments on commit a7fe5a8

Please sign in to comment.