Skip to content

Commit

Permalink
don't delete webrtc session if bridge offline
Browse files Browse the repository at this point in the history
  • Loading branch information
mrlt8 committed Jun 24, 2024
1 parent 357857c commit d7b9d4a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions app/static/webrtc.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,18 +229,20 @@ class Receiver {
this.pc.close();
this.pc = null;
}
const connection = document.getElementById("connection-lost");
const offline = connection && connection.style.display === "block";

this.restartTimeout = window.setTimeout(() => {
this.restartTimeout = null;
const connection = document.getElementById("connection-lost");
if (connection && connection.style.display === "block") {
if (offline) {
this.onError()
} else {
this.refreshSignal();
this.start();
}
}, restartPause);

if (this.sessionUrl !== '' && this.signalJson.whep) {
if (this.sessionUrl !== '' && !offline) {
fetch(this.sessionUrl, {
method: 'DELETE',
headers: this.authHeaders(),
Expand Down

0 comments on commit d7b9d4a

Please sign in to comment.