werift 0.26.0 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +182 -8
- package/THIRD_PARTY_LICENSES_LIBWEBRTC.txt +58 -0
- package/lib/common/src/binary.d.ts +1 -3
- package/lib/common/src/binary.js +8 -6
- package/lib/common/src/binary.js.map +1 -1
- package/lib/common/src/binaryData.js +2 -1
- package/lib/common/src/binaryData.js.map +1 -1
- package/lib/common/src/event.d.ts +26 -0
- package/lib/common/src/event.js +87 -2
- package/lib/common/src/event.js.map +1 -1
- package/lib/common/src/log.js +5 -7
- package/lib/common/src/log.js.map +1 -1
- package/lib/common/src/network.d.ts +6 -1
- package/lib/common/src/network.js +8 -2
- package/lib/common/src/network.js.map +1 -1
- package/lib/common/src/transport.d.ts +12 -5
- package/lib/common/src/transport.js +13 -7
- package/lib/common/src/transport.js.map +1 -1
- package/lib/dtls/src/alert.d.ts +49 -0
- package/lib/dtls/src/alert.js +103 -0
- package/lib/dtls/src/alert.js.map +1 -0
- package/lib/dtls/src/client.js +15 -1
- package/lib/dtls/src/client.js.map +1 -1
- package/lib/dtls/src/context/cipher.d.ts +1 -1
- package/lib/dtls/src/context/cipher.js +6 -3
- package/lib/dtls/src/context/cipher.js.map +1 -1
- package/lib/dtls/src/context/dtls.d.ts +2 -0
- package/lib/dtls/src/context/dtls.js +11 -2
- package/lib/dtls/src/context/dtls.js.map +1 -1
- package/lib/dtls/src/context/transport.d.ts +17 -1
- package/lib/dtls/src/context/transport.js +40 -3
- package/lib/dtls/src/context/transport.js.map +1 -1
- package/lib/dtls/src/flight/client/flight1.js +2 -1
- package/lib/dtls/src/flight/client/flight1.js.map +1 -1
- package/lib/dtls/src/flight/client/flight5.js +8 -3
- package/lib/dtls/src/flight/client/flight5.js.map +1 -1
- package/lib/dtls/src/flight/flight.d.ts +6 -1
- package/lib/dtls/src/flight/flight.js +18 -5
- package/lib/dtls/src/flight/flight.js.map +1 -1
- package/lib/dtls/src/flight/server/flight4.js +4 -2
- package/lib/dtls/src/flight/server/flight4.js.map +1 -1
- package/lib/dtls/src/flight/server/flight6.js +6 -2
- package/lib/dtls/src/flight/server/flight6.js.map +1 -1
- package/lib/dtls/src/handshake/const.d.ts +17 -13
- package/lib/dtls/src/handshake/const.js +16 -14
- package/lib/dtls/src/handshake/const.js.map +1 -1
- package/lib/dtls/src/handshake/message/alert.js +4 -2
- package/lib/dtls/src/handshake/message/alert.js.map +1 -1
- package/lib/dtls/src/handshake/message/certificate.js +2 -1
- package/lib/dtls/src/handshake/message/certificate.js.map +1 -1
- package/lib/dtls/src/handshake/message/changeCipherSpec.js +2 -1
- package/lib/dtls/src/handshake/message/changeCipherSpec.js.map +1 -1
- package/lib/dtls/src/handshake/message/client/certificateVerify.js +4 -2
- package/lib/dtls/src/handshake/message/client/certificateVerify.js.map +1 -1
- package/lib/dtls/src/handshake/message/client/hello.js +14 -7
- package/lib/dtls/src/handshake/message/client/hello.js.map +1 -1
- package/lib/dtls/src/handshake/message/client/keyExchange.js +2 -1
- package/lib/dtls/src/handshake/message/client/keyExchange.js.map +1 -1
- package/lib/dtls/src/handshake/message/finished.js +2 -1
- package/lib/dtls/src/handshake/message/finished.js.map +1 -1
- package/lib/dtls/src/handshake/message/server/certificateRequest.js +6 -3
- package/lib/dtls/src/handshake/message/server/certificateRequest.js.map +1 -1
- package/lib/dtls/src/handshake/message/server/hello.js +12 -6
- package/lib/dtls/src/handshake/message/server/hello.js.map +1 -1
- package/lib/dtls/src/handshake/message/server/helloDone.js.map +1 -1
- package/lib/dtls/src/handshake/message/server/helloVerifyRequest.js +4 -2
- package/lib/dtls/src/handshake/message/server/helloVerifyRequest.js.map +1 -1
- package/lib/dtls/src/handshake/message/server/keyExchange.js +16 -8
- package/lib/dtls/src/handshake/message/server/keyExchange.js.map +1 -1
- package/lib/dtls/src/handshake/random.d.ts +2 -2
- package/lib/dtls/src/handshake/random.js +5 -2
- package/lib/dtls/src/handshake/random.js.map +1 -1
- package/lib/dtls/src/index.d.ts +3 -1
- package/lib/dtls/src/index.js +10 -1
- package/lib/dtls/src/index.js.map +1 -1
- package/lib/dtls/src/record/const.d.ts +52 -33
- package/lib/dtls/src/record/const.js +51 -36
- package/lib/dtls/src/record/const.js.map +1 -1
- package/lib/dtls/src/record/message/fragment.js +12 -6
- package/lib/dtls/src/record/message/fragment.js.map +1 -1
- package/lib/dtls/src/record/message/header.js +10 -5
- package/lib/dtls/src/record/message/header.js.map +1 -1
- package/lib/dtls/src/record/message/plaintext.js +4 -2
- package/lib/dtls/src/record/message/plaintext.js.map +1 -1
- package/lib/dtls/src/record/receive.d.ts +6 -0
- package/lib/dtls/src/record/receive.js +50 -19
- package/lib/dtls/src/record/receive.js.map +1 -1
- package/lib/dtls/src/server.js +19 -1
- package/lib/dtls/src/server.js.map +1 -1
- package/lib/dtls/src/socket.d.ts +134 -2
- package/lib/dtls/src/socket.js +326 -8
- package/lib/dtls/src/socket.js.map +1 -1
- package/lib/ice/src/candidate.d.ts +1 -1
- package/lib/ice/src/candidate.js +24 -12
- package/lib/ice/src/candidate.js.map +1 -1
- package/lib/ice/src/candidateError.d.ts +155 -0
- package/lib/ice/src/candidateError.js +246 -0
- package/lib/ice/src/candidateError.js.map +1 -0
- package/lib/ice/src/candidateGatherer.d.ts +127 -0
- package/lib/ice/src/candidateGatherer.js +745 -0
- package/lib/ice/src/candidateGatherer.js.map +1 -0
- package/lib/ice/src/consent.d.ts +49 -0
- package/lib/ice/src/consent.js +258 -0
- package/lib/ice/src/consent.js.map +1 -0
- package/lib/ice/src/dns/lookup.d.ts +10 -1
- package/lib/ice/src/dns/lookup.js +42 -7
- package/lib/ice/src/dns/lookup.js.map +1 -1
- package/lib/ice/src/exceptions.d.ts +21 -5
- package/lib/ice/src/exceptions.js +58 -13
- package/lib/ice/src/exceptions.js.map +1 -1
- package/lib/ice/src/ice.d.ts +254 -58
- package/lib/ice/src/ice.js +979 -945
- package/lib/ice/src/ice.js.map +1 -1
- package/lib/ice/src/iceBase.d.ts +328 -14
- package/lib/ice/src/iceBase.js +254 -38
- package/lib/ice/src/iceBase.js.map +1 -1
- package/lib/ice/src/index.d.ts +1 -0
- package/lib/ice/src/index.js +1 -0
- package/lib/ice/src/index.js.map +1 -1
- package/lib/ice/src/internal/checkMessages.d.ts +41 -0
- package/lib/ice/src/internal/checkMessages.js +63 -0
- package/lib/ice/src/internal/checkMessages.js.map +1 -0
- package/lib/ice/src/internal/defaultRoute.d.ts +20 -0
- package/lib/ice/src/internal/defaultRoute.js +134 -0
- package/lib/ice/src/internal/defaultRoute.js.map +1 -0
- package/lib/ice/src/internal/hostInterfaces.d.ts +17 -0
- package/lib/ice/src/internal/hostInterfaces.js +77 -0
- package/lib/ice/src/internal/hostInterfaces.js.map +1 -0
- package/lib/ice/src/internal/hostPreference.d.ts +24 -0
- package/lib/ice/src/internal/hostPreference.js +38 -0
- package/lib/ice/src/internal/hostPreference.js.map +1 -0
- package/lib/ice/src/internal/resolveHostAddresses.d.ts +56 -8
- package/lib/ice/src/internal/resolveHostAddresses.js +127 -24
- package/lib/ice/src/internal/resolveHostAddresses.js.map +1 -1
- package/lib/ice/src/internal/selectAddresses.d.ts +27 -0
- package/lib/ice/src/internal/selectAddresses.js +37 -18
- package/lib/ice/src/internal/selectAddresses.js.map +1 -1
- package/lib/ice/src/nomination/regularNomination.d.ts +200 -0
- package/lib/ice/src/nomination/regularNomination.js +311 -0
- package/lib/ice/src/nomination/regularNomination.js.map +1 -0
- package/lib/ice/src/nomination/selectionReplacement.d.ts +138 -0
- package/lib/ice/src/nomination/selectionReplacement.js +371 -0
- package/lib/ice/src/nomination/selectionReplacement.js.map +1 -0
- package/lib/ice/src/provisional.d.ts +139 -0
- package/lib/ice/src/provisional.js +468 -0
- package/lib/ice/src/provisional.js.map +1 -0
- package/lib/ice/src/stun/protocol.d.ts +9 -2
- package/lib/ice/src/stun/protocol.js +16 -17
- package/lib/ice/src/stun/protocol.js.map +1 -1
- package/lib/ice/src/stun/tcpProtocol.d.ts +1 -1
- package/lib/ice/src/stun/tcpProtocol.js +7 -7
- package/lib/ice/src/stun/tcpProtocol.js.map +1 -1
- package/lib/ice/src/stun/transaction.d.ts +30 -1
- package/lib/ice/src/stun/transaction.js +90 -19
- package/lib/ice/src/stun/transaction.js.map +1 -1
- package/lib/ice/src/turn/credential.d.ts +49 -0
- package/lib/ice/src/turn/credential.js +78 -0
- package/lib/ice/src/turn/credential.js.map +1 -0
- package/lib/ice/src/turn/protocol.d.ts +31 -10
- package/lib/ice/src/turn/protocol.js +127 -51
- package/lib/ice/src/turn/protocol.js.map +1 -1
- package/lib/ice/src/types/model.d.ts +16 -5
- package/lib/ice/src/types/model.js.map +1 -1
- package/lib/ice-server/src/stun/attributes.d.ts +2 -0
- package/lib/ice-server/src/stun/attributes.js +11 -1
- package/lib/ice-server/src/stun/attributes.js.map +1 -1
- package/lib/ice-server/src/stun/const.d.ts +44 -17
- package/lib/ice-server/src/stun/const.js +31 -19
- package/lib/ice-server/src/stun/const.js.map +1 -1
- package/lib/ice-server/src/stun/message.d.ts +29 -4
- package/lib/ice-server/src/stun/message.js +115 -24
- package/lib/ice-server/src/stun/message.js.map +1 -1
- package/lib/index.mjs +35121 -22337
- package/lib/nonstandard/index.mjs +3169 -1399
- package/lib/polyfill/dom.mjs +24650 -12365
- package/lib/polyfill/index.mjs +24650 -12365
- package/lib/rtp/src/codec/assertPayload.d.ts +4 -0
- package/lib/rtp/src/codec/assertPayload.js +12 -0
- package/lib/rtp/src/codec/assertPayload.js.map +1 -0
- package/lib/rtp/src/codec/av1.js +2 -0
- package/lib/rtp/src/codec/av1.js.map +1 -1
- package/lib/rtp/src/codec/h264.js +35 -43
- package/lib/rtp/src/codec/h264.js.map +1 -1
- package/lib/rtp/src/codec/vp8.js +11 -5
- package/lib/rtp/src/codec/vp8.js.map +1 -1
- package/lib/rtp/src/codec/vp9.js +12 -0
- package/lib/rtp/src/codec/vp9.js.map +1 -1
- package/lib/rtp/src/extra/container/mp4/container.js +2 -1
- package/lib/rtp/src/extra/container/mp4/container.js.map +1 -1
- package/lib/rtp/src/extra/container/mp4/exp-golomb.js +2 -1
- package/lib/rtp/src/extra/container/mp4/exp-golomb.js.map +1 -1
- package/lib/rtp/src/extra/container/mp4/h264.d.ts +21 -17
- package/lib/rtp/src/extra/container/mp4/h264.js +26 -24
- package/lib/rtp/src/extra/container/mp4/h264.js.map +1 -1
- package/lib/rtp/src/extra/container/ogg/index.d.ts +1 -0
- package/lib/rtp/src/extra/container/ogg/index.js +1 -0
- package/lib/rtp/src/extra/container/ogg/index.js.map +1 -1
- package/lib/rtp/src/extra/container/ogg/writer.d.ts +90 -0
- package/lib/rtp/src/extra/container/ogg/writer.js +300 -0
- package/lib/rtp/src/extra/container/ogg/writer.js.map +1 -0
- package/lib/rtp/src/extra/container/webm/ebml/ebml.js +6 -3
- package/lib/rtp/src/extra/container/webm/ebml/ebml.js.map +1 -1
- package/lib/rtp/src/extra/processor/depacketizer.d.ts +5 -0
- package/lib/rtp/src/extra/processor/depacketizer.js +28 -2
- package/lib/rtp/src/extra/processor/depacketizer.js.map +1 -1
- package/lib/rtp/src/extra/processor/dtx.js +4 -2
- package/lib/rtp/src/extra/processor/dtx.js.map +1 -1
- package/lib/rtp/src/extra/processor/index.d.ts +2 -0
- package/lib/rtp/src/extra/processor/index.js +2 -0
- package/lib/rtp/src/extra/processor/index.js.map +1 -1
- package/lib/rtp/src/extra/processor/jitterBuffer.d.ts +29 -6
- package/lib/rtp/src/extra/processor/jitterBuffer.js +101 -111
- package/lib/rtp/src/extra/processor/jitterBuffer.js.map +1 -1
- package/lib/rtp/src/extra/processor/jitterBufferTransformer.js +2 -1
- package/lib/rtp/src/extra/processor/jitterBufferTransformer.js.map +1 -1
- package/lib/rtp/src/extra/processor/lipsync.d.ts +63 -0
- package/lib/rtp/src/extra/processor/lipsync.js +202 -51
- package/lib/rtp/src/extra/processor/lipsync.js.map +1 -1
- package/lib/rtp/src/extra/processor/mp4.d.ts +0 -6
- package/lib/rtp/src/extra/processor/mp4.js +6 -3
- package/lib/rtp/src/extra/processor/mp4.js.map +1 -1
- package/lib/rtp/src/extra/processor/mute.js +4 -2
- package/lib/rtp/src/extra/processor/mute.js.map +1 -1
- package/lib/rtp/src/extra/processor/nack.js +4 -2
- package/lib/rtp/src/extra/processor/nack.js.map +1 -1
- package/lib/rtp/src/extra/processor/ntpTime.js +4 -6
- package/lib/rtp/src/extra/processor/ntpTime.js.map +1 -1
- package/lib/rtp/src/extra/processor/ogg.d.ts +72 -0
- package/lib/rtp/src/extra/processor/ogg.js +221 -0
- package/lib/rtp/src/extra/processor/ogg.js.map +1 -0
- package/lib/rtp/src/extra/processor/oggCallback.d.ts +21 -0
- package/lib/rtp/src/extra/processor/oggCallback.js +97 -0
- package/lib/rtp/src/extra/processor/oggCallback.js.map +1 -0
- package/lib/rtp/src/extra/processor/rtpCallback.js +2 -1
- package/lib/rtp/src/extra/processor/rtpCallback.js.map +1 -1
- package/lib/rtp/src/extra/processor/rtpStream.js +2 -1
- package/lib/rtp/src/extra/processor/rtpStream.js.map +1 -1
- package/lib/rtp/src/extra/processor/rtpTime.js +2 -1
- package/lib/rtp/src/extra/processor/rtpTime.js.map +1 -1
- package/lib/rtp/src/extra/processor/webm.js +14 -7
- package/lib/rtp/src/extra/processor/webm.js.map +1 -1
- package/lib/rtp/src/extra/processor/webmCallback.js.map +1 -1
- package/lib/rtp/src/index.d.ts +8 -0
- package/lib/rtp/src/index.js +8 -0
- package/lib/rtp/src/index.js.map +1 -1
- package/lib/rtp/src/rtcp/psfb/fullIntraRequest.d.ts +4 -0
- package/lib/rtp/src/rtcp/psfb/fullIntraRequest.js +4 -0
- package/lib/rtp/src/rtcp/psfb/fullIntraRequest.js.map +1 -1
- package/lib/rtp/src/rtcp/rtcp.js +8 -4
- package/lib/rtp/src/rtcp/rtcp.js.map +1 -1
- package/lib/rtp/src/rtcp/rtpfb/transportWideSequence.d.ts +58 -0
- package/lib/rtp/src/rtcp/rtpfb/transportWideSequence.js +143 -0
- package/lib/rtp/src/rtcp/rtpfb/transportWideSequence.js.map +1 -0
- package/lib/rtp/src/rtcp/rtpfb/twcc.d.ts +35 -13
- package/lib/rtp/src/rtcp/rtpfb/twcc.js +132 -54
- package/lib/rtp/src/rtcp/rtpfb/twcc.js.map +1 -1
- package/lib/rtp/src/rtcp/rtpfb/twccReceiveTiming.d.ts +13 -0
- package/lib/rtp/src/rtcp/rtpfb/twccReceiveTiming.js +29 -0
- package/lib/rtp/src/rtcp/rtpfb/twccReceiveTiming.js.map +1 -0
- package/lib/rtp/src/rtcp/rtpfb/twccReferenceTime.d.ts +41 -0
- package/lib/rtp/src/rtcp/rtpfb/twccReferenceTime.js +89 -0
- package/lib/rtp/src/rtcp/rtpfb/twccReferenceTime.js.map +1 -0
- package/lib/rtp/src/rtcp/sr.js +1 -0
- package/lib/rtp/src/rtcp/sr.js.map +1 -1
- package/lib/rtp/src/rtp/continuity.d.ts +49 -0
- package/lib/rtp/src/rtp/continuity.js +120 -0
- package/lib/rtp/src/rtp/continuity.js.map +1 -0
- package/lib/rtp/src/rtp/headerExtension.js +41 -21
- package/lib/rtp/src/rtp/headerExtension.js.map +1 -1
- package/lib/rtp/src/rtp/padding.d.ts +17 -0
- package/lib/rtp/src/rtp/padding.js +37 -0
- package/lib/rtp/src/rtp/padding.js.map +1 -0
- package/lib/rtp/src/rtp/red/encoder.d.ts +10 -0
- package/lib/rtp/src/rtp/red/encoder.js +14 -1
- package/lib/rtp/src/rtp/red/encoder.js.map +1 -1
- package/lib/rtp/src/rtp/red/packet.js +24 -8
- package/lib/rtp/src/rtp/red/packet.js.map +1 -1
- package/lib/rtp/src/rtp/rtp.d.ts +24 -1
- package/lib/rtp/src/rtp/rtp.js +70 -29
- package/lib/rtp/src/rtp/rtp.js.map +1 -1
- package/lib/rtp/src/rtp/rtx.js +3 -0
- package/lib/rtp/src/rtp/rtx.js.map +1 -1
- package/lib/rtp/src/rtp/sendHeaderExtensions.d.ts +36 -0
- package/lib/rtp/src/rtp/sendHeaderExtensions.js +85 -0
- package/lib/rtp/src/rtp/sendHeaderExtensions.js.map +1 -0
- package/lib/rtp/src/rtp/timelineRewriter.d.ts +178 -0
- package/lib/rtp/src/rtp/timelineRewriter.js +417 -0
- package/lib/rtp/src/rtp/timelineRewriter.js.map +1 -0
- package/lib/rtp/src/srtp/cipher/ctr.js +4 -2
- package/lib/rtp/src/srtp/cipher/ctr.js.map +1 -1
- package/lib/rtp/src/srtp/cipher/index.js +8 -4
- package/lib/rtp/src/srtp/cipher/index.js.map +1 -1
- package/lib/rtp/src/srtp/context/context.js +6 -3
- package/lib/rtp/src/srtp/context/context.js.map +1 -1
- package/lib/rtp/src/srtp/context/srtcp.d.ts +1 -1
- package/lib/rtp/src/srtp/context/srtcp.js +33 -0
- package/lib/rtp/src/srtp/context/srtcp.js.map +1 -1
- package/lib/rtp/src/srtp/context/srtp.d.ts +1 -1
- package/lib/rtp/src/srtp/context/srtp.js +34 -10
- package/lib/rtp/src/srtp/context/srtp.js.map +1 -1
- package/lib/rtp/src/srtp/error.d.ts +8 -0
- package/lib/rtp/src/srtp/error.js +13 -1
- package/lib/rtp/src/srtp/error.js.map +1 -1
- package/lib/rtp/src/srtp/packet.js +4 -1
- package/lib/rtp/src/srtp/packet.js.map +1 -1
- package/lib/rtp/src/srtp/replay.d.ts +24 -0
- package/lib/rtp/src/srtp/replay.js +75 -0
- package/lib/rtp/src/srtp/replay.js.map +1 -0
- package/lib/rtp/src/srtp/session.js +2 -1
- package/lib/rtp/src/srtp/session.js.map +1 -1
- package/lib/rtp/src/srtp/srtcp.js +2 -1
- package/lib/rtp/src/srtp/srtcp.js.map +1 -1
- package/lib/rtp/src/srtp/srtp.js +2 -1
- package/lib/rtp/src/srtp/srtp.js.map +1 -1
- package/lib/rtp/src/util.js +2 -1
- package/lib/rtp/src/util.js.map +1 -1
- package/lib/sctp/src/chunk.d.ts +5 -0
- package/lib/sctp/src/chunk.js +31 -8
- package/lib/sctp/src/chunk.js.map +1 -1
- package/lib/sctp/src/const.d.ts +25 -17
- package/lib/sctp/src/const.js +23 -19
- package/lib/sctp/src/const.js.map +1 -1
- package/lib/sctp/src/param.d.ts +6 -2
- package/lib/sctp/src/param.js +22 -8
- package/lib/sctp/src/param.js.map +1 -1
- package/lib/sctp/src/sctp.d.ts +85 -0
- package/lib/sctp/src/sctp.js +707 -126
- package/lib/sctp/src/sctp.js.map +1 -1
- package/lib/sctp/src/transport.js +4 -2
- package/lib/sctp/src/transport.js.map +1 -1
- package/lib/webrtc/src/api/compatibilityOptions.d.ts +33 -0
- package/lib/webrtc/src/api/compatibilityOptions.js +33 -0
- package/lib/webrtc/src/api/compatibilityOptions.js.map +1 -0
- package/lib/webrtc/src/api/peerConfig.d.ts +385 -28
- package/lib/webrtc/src/api/peerConfig.js +121 -14
- package/lib/webrtc/src/api/peerConfig.js.map +1 -1
- package/lib/webrtc/src/api/peerConnectionEvents.d.ts +77 -1
- package/lib/webrtc/src/api/peerConnectionEvents.js +105 -1
- package/lib/webrtc/src/api/peerConnectionEvents.js.map +1 -1
- package/lib/webrtc/src/dataChannel.d.ts +10 -0
- package/lib/webrtc/src/dataChannel.js +24 -4
- package/lib/webrtc/src/dataChannel.js.map +1 -1
- package/lib/webrtc/src/helper.d.ts +8 -0
- package/lib/webrtc/src/helper.js +40 -4
- package/lib/webrtc/src/helper.js.map +1 -1
- package/lib/webrtc/src/media/codecCompatibility.d.ts +87 -1
- package/lib/webrtc/src/media/codecCompatibility.js +338 -12
- package/lib/webrtc/src/media/codecCompatibility.js.map +1 -1
- package/lib/webrtc/src/media/index.d.ts +10 -0
- package/lib/webrtc/src/media/index.js +70 -0
- package/lib/webrtc/src/media/index.js.map +1 -1
- package/lib/webrtc/src/media/receiver/nack.d.ts +43 -10
- package/lib/webrtc/src/media/receiver/nack.js +246 -88
- package/lib/webrtc/src/media/receiver/nack.js.map +1 -1
- package/lib/webrtc/src/media/receiver/receiverTwcc.d.ts +61 -1
- package/lib/webrtc/src/media/receiver/receiverTwcc.js +218 -63
- package/lib/webrtc/src/media/receiver/receiverTwcc.js.map +1 -1
- package/lib/webrtc/src/media/router.d.ts +241 -40
- package/lib/webrtc/src/media/router.js +676 -205
- package/lib/webrtc/src/media/router.js.map +1 -1
- package/lib/webrtc/src/media/routing/pendingRoutes.d.ts +26 -0
- package/lib/webrtc/src/media/routing/pendingRoutes.js +48 -0
- package/lib/webrtc/src/media/routing/pendingRoutes.js.map +1 -0
- package/lib/webrtc/src/media/routing/ridRouting.d.ts +37 -0
- package/lib/webrtc/src/media/routing/ridRouting.js +74 -0
- package/lib/webrtc/src/media/routing/ridRouting.js.map +1 -0
- package/lib/webrtc/src/media/routing/routeTable.d.ts +60 -0
- package/lib/webrtc/src/media/routing/routeTable.js +95 -0
- package/lib/webrtc/src/media/routing/routeTable.js.map +1 -0
- package/lib/webrtc/src/media/routing/rtcpRouting.d.ts +34 -0
- package/lib/webrtc/src/media/routing/rtcpRouting.js +165 -0
- package/lib/webrtc/src/media/routing/rtcpRouting.js.map +1 -0
- package/lib/webrtc/src/media/routing/unknownSsrc.d.ts +55 -0
- package/lib/webrtc/src/media/routing/unknownSsrc.js +117 -0
- package/lib/webrtc/src/media/routing/unknownSsrc.js.map +1 -0
- package/lib/webrtc/src/media/rtpReceiver.d.ts +252 -2
- package/lib/webrtc/src/media/rtpReceiver.js +833 -44
- package/lib/webrtc/src/media/rtpReceiver.js.map +1 -1
- package/lib/webrtc/src/media/rtpSender.d.ts +191 -70
- package/lib/webrtc/src/media/rtpSender.js +631 -448
- package/lib/webrtc/src/media/rtpSender.js.map +1 -1
- package/lib/webrtc/src/media/rtpTransceiver.d.ts +19 -3
- package/lib/webrtc/src/media/rtpTransceiver.js +74 -9
- package/lib/webrtc/src/media/rtpTransceiver.js.map +1 -1
- package/lib/webrtc/src/media/sender/bandwidthEstimator.d.ts +249 -0
- package/lib/webrtc/src/media/sender/bandwidthEstimator.js +144 -0
- package/lib/webrtc/src/media/sender/bandwidthEstimator.js.map +1 -0
- package/lib/webrtc/src/media/sender/createBandwidthEstimator.d.ts +20 -0
- package/lib/webrtc/src/media/sender/createBandwidthEstimator.js +26 -0
- package/lib/webrtc/src/media/sender/createBandwidthEstimator.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimatorBinding.d.ts +70 -0
- package/lib/webrtc/src/media/sender/estimatorBinding.js +175 -0
- package/lib/webrtc/src/media/sender/estimatorBinding.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/disabledBwe.d.ts +18 -0
- package/lib/webrtc/src/media/sender/estimators/disabledBwe.js +44 -0
- package/lib/webrtc/src/media/sender/estimators/disabledBwe.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/acknowledgedBitrateEstimator.d.ts +79 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/acknowledgedBitrateEstimator.js +289 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/acknowledgedBitrateEstimator.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/aimdRateControl.d.ts +87 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/aimdRateControl.js +429 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/aimdRateControl.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/alrDetector.d.ts +21 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/alrDetector.js +84 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/alrDetector.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/bandwidthLimitedCause.d.ts +37 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/bandwidthLimitedCause.js +74 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/bandwidthLimitedCause.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/constants.d.ts +383 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/constants.js +408 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/constants.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/gccBwe.d.ts +406 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/gccBwe.js +1391 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/gccBwe.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/index.d.ts +19 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/index.js +75 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/index.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/interArrivalDelta.d.ts +68 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/interArrivalDelta.js +201 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/interArrivalDelta.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/intervalBudget.d.ts +26 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/intervalBudget.js +72 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/intervalBudget.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/linkCapacityEstimator.d.ts +41 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/linkCapacityEstimator.js +99 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/linkCapacityEstimator.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/lossBasedBwe.d.ts +247 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/lossBasedBwe.js +1042 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/lossBasedBwe.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/overuseDetector.d.ts +26 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/overuseDetector.js +132 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/overuseDetector.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/probeController.d.ts +305 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/probeController.js +1073 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/probeController.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/rttBasedBackoff.d.ts +60 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/rttBasedBackoff.js +151 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/rttBasedBackoff.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/trendlineEstimator.d.ts +44 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/trendlineEstimator.js +246 -0
- package/lib/webrtc/src/media/sender/estimators/gcc/trendlineEstimator.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/index.d.ts +7 -0
- package/lib/webrtc/src/media/sender/estimators/index.js +19 -0
- package/lib/webrtc/src/media/sender/estimators/index.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/lightweightBwe.d.ts +64 -0
- package/lib/webrtc/src/media/sender/estimators/lightweightBwe.js +216 -0
- package/lib/webrtc/src/media/sender/estimators/lightweightBwe.js.map +1 -0
- package/lib/webrtc/src/media/sender/estimators/twccFeedbackAdapter.d.ts +117 -0
- package/lib/webrtc/src/media/sender/estimators/twccFeedbackAdapter.js +250 -0
- package/lib/webrtc/src/media/sender/estimators/twccFeedbackAdapter.js.map +1 -0
- package/lib/webrtc/src/media/sender/outgoingQueue.d.ts +40 -0
- package/lib/webrtc/src/media/sender/outgoingQueue.js +153 -0
- package/lib/webrtc/src/media/sender/outgoingQueue.js.map +1 -0
- package/lib/webrtc/src/media/sender/padding.d.ts +45 -0
- package/lib/webrtc/src/media/sender/padding.js +134 -0
- package/lib/webrtc/src/media/sender/padding.js.map +1 -0
- package/lib/webrtc/src/media/sender/pendingRtp.d.ts +35 -0
- package/lib/webrtc/src/media/sender/pendingRtp.js +120 -0
- package/lib/webrtc/src/media/sender/pendingRtp.js.map +1 -0
- package/lib/webrtc/src/media/sender/rtpWire.d.ts +13 -0
- package/lib/webrtc/src/media/sender/rtpWire.js +38 -0
- package/lib/webrtc/src/media/sender/rtpWire.js.map +1 -0
- package/lib/webrtc/src/media/sender/sendPacer.d.ts +27 -0
- package/lib/webrtc/src/media/sender/sendPacer.js +110 -0
- package/lib/webrtc/src/media/sender/sendPacer.js.map +1 -0
- package/lib/webrtc/src/media/sender/senderBWE.d.ts +8 -33
- package/lib/webrtc/src/media/sender/senderBWE.js +5 -154
- package/lib/webrtc/src/media/sender/senderBWE.js.map +1 -1
- package/lib/webrtc/src/media/sender/senderReportHistory.d.ts +51 -0
- package/lib/webrtc/src/media/sender/senderReportHistory.js +111 -0
- package/lib/webrtc/src/media/sender/senderReportHistory.js.map +1 -0
- package/lib/webrtc/src/media/sender/senderStats.d.ts +101 -0
- package/lib/webrtc/src/media/sender/senderStats.js +317 -0
- package/lib/webrtc/src/media/sender/senderStats.js.map +1 -0
- package/lib/webrtc/src/media/track.d.ts +29 -2
- package/lib/webrtc/src/media/track.js +32 -5
- package/lib/webrtc/src/media/track.js.map +1 -1
- package/lib/webrtc/src/negotiation/bundleTopology.d.ts +1 -5
- package/lib/webrtc/src/negotiation/bundleTopology.js +15 -11
- package/lib/webrtc/src/negotiation/bundleTopology.js.map +1 -1
- package/lib/webrtc/src/negotiation/descriptionValidation.js +12 -6
- package/lib/webrtc/src/negotiation/descriptionValidation.js.map +1 -1
- package/lib/webrtc/src/negotiation/negotiationNeeded.js +2 -1
- package/lib/webrtc/src/negotiation/negotiationNeeded.js.map +1 -1
- package/lib/webrtc/src/negotiation/remoteCandidates.js +10 -5
- package/lib/webrtc/src/negotiation/remoteCandidates.js.map +1 -1
- package/lib/webrtc/src/negotiation/remoteMediaApplication.d.ts +24 -7
- package/lib/webrtc/src/negotiation/remoteMediaApplication.js +67 -27
- package/lib/webrtc/src/negotiation/remoteMediaApplication.js.map +1 -1
- package/lib/webrtc/src/negotiation/transceiverPairing.d.ts +1 -0
- package/lib/webrtc/src/negotiation/transceiverPairing.js +62 -0
- package/lib/webrtc/src/negotiation/transceiverPairing.js.map +1 -0
- package/lib/webrtc/src/negotiation/transportActivation.d.ts +8 -1
- package/lib/webrtc/src/negotiation/transportActivation.js +40 -8
- package/lib/webrtc/src/negotiation/transportActivation.js.map +1 -1
- package/lib/webrtc/src/negotiationTransaction.d.ts +43 -5
- package/lib/webrtc/src/negotiationTransaction.js +129 -13
- package/lib/webrtc/src/negotiationTransaction.js.map +1 -1
- package/lib/webrtc/src/nonstandard/dummyMedia.js +2 -1
- package/lib/webrtc/src/nonstandard/dummyMedia.js.map +1 -1
- package/lib/webrtc/src/nonstandard/navigator.js +4 -3
- package/lib/webrtc/src/nonstandard/navigator.js.map +1 -1
- package/lib/webrtc/src/nonstandard/recorder/index.d.ts +32 -8
- package/lib/webrtc/src/nonstandard/recorder/index.js +81 -20
- package/lib/webrtc/src/nonstandard/recorder/index.js.map +1 -1
- package/lib/webrtc/src/nonstandard/recorder/writer/index.d.ts +9 -7
- package/lib/webrtc/src/nonstandard/recorder/writer/index.js +2 -1
- package/lib/webrtc/src/nonstandard/recorder/writer/index.js.map +1 -1
- package/lib/webrtc/src/nonstandard/recorder/writer/ogg.d.ts +32 -0
- package/lib/webrtc/src/nonstandard/recorder/writer/ogg.js +185 -0
- package/lib/webrtc/src/nonstandard/recorder/writer/ogg.js.map +1 -0
- package/lib/webrtc/src/nonstandard/recorder/writer/webm.js +8 -1
- package/lib/webrtc/src/nonstandard/recorder/writer/webm.js.map +1 -1
- package/lib/webrtc/src/nonstandard/userMedia.js +2 -1
- package/lib/webrtc/src/nonstandard/userMedia.js.map +1 -1
- package/lib/webrtc/src/peerConnection.d.ts +108 -6
- package/lib/webrtc/src/peerConnection.js +357 -36
- package/lib/webrtc/src/peerConnection.js.map +1 -1
- package/lib/webrtc/src/polyfill/globals.d.ts +2 -1
- package/lib/webrtc/src/polyfill/globals.js.map +1 -1
- package/lib/webrtc/src/polyfill/install.js +2 -0
- package/lib/webrtc/src/polyfill/install.js.map +1 -1
- package/lib/webrtc/src/polyfill/mediaDevices.js +2 -1
- package/lib/webrtc/src/polyfill/mediaDevices.js.map +1 -1
- package/lib/webrtc/src/sctpManager.d.ts +46 -14
- package/lib/webrtc/src/sctpManager.js +92 -25
- package/lib/webrtc/src/sctpManager.js.map +1 -1
- package/lib/webrtc/src/sdp.d.ts +69 -0
- package/lib/webrtc/src/sdp.js +151 -20
- package/lib/webrtc/src/sdp.js.map +1 -1
- package/lib/webrtc/src/sdpManager.d.ts +85 -4
- package/lib/webrtc/src/sdpManager.js +214 -14
- package/lib/webrtc/src/sdpManager.js.map +1 -1
- package/lib/webrtc/src/secureTransportManager.d.ts +89 -4
- package/lib/webrtc/src/secureTransportManager.js +184 -26
- package/lib/webrtc/src/secureTransportManager.js.map +1 -1
- package/lib/webrtc/src/transceiverManager.d.ts +82 -4
- package/lib/webrtc/src/transceiverManager.js +239 -41
- package/lib/webrtc/src/transceiverManager.js.map +1 -1
- package/lib/webrtc/src/transport/dtls.d.ts +147 -1
- package/lib/webrtc/src/transport/dtls.js +446 -50
- package/lib/webrtc/src/transport/dtls.js.map +1 -1
- package/lib/webrtc/src/transport/ice.d.ts +71 -90
- package/lib/webrtc/src/transport/ice.js +250 -42
- package/lib/webrtc/src/transport/ice.js.map +1 -1
- package/lib/webrtc/src/transport/sctp.d.ts +25 -0
- package/lib/webrtc/src/transport/sctp.js +153 -22
- package/lib/webrtc/src/transport/sctp.js.map +1 -1
- package/lib/webrtc/src/utils.d.ts +69 -3
- package/lib/webrtc/src/utils.js +105 -16
- package/lib/webrtc/src/utils.js.map +1 -1
- package/package.json +9 -6
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RTCIceParameters = exports.IceCandidate = exports.RTCIceCandidate = exports.RTCIceGatherer = exports.IceGathererStates = exports.IceTransportStates = exports.RTCIceTransport = void 0;
|
|
4
|
+
exports.iceCandidateErrorDetails = iceCandidateErrorDetails;
|
|
4
5
|
exports.candidateFromIce = candidateFromIce;
|
|
5
6
|
exports.candidateToIce = candidateToIce;
|
|
6
7
|
const crypto_1 = require("crypto");
|
|
@@ -60,9 +61,13 @@ function mapCandidatePairState(state) {
|
|
|
60
61
|
* and send target never change. A response for an earlier checklist is
|
|
61
62
|
* ignored.
|
|
62
63
|
* - Ends at the final answer, which recreates the live agent with the staged
|
|
63
|
-
* credentials and checks the answered generation from scratch
|
|
64
|
-
*
|
|
65
|
-
*
|
|
64
|
+
* credentials and checks the answered generation from scratch (when the
|
|
65
|
+
* answer keeps the pranswer's credentials and the commit keeps that pair's
|
|
66
|
+
* local socket, the controlling side nominates only the 5-tuple its
|
|
67
|
+
* provisional checklist nominated, which the peer may have selected
|
|
68
|
+
* already, and fails if it cannot), or at rollback / a
|
|
69
|
+
* replacement offer / selecting another generation, which stops its checks
|
|
70
|
+
* and keeps the live generation.
|
|
66
71
|
*
|
|
67
72
|
* A first negotiation and transports created for a proposal have no
|
|
68
73
|
* provisional generation; they connect normally from the pranswer. The
|
|
@@ -77,8 +82,14 @@ function mapCandidatePairState(state) {
|
|
|
77
82
|
* allocation replaces and closes the previous one) and trickles them. A
|
|
78
83
|
* restart's background gathering that a later restart or `close()` replaced
|
|
79
84
|
* signals nothing more. ICE server settings changed after gathering take
|
|
80
|
-
* effect at the next restart (JSEP 4.1.18)
|
|
81
|
-
*
|
|
85
|
+
* effect at the next restart (JSEP 4.1.18): the restart generation carries
|
|
86
|
+
* only the kept candidates a fresh gathering with them would produce (none
|
|
87
|
+
* but relay for a relay-only policy, no TCP host candidates without useTcp),
|
|
88
|
+
* in its description and at the commit alike. Settings changed after the
|
|
89
|
+
* description was created still apply to that restart's gathering at the
|
|
90
|
+
* commit: a kept socket they exclude is closed then, so a candidate the
|
|
91
|
+
* description announced for it fails its checks. The old selected pair is
|
|
92
|
+
* dropped at the commit, so RTP pauses until the new generation nominates.
|
|
82
93
|
*/
|
|
83
94
|
class RTCIceTransport {
|
|
84
95
|
constructor(iceGather) {
|
|
@@ -86,7 +97,7 @@ class RTCIceTransport {
|
|
|
86
97
|
enumerable: true,
|
|
87
98
|
configurable: true,
|
|
88
99
|
writable: true,
|
|
89
|
-
value:
|
|
100
|
+
value: void 0
|
|
90
101
|
});
|
|
91
102
|
Object.defineProperty(this, "id", {
|
|
92
103
|
enumerable: true,
|
|
@@ -124,6 +135,12 @@ class RTCIceTransport {
|
|
|
124
135
|
writable: true,
|
|
125
136
|
value: void 0
|
|
126
137
|
});
|
|
138
|
+
Object.defineProperty(this, "startPromise", {
|
|
139
|
+
enumerable: true,
|
|
140
|
+
configurable: true,
|
|
141
|
+
writable: true,
|
|
142
|
+
value: void 0
|
|
143
|
+
});
|
|
127
144
|
/**
|
|
128
145
|
* Connectivity checks were started for the current generation. A restart
|
|
129
146
|
* resets it; the state alone cannot tell (an agent that finished gathering
|
|
@@ -231,6 +248,20 @@ class RTCIceTransport {
|
|
|
231
248
|
writable: true,
|
|
232
249
|
value: new common_1.Event()
|
|
233
250
|
});
|
|
251
|
+
/** A configured STUN / TURN URL failed while gathering (see RTCIceGatherer.onIceCandidateError). */
|
|
252
|
+
Object.defineProperty(this, "onIceCandidateError", {
|
|
253
|
+
enumerable: true,
|
|
254
|
+
configurable: true,
|
|
255
|
+
writable: true,
|
|
256
|
+
value: new common_1.Event()
|
|
257
|
+
});
|
|
258
|
+
/** URLs of a STUN / TURN server that answered while gathering (see RTCIceGatherer.onIceServerReached). */
|
|
259
|
+
Object.defineProperty(this, "onIceServerReached", {
|
|
260
|
+
enumerable: true,
|
|
261
|
+
configurable: true,
|
|
262
|
+
writable: true,
|
|
263
|
+
value: new common_1.Event()
|
|
264
|
+
});
|
|
234
265
|
Object.defineProperty(this, "onNegotiationNeeded", {
|
|
235
266
|
enumerable: true,
|
|
236
267
|
configurable: true,
|
|
@@ -271,6 +302,7 @@ class RTCIceTransport {
|
|
|
271
302
|
}
|
|
272
303
|
}
|
|
273
304
|
});
|
|
305
|
+
this.iceGather = iceGather;
|
|
274
306
|
this.connection = this.iceGather.connection;
|
|
275
307
|
this.connection.stateChanged.subscribe((state) => {
|
|
276
308
|
this.setState(state);
|
|
@@ -281,6 +313,16 @@ class RTCIceTransport {
|
|
|
281
313
|
else
|
|
282
314
|
this.onIceCandidate.execute(candidate);
|
|
283
315
|
};
|
|
316
|
+
this.iceGather.onIceCandidateError = (error) => {
|
|
317
|
+
if (this.state === "closed")
|
|
318
|
+
return;
|
|
319
|
+
this.onIceCandidateError.execute(error);
|
|
320
|
+
};
|
|
321
|
+
this.iceGather.onIceServerReached = (urls) => {
|
|
322
|
+
if (this.state === "closed")
|
|
323
|
+
return;
|
|
324
|
+
this.onIceServerReached.execute(urls);
|
|
325
|
+
};
|
|
284
326
|
this.iceGather.onGatheringStateChange.subscribe(() => {
|
|
285
327
|
this.ongatheringstatechange?.();
|
|
286
328
|
this.events.emit("gatheringstatechange");
|
|
@@ -381,7 +423,17 @@ class RTCIceTransport {
|
|
|
381
423
|
// password, as the agent's own restart does.
|
|
382
424
|
const prefix = this.connection.options.localPasswordPrefix ?? "";
|
|
383
425
|
const password = prefix + random.slice(prefix.length);
|
|
384
|
-
|
|
426
|
+
// The generation gathers with the options set for it (a relay-only
|
|
427
|
+
// policy, useTcp turned off), so it carries only the kept candidates a
|
|
428
|
+
// fresh gathering with them would produce; the agent re-advertises the
|
|
429
|
+
// same ones at the commit.
|
|
430
|
+
const iceServers = this.nextGatherIceServers;
|
|
431
|
+
const gatherOptions = iceServers
|
|
432
|
+
? (0, src_1.mergeIceServerOptions)(this.connection.options, iceServers)
|
|
433
|
+
: this.connection.options;
|
|
434
|
+
const candidates = this.iceGather.localCandidates
|
|
435
|
+
.filter((candidate) => (0, src_1.isCandidateAllowedByGatherOptions)({ type: candidate.type, transport: candidate.protocol }, gatherOptions))
|
|
436
|
+
.map((candidate) => {
|
|
385
437
|
const copy = Object.assign(new IceCandidate(candidate.component, candidate.foundation, candidate.ip, candidate.port, candidate.priority, candidate.protocol, candidate.type, this.connection.generation + 1, usernameFragment), {
|
|
386
438
|
relatedAddress: candidate.relatedAddress,
|
|
387
439
|
relatedPort: candidate.relatedPort,
|
|
@@ -396,6 +448,7 @@ class RTCIceTransport {
|
|
|
396
448
|
emitted: false,
|
|
397
449
|
answering,
|
|
398
450
|
createdBy: answering ? "answer" : "offer",
|
|
451
|
+
gatherOptions,
|
|
399
452
|
};
|
|
400
453
|
// The previous description of this kind is no longer the latest one.
|
|
401
454
|
for (const [ufrag, previous] of this.localGenerations) {
|
|
@@ -408,7 +461,7 @@ class RTCIceTransport {
|
|
|
408
461
|
this.stagedLocalRestart = generation;
|
|
409
462
|
// Existing sockets can respond to provisional STUN checks for the new
|
|
410
463
|
// ufrag while the old generation continues to carry media.
|
|
411
|
-
this.connection.stageLocalCredentials?.(usernameFragment, password);
|
|
464
|
+
this.connection.stageLocalCredentials?.(usernameFragment, password, gatherOptions);
|
|
412
465
|
}
|
|
413
466
|
/**
|
|
414
467
|
* The local generation a description with these credentials carries:
|
|
@@ -449,7 +502,7 @@ class RTCIceTransport {
|
|
|
449
502
|
return;
|
|
450
503
|
this.unselectLocalRestart();
|
|
451
504
|
this.stagedLocalRestart = generation;
|
|
452
|
-
this.connection.stageLocalCredentials?.(generation.usernameFragment, generation.password);
|
|
505
|
+
this.connection.stageLocalCredentials?.(generation.usernameFragment, generation.password, generation.gatherOptions);
|
|
453
506
|
}
|
|
454
507
|
/** Stop answering checks for the selected generation; it stays registered. */
|
|
455
508
|
unselectLocalRestart() {
|
|
@@ -528,7 +581,7 @@ class RTCIceTransport {
|
|
|
528
581
|
this.unselectLocalRestart();
|
|
529
582
|
if (applied) {
|
|
530
583
|
this.stagedLocalRestart = applied;
|
|
531
|
-
this.connection.stageLocalCredentials?.(applied.usernameFragment, applied.password);
|
|
584
|
+
this.connection.stageLocalCredentials?.(applied.usernameFragment, applied.password, applied.gatherOptions);
|
|
532
585
|
}
|
|
533
586
|
}
|
|
534
587
|
/**
|
|
@@ -592,9 +645,14 @@ class RTCIceTransport {
|
|
|
592
645
|
getLocalCandidates() {
|
|
593
646
|
return this.connection.localCandidates.map((candidate) => candidateFromIce(candidate).toJSON());
|
|
594
647
|
}
|
|
648
|
+
/**
|
|
649
|
+
* The pair the agent selected (nominated), or null. A pair whose ordinary
|
|
650
|
+
* check succeeded is not selected: while the controlling agent waits to
|
|
651
|
+
* nominate (regular nomination), after it gave up, or before the peer
|
|
652
|
+
* nominated, no pair is reported.
|
|
653
|
+
*/
|
|
595
654
|
getSelectedCandidatePair() {
|
|
596
|
-
const pair = this.connection.
|
|
597
|
-
this.connection.candidatePairs.find((candidate) => candidate.state === 3);
|
|
655
|
+
const pair = this.connection.nominated;
|
|
598
656
|
if (!pair) {
|
|
599
657
|
return null;
|
|
600
658
|
}
|
|
@@ -606,6 +664,24 @@ class RTCIceTransport {
|
|
|
606
664
|
getLocalParameters() {
|
|
607
665
|
return this.localParameters ?? null;
|
|
608
666
|
}
|
|
667
|
+
/**
|
|
668
|
+
* The `a=ice-options` tokens of the applied remote description for this
|
|
669
|
+
* transport (session level and its m-line), e.g. `trickle`, `ice2`.
|
|
670
|
+
*/
|
|
671
|
+
get remoteIceOptions() {
|
|
672
|
+
return this.connection.remoteIceOptions ?? [];
|
|
673
|
+
}
|
|
674
|
+
/**
|
|
675
|
+
* The remote declared the `ice2` ice-option (an RFC 8445 agent). Only
|
|
676
|
+
* informational: werift follows RFC 8445 regardless.
|
|
677
|
+
*/
|
|
678
|
+
get remoteIce2() {
|
|
679
|
+
return this.connection.remoteIce2 ?? false;
|
|
680
|
+
}
|
|
681
|
+
/** Internal: record the remote ice-options a remote description applied. */
|
|
682
|
+
setRemoteIceOptions(options) {
|
|
683
|
+
this.connection.setRemoteIceOptions?.(options);
|
|
684
|
+
}
|
|
609
685
|
getRemoteParameters() {
|
|
610
686
|
if (!this.connection.remoteUsername || !this.connection.remotePassword) {
|
|
611
687
|
return null;
|
|
@@ -685,6 +761,7 @@ class RTCIceTransport {
|
|
|
685
761
|
this.connection.restartRemote();
|
|
686
762
|
this.setState("new");
|
|
687
763
|
this.waitStart = undefined;
|
|
764
|
+
this.startPromise = undefined;
|
|
688
765
|
this.checksStarted = false;
|
|
689
766
|
}
|
|
690
767
|
restart(notifyNegotiation = true, applyNextGatherIceServers = true) {
|
|
@@ -698,6 +775,7 @@ class RTCIceTransport {
|
|
|
698
775
|
// SecureTransportManager aggregate iceGatheringState stays in sync.
|
|
699
776
|
this.iceGather.setGatheringState("new");
|
|
700
777
|
this.waitStart = undefined;
|
|
778
|
+
this.startPromise = undefined;
|
|
701
779
|
this.checksStarted = false;
|
|
702
780
|
if (notifyNegotiation)
|
|
703
781
|
this.onNegotiationNeeded.execute();
|
|
@@ -709,29 +787,32 @@ class RTCIceTransport {
|
|
|
709
787
|
if (!this.connection.remotePassword || !this.connection.remoteUsername) {
|
|
710
788
|
throw new Error("remoteParams missing");
|
|
711
789
|
}
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
790
|
+
// Concurrent callers for the same generation share the active checks and
|
|
791
|
+
// their result. Waiting for the event and then continuing would start a
|
|
792
|
+
// second connection attempt after the first one settles.
|
|
793
|
+
if (this.startPromise)
|
|
794
|
+
return this.startPromise;
|
|
715
795
|
const waitStart = new common_1.Event();
|
|
716
796
|
this.waitStart = waitStart;
|
|
717
797
|
this.checksStarted = true;
|
|
718
798
|
this.setState("checking");
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
catch (error) {
|
|
799
|
+
const startPromise = Promise.resolve()
|
|
800
|
+
.then(() => this.connection.connect())
|
|
801
|
+
.catch((error) => {
|
|
723
802
|
this.setState("failed");
|
|
724
803
|
throw error;
|
|
725
|
-
}
|
|
726
|
-
|
|
804
|
+
})
|
|
805
|
+
.finally(() => {
|
|
727
806
|
// A failed start releases its waiters too.
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
waitStart.complete();
|
|
731
|
-
}
|
|
807
|
+
waitStart.execute();
|
|
808
|
+
waitStart.complete();
|
|
732
809
|
if (this.waitStart === waitStart)
|
|
733
810
|
this.waitStart = undefined;
|
|
734
|
-
|
|
811
|
+
if (this.startPromise === startPromise)
|
|
812
|
+
this.startPromise = undefined;
|
|
813
|
+
});
|
|
814
|
+
this.startPromise = startPromise;
|
|
815
|
+
return startPromise;
|
|
735
816
|
}
|
|
736
817
|
/**
|
|
737
818
|
* Settles when the checks a running start() makes finish (at once if none run).
|
|
@@ -757,6 +838,8 @@ class RTCIceTransport {
|
|
|
757
838
|
}
|
|
758
839
|
this.onStateChange.complete();
|
|
759
840
|
this.onIceCandidate.complete();
|
|
841
|
+
this.onIceCandidateError.complete();
|
|
842
|
+
this.onIceServerReached.complete();
|
|
760
843
|
this.onNegotiationNeeded.complete();
|
|
761
844
|
}
|
|
762
845
|
async getStats(timestamp = (0, stats_1.getStatsTimestamp)(), transportId = (0, stats_1.generateStatsId)("transport", this.id)) {
|
|
@@ -855,7 +938,7 @@ class RTCIceGatherer {
|
|
|
855
938
|
enumerable: true,
|
|
856
939
|
configurable: true,
|
|
857
940
|
writable: true,
|
|
858
|
-
value:
|
|
941
|
+
value: void 0
|
|
859
942
|
});
|
|
860
943
|
Object.defineProperty(this, "onIceCandidate", {
|
|
861
944
|
enumerable: true,
|
|
@@ -863,6 +946,26 @@ class RTCIceGatherer {
|
|
|
863
946
|
writable: true,
|
|
864
947
|
value: () => { }
|
|
865
948
|
});
|
|
949
|
+
/**
|
|
950
|
+
* A server of the current generation's gathering failed: called once per
|
|
951
|
+
* configured URL naming it (see iceCandidateErrorDetails).
|
|
952
|
+
*/
|
|
953
|
+
Object.defineProperty(this, "onIceCandidateError", {
|
|
954
|
+
enumerable: true,
|
|
955
|
+
configurable: true,
|
|
956
|
+
writable: true,
|
|
957
|
+
value: () => { }
|
|
958
|
+
});
|
|
959
|
+
/**
|
|
960
|
+
* A server of the current generation's gathering answered (a candidate or
|
|
961
|
+
* an error response): called with the URLs naming it.
|
|
962
|
+
*/
|
|
963
|
+
Object.defineProperty(this, "onIceServerReached", {
|
|
964
|
+
enumerable: true,
|
|
965
|
+
configurable: true,
|
|
966
|
+
writable: true,
|
|
967
|
+
value: () => { }
|
|
968
|
+
});
|
|
866
969
|
Object.defineProperty(this, "gatheringState", {
|
|
867
970
|
enumerable: true,
|
|
868
971
|
configurable: true,
|
|
@@ -875,30 +978,106 @@ class RTCIceGatherer {
|
|
|
875
978
|
writable: true,
|
|
876
979
|
value: void 0
|
|
877
980
|
});
|
|
981
|
+
Object.defineProperty(this, "unreachableUrls", {
|
|
982
|
+
enumerable: true,
|
|
983
|
+
configurable: true,
|
|
984
|
+
writable: true,
|
|
985
|
+
value: { generation: -1, urls: new Set() }
|
|
986
|
+
});
|
|
878
987
|
Object.defineProperty(this, "onGatheringStateChange", {
|
|
879
988
|
enumerable: true,
|
|
880
989
|
configurable: true,
|
|
881
990
|
writable: true,
|
|
882
991
|
value: new common_1.Event()
|
|
883
992
|
});
|
|
993
|
+
this.options = options;
|
|
884
994
|
this.connection = new src_1.Connection(false, this.options);
|
|
885
995
|
this.connection.onIceCandidate.subscribe((candidate) => {
|
|
886
996
|
this.onIceCandidate(candidateFromIce(candidate));
|
|
887
997
|
});
|
|
998
|
+
this.connection.onIceServerReached?.subscribe((info) => {
|
|
999
|
+
if (info.generation !== this.connection.generation ||
|
|
1000
|
+
this.connection.state === "closed") {
|
|
1001
|
+
return;
|
|
1002
|
+
}
|
|
1003
|
+
const urls = [...new Set(info.server.urls ?? [])];
|
|
1004
|
+
if (urls.length === 0)
|
|
1005
|
+
return;
|
|
1006
|
+
try {
|
|
1007
|
+
this.onIceServerReached(urls);
|
|
1008
|
+
}
|
|
1009
|
+
catch (error) {
|
|
1010
|
+
log("onIceServerReached listener threw", error);
|
|
1011
|
+
}
|
|
1012
|
+
});
|
|
1013
|
+
this.connection.onIceCandidateError?.subscribe((info) => {
|
|
1014
|
+
// Only the generation gathering now (the ICE agent drops stale ones).
|
|
1015
|
+
if (info.generation !== this.connection.generation ||
|
|
1016
|
+
this.connection.state === "closed") {
|
|
1017
|
+
return;
|
|
1018
|
+
}
|
|
1019
|
+
// W3C: a 701 (server not reached) fires once per server URL while
|
|
1020
|
+
// gathering, however many local sockets queried the server.
|
|
1021
|
+
if (info.errorCode === 701) {
|
|
1022
|
+
if (this.unreachableUrls.generation !== info.generation) {
|
|
1023
|
+
this.unreachableUrls = {
|
|
1024
|
+
generation: info.generation,
|
|
1025
|
+
urls: new Set(),
|
|
1026
|
+
};
|
|
1027
|
+
}
|
|
1028
|
+
const { urls } = this.unreachableUrls;
|
|
1029
|
+
const fresh = (info.server.urls ?? []).filter((url) => !urls.has(url));
|
|
1030
|
+
for (const url of fresh)
|
|
1031
|
+
urls.add(url);
|
|
1032
|
+
if (fresh.length === 0)
|
|
1033
|
+
return;
|
|
1034
|
+
info = { ...info, server: { ...info.server, urls: fresh } };
|
|
1035
|
+
}
|
|
1036
|
+
for (const details of iceCandidateErrorDetails(info, !!this.connection.options.forceTurn)) {
|
|
1037
|
+
try {
|
|
1038
|
+
this.onIceCandidateError(details);
|
|
1039
|
+
}
|
|
1040
|
+
catch (error) {
|
|
1041
|
+
// A throwing listener must not hide the other URLs' errors.
|
|
1042
|
+
log("onIceCandidateError listener threw", error);
|
|
1043
|
+
}
|
|
1044
|
+
}
|
|
1045
|
+
});
|
|
888
1046
|
}
|
|
889
1047
|
async gather() {
|
|
890
1048
|
if (this.gatheringState === "new") {
|
|
891
1049
|
this.setState("gathering");
|
|
892
1050
|
const generation = this.connection.generation;
|
|
893
1051
|
await this.connection.gatherCandidates();
|
|
894
|
-
//
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
1052
|
+
// ICE restart で世代が置き換わった場合は新世代自身の完了通知に任せる。
|
|
1053
|
+
if (this.connection.generation !== generation)
|
|
1054
|
+
return;
|
|
1055
|
+
// gathering 中に閉じた transport は候補を終え、集約状態を先へ進める。
|
|
1056
|
+
if (this.connection.state === "closed") {
|
|
1057
|
+
this.setState("complete");
|
|
898
1058
|
return;
|
|
899
1059
|
}
|
|
900
|
-
this.
|
|
901
|
-
|
|
1060
|
+
const replaced = () => this.connection.generation !== generation ||
|
|
1061
|
+
this.connection.state === "closed";
|
|
1062
|
+
const complete = () => {
|
|
1063
|
+
this.onIceCandidate(undefined);
|
|
1064
|
+
this.setState("complete");
|
|
1065
|
+
};
|
|
1066
|
+
if (this.connection.localCandidatesEnd ||
|
|
1067
|
+
!this.connection.waitForLocalCandidatesEnd) {
|
|
1068
|
+
complete();
|
|
1069
|
+
return;
|
|
1070
|
+
}
|
|
1071
|
+
// The representative sockets are done, so the description need not
|
|
1072
|
+
// wait; the other sockets' server-reflexive candidates trickle and
|
|
1073
|
+
// end-of-candidates follows them.
|
|
1074
|
+
void this.connection
|
|
1075
|
+
.waitForLocalCandidatesEnd()
|
|
1076
|
+
.then(() => {
|
|
1077
|
+
if (!replaced() && this.connection.localCandidatesEnd)
|
|
1078
|
+
complete();
|
|
1079
|
+
})
|
|
1080
|
+
.catch((error) => log("gathering failed", error));
|
|
902
1081
|
}
|
|
903
1082
|
}
|
|
904
1083
|
setIceServers(options) {
|
|
@@ -931,6 +1110,26 @@ class RTCIceGatherer {
|
|
|
931
1110
|
}
|
|
932
1111
|
}
|
|
933
1112
|
exports.RTCIceGatherer = RTCIceGatherer;
|
|
1113
|
+
/**
|
|
1114
|
+
* The `icecandidateerror` members of an ICE agent's server failure: one per
|
|
1115
|
+
* URL of the server (the configured ones, or the synthesized URL of the
|
|
1116
|
+
* built-in default STUN server). The local address is given only when the
|
|
1117
|
+
* agent knows it and the ICE transport policy is not "relay"; otherwise
|
|
1118
|
+
* `address` and `port` are both `null` (W3C: a null address has a null
|
|
1119
|
+
* port).
|
|
1120
|
+
*/
|
|
1121
|
+
function iceCandidateErrorDetails(info, relayOnly) {
|
|
1122
|
+
const urls = [...new Set(info.server.urls ?? [])];
|
|
1123
|
+
const local = !relayOnly && info.address !== undefined && info.port !== undefined
|
|
1124
|
+
? { address: info.address, port: info.port }
|
|
1125
|
+
: { address: null, port: null };
|
|
1126
|
+
return urls.map((url) => ({
|
|
1127
|
+
...local,
|
|
1128
|
+
url,
|
|
1129
|
+
errorCode: info.errorCode,
|
|
1130
|
+
errorText: info.errorText,
|
|
1131
|
+
}));
|
|
1132
|
+
}
|
|
934
1133
|
function candidateFromIce(c) {
|
|
935
1134
|
const candidate = new IceCandidate(c.component, c.foundation, c.host, c.port, c.priority, c.transport, c.type, c.generation, c.ufrag);
|
|
936
1135
|
candidate.relatedAddress = c.relatedAddress;
|
|
@@ -1090,55 +1289,55 @@ class IceCandidate {
|
|
|
1090
1289
|
enumerable: true,
|
|
1091
1290
|
configurable: true,
|
|
1092
1291
|
writable: true,
|
|
1093
|
-
value:
|
|
1292
|
+
value: void 0
|
|
1094
1293
|
});
|
|
1095
1294
|
Object.defineProperty(this, "foundation", {
|
|
1096
1295
|
enumerable: true,
|
|
1097
1296
|
configurable: true,
|
|
1098
1297
|
writable: true,
|
|
1099
|
-
value:
|
|
1298
|
+
value: void 0
|
|
1100
1299
|
});
|
|
1101
1300
|
Object.defineProperty(this, "ip", {
|
|
1102
1301
|
enumerable: true,
|
|
1103
1302
|
configurable: true,
|
|
1104
1303
|
writable: true,
|
|
1105
|
-
value:
|
|
1304
|
+
value: void 0
|
|
1106
1305
|
});
|
|
1107
1306
|
Object.defineProperty(this, "port", {
|
|
1108
1307
|
enumerable: true,
|
|
1109
1308
|
configurable: true,
|
|
1110
1309
|
writable: true,
|
|
1111
|
-
value:
|
|
1310
|
+
value: void 0
|
|
1112
1311
|
});
|
|
1113
1312
|
Object.defineProperty(this, "priority", {
|
|
1114
1313
|
enumerable: true,
|
|
1115
1314
|
configurable: true,
|
|
1116
1315
|
writable: true,
|
|
1117
|
-
value:
|
|
1316
|
+
value: void 0
|
|
1118
1317
|
});
|
|
1119
1318
|
Object.defineProperty(this, "protocol", {
|
|
1120
1319
|
enumerable: true,
|
|
1121
1320
|
configurable: true,
|
|
1122
1321
|
writable: true,
|
|
1123
|
-
value:
|
|
1322
|
+
value: void 0
|
|
1124
1323
|
});
|
|
1125
1324
|
Object.defineProperty(this, "type", {
|
|
1126
1325
|
enumerable: true,
|
|
1127
1326
|
configurable: true,
|
|
1128
1327
|
writable: true,
|
|
1129
|
-
value:
|
|
1328
|
+
value: void 0
|
|
1130
1329
|
});
|
|
1131
1330
|
Object.defineProperty(this, "generation", {
|
|
1132
1331
|
enumerable: true,
|
|
1133
1332
|
configurable: true,
|
|
1134
1333
|
writable: true,
|
|
1135
|
-
value:
|
|
1334
|
+
value: void 0
|
|
1136
1335
|
});
|
|
1137
1336
|
Object.defineProperty(this, "ufrag", {
|
|
1138
1337
|
enumerable: true,
|
|
1139
1338
|
configurable: true,
|
|
1140
1339
|
writable: true,
|
|
1141
|
-
value:
|
|
1340
|
+
value: void 0
|
|
1142
1341
|
});
|
|
1143
1342
|
// """
|
|
1144
1343
|
// The :class:`RTCIceCandidate` interface represents a candidate Interactive
|
|
@@ -1175,6 +1374,15 @@ class IceCandidate {
|
|
|
1175
1374
|
writable: true,
|
|
1176
1375
|
value: void 0
|
|
1177
1376
|
});
|
|
1377
|
+
this.component = component;
|
|
1378
|
+
this.foundation = foundation;
|
|
1379
|
+
this.ip = ip;
|
|
1380
|
+
this.port = port;
|
|
1381
|
+
this.priority = priority;
|
|
1382
|
+
this.protocol = protocol;
|
|
1383
|
+
this.type = type;
|
|
1384
|
+
this.generation = generation;
|
|
1385
|
+
this.ufrag = ufrag;
|
|
1178
1386
|
}
|
|
1179
1387
|
/** The parsed fields are validated from these typed values, not by reparsing. */
|
|
1180
1388
|
toJSON() {
|