From 8467de5085b1ccbb00a66eec7050ac346eace209 Mon Sep 17 00:00:00 2001
From: ‘liusuyi’ <1951119284@qq.com>
Date: 星期四, 05 十月 2023 17:23:08 +0800
Subject: [PATCH] 增加恢复报警过滤接口

---
 ard-work/src/main/resources/templates/preview.html |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/ard-work/src/main/resources/templates/preview.html b/ard-work/src/main/resources/templates/preview.html
index a115bf1..ee775ac 100644
--- a/ard-work/src/main/resources/templates/preview.html
+++ b/ard-work/src/main/resources/templates/preview.html
@@ -174,9 +174,9 @@
     }
 
     class WHEPClient {
-        constructor(wurl, videoId) {
+        constructor(whepUrl, videoId) {
             this.video = videoId;
-            this.url = new URL('whep', wurl);
+            this.wurl = new URL('whep', whepUrl);
             this.pc = null;
             this.restartTimeout = null;
             this.eTag = '';
@@ -186,7 +186,7 @@
 
         start() {
             console.log("requesting ICE servers");
-            fetch(this.url, {
+            fetch(this.wurl, {
                 method: 'OPTIONS',
             })
                 .then((res) => this.onIceServers(res))
@@ -223,7 +223,7 @@
 
             console.log("sending offer");
 
-            fetch(this.url, {
+            fetch(this.wurl, {
                 method: 'POST',
                 headers: {
                     'Content-Type': 'application/sdp',
@@ -234,7 +234,8 @@
                     if (res.status !== 201) {
                         throw new Error('bad status code');
                     }
-                    this.eTag = res.headers.get('E-Tag');
+                   // this.eTag = res.headers.get('ETag');
+                    this.eTag = res.headers.get("ETag") || res.headers.get('E-Tag');
                     return res.text();
                 })
                 .then((sdp) => this.onRemoteAnswer(new RTCSessionDescription({
@@ -288,7 +289,7 @@
         }
 
         sendLocalCandidates(candidates) {
-            fetch(this.url, {
+            fetch(this.wurl, {
                 method: 'PATCH',
                 headers: {
                     'Content-Type': 'application/trickle-ice-sdpfrag',

--
Gitblit v1.9.3