‘liusuyi’
2023-10-21 ae92b6823499cfab77201b4033922fa373fb37a3
ard-work/src/main/resources/templates/preview.html
@@ -101,7 +101,7 @@
            <button class="toggle-button" onclick="changeGrid(7, 7)">7x7</button>
            <button class="toggle-button" onclick="changeGrid(8, 8)">8x8</button>
            <button class="toggle-button" onclick="changeGrid(9, 9)">9x9</button>
            <input id="videoUrl" type="text" value="http://192.168.1.227:8889/164/" style="width: 250px"/>
            <input id="videoUrl" type="text" value="" style="width: 250px"/>
        </div>
    </div>
</div>
@@ -110,6 +110,7 @@
    console.log(RTCRtpReceiver.getCapabilities('video').codecs)
    console.log(RTCRtpReceiver.getCapabilities('audio').codecs)
    //whep操作方法
    const restartPause = 2000;
    const linkToIceServers = (links) => (
        (links !== null) ? links.split(', ').map((link) => {
            const m = link.match(/^<(.+?)>; rel="ice-server"(; username="(.*?)"; credential="(.*?)"; credential-type="password")?/i);
@@ -236,7 +237,7 @@
                    if (res.status !== 201) {
                        throw new Error('bad status code');
                    }
                   // this.eTag = res.headers.get('ETag');
                    // this.eTag = res.headers.get('ETag');
                    this.eTag = res.headers.get("ETag") || res.headers.get('E-Tag');
                    return res.text();
                })
@@ -297,6 +298,7 @@
                    'Content-Type': 'application/trickle-ice-sdpfrag',
                    'If-Match': this.eTag,
                },
                body: generateSdpFragment(this.offerData, candidates),
            })
                .then((res) => {
@@ -349,7 +351,7 @@
            chanMap.set("video" + i, videoUrl);
        }
        console.log(chanMap);
        changeGrid(2, 2);
        //changeGrid(2, 2);
    }
    //绑定点击事件
    let playMap = new Map();