Skip to content

Commit 05e6b30

Browse files
author
Adam Bavosa
committed
hide the video UI if the call fails
1 parent f3d4299 commit 05e6b30

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

example/app.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,16 @@ messageInput.addEventListener('keydown', (event) => {
8181
// Send a chat message when the submit button is clicked
8282
submit.addEventListener('click', sendMessage);
8383

84-
// Register a disconnect event handler when the close video button is clicked
85-
closeVideoButton.addEventListener('click', closeVideoEventHandler);
86-
8784
const closeVideoEventHandler = (event) => {
8885
videoModal.classList.add(hide);
8986
chatInterface.classList.remove(hide);
9087
clearTimeout(noVideoTimeout);
9188
webRtcPhone.disconnect(); // disconnects the current phone call
9289
}
9390

91+
// Register a disconnect event handler when the close video button is clicked
92+
closeVideoButton.addEventListener('click', closeVideoEventHandler);
93+
9494
const initWebRtcApp = () => {
9595
// WebRTC phone object event for when the remote peer's video becomes available.
9696
const onPeerStream = (webRTCTrackEvent) => {

0 commit comments

Comments
 (0)