| | |
| | | </div> |
| | | |
| | | <script> |
| | | console.log(RTCRtpReceiver.getCapabilities('video').codecs) |
| | | console.log(RTCRtpReceiver.getCapabilities('audio').codecs) |
| | | //whep操作方法 |
| | | const linkToIceServers = (links) => ( |
| | | (links !== null) ? links.split(', ').map((link) => { |
| | |
| | | console.log("requesting ICE servers"); |
| | | fetch(this.wurl, { |
| | | method: 'OPTIONS', |
| | | headers: { |
| | | 'Referer': this.wurl, |
| | | }, |
| | | }) |
| | | .then((res) => this.onIceServers(res)) |
| | | .catch((err) => { |
| | |
| | | method: 'POST', |
| | | headers: { |
| | | 'Content-Type': 'application/sdp', |
| | | 'Referer': this.wurl, |
| | | }, |
| | | body: offer.sdp, |
| | | }) |
| | |
| | | headers: { |
| | | 'Content-Type': 'application/trickle-ice-sdpfrag', |
| | | 'If-Match': this.eTag, |
| | | 'Referer': this.wurl, |
| | | }, |
| | | |
| | | body: generateSdpFragment(this.offerData, candidates), |
| | | }) |
| | | .then((res) => { |