‘liusuyi’
2023-12-12 f5fa6fa5e5d14fb3d8703434b30648be76b6e7e6
ard-work/src/main/resources/templates/preview.html
@@ -107,7 +107,13 @@
</div>
<script>
    console.log(RTCRtpReceiver.getCapabilities('video').codecs)
    console.log(RTCRtpReceiver.getCapabilities('audio').codecs)
    //whep操作方法
    const restartPause = 2000;
    const unquoteCredential = (v) => (
        JSON.parse(`"${v}"`)
    );
    const linkToIceServers = (links) => (
        (links !== null) ? links.split(', ').map((link) => {
            const m = link.match(/^<(.+?)>; rel="ice-server"(; username="(.*?)"; credential="(.*?)"; credential-type="password")?/i);
@@ -234,7 +240,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();
                })
@@ -295,6 +301,7 @@
                    'Content-Type': 'application/trickle-ice-sdpfrag',
                    'If-Match': this.eTag,
                },
                body: generateSdpFragment(this.offerData, candidates),
            })
                .then((res) => {