werift 0.19.4 → 0.19.5
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/lib/common/src/binary.d.ts +0 -1
- package/lib/common/src/binary.js +14 -14
- package/lib/common/src/binary.js.map +1 -1
- package/lib/common/src/network.d.ts +1 -2
- package/lib/common/src/network.js +4 -4
- package/lib/common/src/network.js.map +1 -1
- package/lib/common/src/number.js +10 -10
- package/lib/common/src/number.js.map +1 -1
- package/lib/dtls/src/cipher/create.d.ts +1 -1
- package/lib/dtls/src/cipher/create.js +2 -3
- package/lib/dtls/src/cipher/create.js.map +1 -1
- package/lib/dtls/src/cipher/ec.d.ts +0 -1
- package/lib/dtls/src/cipher/key-exchange.js +7 -7
- package/lib/dtls/src/cipher/key-exchange.js.map +1 -1
- package/lib/dtls/src/cipher/namedCurve.d.ts +1 -2
- package/lib/dtls/src/cipher/namedCurve.js +1 -2
- package/lib/dtls/src/cipher/namedCurve.js.map +1 -1
- package/lib/dtls/src/cipher/prf.d.ts +1 -2
- package/lib/dtls/src/cipher/prf.js +11 -12
- package/lib/dtls/src/cipher/prf.js.map +1 -1
- package/lib/dtls/src/cipher/suites/abstract.d.ts +1 -2
- package/lib/dtls/src/cipher/suites/abstract.js.map +1 -1
- package/lib/dtls/src/cipher/suites/aead.d.ts +1 -2
- package/lib/dtls/src/cipher/suites/aead.js.map +1 -1
- package/lib/dtls/src/client.d.ts +1 -1
- package/lib/dtls/src/client.js.map +1 -1
- package/lib/dtls/src/context/cipher.d.ts +6 -7
- package/lib/dtls/src/context/cipher.js +5 -3
- package/lib/dtls/src/context/cipher.js.map +1 -1
- package/lib/dtls/src/context/dtls.d.ts +5 -6
- package/lib/dtls/src/context/dtls.js +1 -2
- package/lib/dtls/src/context/dtls.js.map +1 -1
- package/lib/dtls/src/context/transport.d.ts +1 -2
- package/lib/dtls/src/context/transport.js.map +1 -1
- package/lib/dtls/src/flight/client/flight1.d.ts +4 -4
- package/lib/dtls/src/flight/client/flight1.js.map +1 -1
- package/lib/dtls/src/flight/client/flight3.d.ts +3 -3
- package/lib/dtls/src/flight/client/flight3.js.map +1 -1
- package/lib/dtls/src/flight/client/flight5.d.ts +4 -4
- package/lib/dtls/src/flight/client/flight5.js.map +1 -1
- package/lib/dtls/src/flight/flight.d.ts +3 -4
- package/lib/dtls/src/flight/flight.js.map +1 -1
- package/lib/dtls/src/flight/server/flight2.d.ts +4 -4
- package/lib/dtls/src/flight/server/flight2.js.map +1 -1
- package/lib/dtls/src/flight/server/flight4.d.ts +5 -5
- package/lib/dtls/src/flight/server/flight4.js.map +1 -1
- package/lib/dtls/src/flight/server/flight6.d.ts +4 -4
- package/lib/dtls/src/flight/server/flight6.js.map +1 -1
- package/lib/dtls/src/handshake/extensions/ellipticCurves.d.ts +1 -2
- package/lib/dtls/src/handshake/extensions/ellipticCurves.js.map +1 -1
- package/lib/dtls/src/handshake/extensions/renegotiationIndication.d.ts +0 -1
- package/lib/dtls/src/handshake/extensions/signature.d.ts +1 -2
- package/lib/dtls/src/handshake/extensions/signature.js.map +1 -1
- package/lib/dtls/src/handshake/extensions/useSrtp.d.ts +1 -2
- package/lib/dtls/src/handshake/extensions/useSrtp.js.map +1 -1
- package/lib/dtls/src/handshake/message/alert.d.ts +0 -1
- package/lib/dtls/src/handshake/message/alert.js.map +1 -1
- package/lib/dtls/src/handshake/message/certificate.d.ts +1 -2
- package/lib/dtls/src/handshake/message/certificate.js.map +1 -1
- package/lib/dtls/src/handshake/message/changeCipherSpec.d.ts +0 -1
- package/lib/dtls/src/handshake/message/client/certificateVerify.d.ts +2 -3
- package/lib/dtls/src/handshake/message/client/certificateVerify.js.map +1 -1
- package/lib/dtls/src/handshake/message/client/hello.d.ts +1 -2
- package/lib/dtls/src/handshake/message/client/hello.js.map +1 -1
- package/lib/dtls/src/handshake/message/client/keyExchange.d.ts +1 -2
- package/lib/dtls/src/handshake/message/client/keyExchange.js.map +1 -1
- package/lib/dtls/src/handshake/message/finished.d.ts +1 -2
- package/lib/dtls/src/handshake/message/finished.js.map +1 -1
- package/lib/dtls/src/handshake/message/server/certificateRequest.d.ts +2 -3
- package/lib/dtls/src/handshake/message/server/certificateRequest.js.map +1 -1
- package/lib/dtls/src/handshake/message/server/hello.d.ts +2 -3
- package/lib/dtls/src/handshake/message/server/hello.js.map +1 -1
- package/lib/dtls/src/handshake/message/server/helloDone.d.ts +1 -2
- package/lib/dtls/src/handshake/message/server/helloDone.js.map +1 -1
- package/lib/dtls/src/handshake/message/server/helloVerifyRequest.d.ts +1 -2
- package/lib/dtls/src/handshake/message/server/helloVerifyRequest.js.map +1 -1
- package/lib/dtls/src/handshake/message/server/keyExchange.d.ts +2 -3
- package/lib/dtls/src/handshake/message/server/keyExchange.js.map +1 -1
- package/lib/dtls/src/handshake/random.d.ts +0 -1
- package/lib/dtls/src/helper.d.ts +0 -1
- package/lib/dtls/src/helper.js +3 -3
- package/lib/dtls/src/helper.js.map +1 -1
- package/lib/dtls/src/record/builder.d.ts +2 -3
- package/lib/dtls/src/record/builder.js +2 -4
- package/lib/dtls/src/record/builder.js.map +1 -1
- package/lib/dtls/src/record/message/fragment.d.ts +1 -2
- package/lib/dtls/src/record/message/fragment.js.map +1 -1
- package/lib/dtls/src/record/message/header.d.ts +0 -1
- package/lib/dtls/src/record/message/plaintext.d.ts +0 -1
- package/lib/dtls/src/record/receive.d.ts +2 -3
- package/lib/dtls/src/record/receive.js.map +1 -1
- package/lib/dtls/src/server.d.ts +1 -1
- package/lib/dtls/src/server.js.map +1 -1
- package/lib/dtls/src/socket.d.ts +5 -6
- package/lib/dtls/src/socket.js +17 -23
- package/lib/dtls/src/socket.js.map +1 -1
- package/lib/dtls/src/transport.d.ts +1 -3
- package/lib/dtls/src/transport.js.map +1 -1
- package/lib/dtls/src/typings/domain.d.ts +2 -3
- package/lib/dtls/src/typings/domain.js.map +1 -1
- package/lib/dtls/src/util/binary.d.ts +0 -1
- package/lib/dtls/src/util/binary.js +1 -2
- package/lib/dtls/src/util/binary.js.map +1 -1
- package/lib/ice/src/candidate.js +3 -3
- package/lib/ice/src/candidate.js.map +1 -1
- package/lib/ice/src/dns/lookup.d.ts +1 -1
- package/lib/ice/src/dns/lookup.js +1 -0
- package/lib/ice/src/dns/lookup.js.map +1 -1
- package/lib/ice/src/exceptions.js.map +1 -1
- package/lib/ice/src/helper.d.ts +0 -1
- package/lib/ice/src/helper.js +5 -5
- package/lib/ice/src/helper.js.map +1 -1
- package/lib/ice/src/ice.d.ts +3 -2
- package/lib/ice/src/ice.js +25 -16
- package/lib/ice/src/ice.js.map +1 -1
- package/lib/ice/src/stun/attributes.d.ts +0 -1
- package/lib/ice/src/stun/attributes.js +5 -5
- package/lib/ice/src/stun/attributes.js.map +1 -1
- package/lib/ice/src/stun/message.d.ts +0 -1
- package/lib/ice/src/stun/message.js +2 -2
- package/lib/ice/src/stun/message.js.map +1 -1
- package/lib/ice/src/stun/protocol.d.ts +0 -1
- package/lib/ice/src/stun/transaction.d.ts +1 -1
- package/lib/ice/src/transport.d.ts +1 -4
- package/lib/ice/src/turn/protocol.d.ts +1 -2
- package/lib/ice/src/turn/protocol.js +5 -4
- package/lib/ice/src/turn/protocol.js.map +1 -1
- package/lib/ice/src/types/model.d.ts +0 -1
- package/lib/ice/src/utils.js +3 -4
- package/lib/ice/src/utils.js.map +1 -1
- package/lib/rtp/src/codec/av1.d.ts +1 -2
- package/lib/rtp/src/codec/av1.js +2 -2
- package/lib/rtp/src/codec/av1.js.map +1 -1
- package/lib/rtp/src/codec/base.d.ts +1 -2
- package/lib/rtp/src/codec/base.js.map +1 -1
- package/lib/rtp/src/codec/h264.d.ts +2 -3
- package/lib/rtp/src/codec/h264.js.map +1 -1
- package/lib/rtp/src/codec/index.d.ts +1 -2
- package/lib/rtp/src/codec/index.js +2 -2
- package/lib/rtp/src/codec/index.js.map +1 -1
- package/lib/rtp/src/codec/opus.d.ts +2 -3
- package/lib/rtp/src/codec/opus.js.map +1 -1
- package/lib/rtp/src/codec/vp8.d.ts +2 -3
- package/lib/rtp/src/codec/vp8.js +1 -1
- package/lib/rtp/src/codec/vp8.js.map +1 -1
- package/lib/rtp/src/codec/vp9.d.ts +2 -3
- package/lib/rtp/src/codec/vp9.js +1 -1
- package/lib/rtp/src/codec/vp9.js.map +1 -1
- package/lib/rtp/src/extra/container/mp4/h264.d.ts +0 -1
- package/lib/rtp/src/extra/container/mp4/h264.js +2 -2
- package/lib/rtp/src/extra/container/mp4/h264.js.map +1 -1
- package/lib/rtp/src/extra/container/mp4/mp4box.d.ts +1 -1
- package/lib/rtp/src/extra/container/mp4/mp4box.js +3 -3
- package/lib/rtp/src/extra/container/mp4/mp4box.js.map +1 -1
- package/lib/rtp/src/extra/container/ogg/parser.d.ts +0 -1
- package/lib/rtp/src/extra/container/webm/container.d.ts +0 -1
- package/lib/rtp/src/extra/container/webm/container.js +2 -3
- package/lib/rtp/src/extra/container/webm/container.js.map +1 -1
- package/lib/rtp/src/extra/container/webm/ebml/typedArrayUtils.js +2 -2
- package/lib/rtp/src/extra/container/webm/ebml/typedArrayUtils.js.map +1 -1
- package/lib/rtp/src/extra/processor/depacketizer.d.ts +2 -3
- package/lib/rtp/src/extra/processor/depacketizer.js.map +1 -1
- package/lib/rtp/src/extra/processor/depacketizerCallback.d.ts +1 -1
- package/lib/rtp/src/extra/processor/depacketizerCallback.js.map +1 -1
- package/lib/rtp/src/extra/processor/depacketizerTransformer.d.ts +2 -3
- package/lib/rtp/src/extra/processor/depacketizerTransformer.js.map +1 -1
- package/lib/rtp/src/extra/processor/dtx.d.ts +2 -3
- package/lib/rtp/src/extra/processor/dtx.js.map +1 -1
- package/lib/rtp/src/extra/processor/dtxCallback.js.map +1 -1
- package/lib/rtp/src/extra/processor/interface.d.ts +2 -2
- package/lib/rtp/src/extra/processor/jitterBuffer.d.ts +2 -2
- package/lib/rtp/src/extra/processor/jitterBuffer.js.map +1 -1
- package/lib/rtp/src/extra/processor/jitterBufferCallback.d.ts +1 -1
- package/lib/rtp/src/extra/processor/jitterBufferCallback.js.map +1 -1
- package/lib/rtp/src/extra/processor/jitterBufferTransformer.d.ts +1 -2
- package/lib/rtp/src/extra/processor/jitterBufferTransformer.js.map +1 -1
- package/lib/rtp/src/extra/processor/lipsync.d.ts +3 -4
- package/lib/rtp/src/extra/processor/lipsync.js +2 -2
- package/lib/rtp/src/extra/processor/lipsync.js.map +1 -1
- package/lib/rtp/src/extra/processor/lipsyncCallback.d.ts +1 -1
- package/lib/rtp/src/extra/processor/lipsyncCallback.js.map +1 -1
- package/lib/rtp/src/extra/processor/mp4.d.ts +2 -3
- package/lib/rtp/src/extra/processor/mp4.js.map +1 -1
- package/lib/rtp/src/extra/processor/mp4Callback.d.ts +2 -2
- package/lib/rtp/src/extra/processor/mp4Callback.js.map +1 -1
- package/lib/rtp/src/extra/processor/mute.d.ts +2 -3
- package/lib/rtp/src/extra/processor/mute.js.map +1 -1
- package/lib/rtp/src/extra/processor/muteCallback.d.ts +2 -2
- package/lib/rtp/src/extra/processor/muteCallback.js.map +1 -1
- package/lib/rtp/src/extra/processor/nack.d.ts +2 -2
- package/lib/rtp/src/extra/processor/nack.js.map +1 -1
- package/lib/rtp/src/extra/processor/nackHandlerCallback.js.map +1 -1
- package/lib/rtp/src/extra/processor/ntpTime.d.ts +2 -2
- package/lib/rtp/src/extra/processor/ntpTime.js.map +1 -1
- package/lib/rtp/src/extra/processor/ntpTimeCallback.d.ts +1 -1
- package/lib/rtp/src/extra/processor/ntpTimeCallback.js.map +1 -1
- package/lib/rtp/src/extra/processor/rtcpCallback.d.ts +2 -2
- package/lib/rtp/src/extra/processor/rtcpCallback.js.map +1 -1
- package/lib/rtp/src/extra/processor/rtpCallback.d.ts +1 -2
- package/lib/rtp/src/extra/processor/rtpCallback.js.map +1 -1
- package/lib/rtp/src/extra/processor/rtpStream.d.ts +2 -4
- package/lib/rtp/src/extra/processor/rtpStream.js.map +1 -1
- package/lib/rtp/src/extra/processor/rtpTime.d.ts +2 -2
- package/lib/rtp/src/extra/processor/rtpTime.js.map +1 -1
- package/lib/rtp/src/extra/processor/rtpTimeCallback.d.ts +1 -1
- package/lib/rtp/src/extra/processor/rtpTimeCallback.js.map +1 -1
- package/lib/rtp/src/extra/processor/webm.d.ts +2 -3
- package/lib/rtp/src/extra/processor/webm.js +2 -2
- package/lib/rtp/src/extra/processor/webm.js.map +1 -1
- package/lib/rtp/src/extra/processor/webmCallback.d.ts +2 -2
- package/lib/rtp/src/extra/processor/webmCallback.js.map +1 -1
- package/lib/rtp/src/extra/processor/webmStream.d.ts +2 -3
- package/lib/rtp/src/extra/processor/webmStream.js.map +1 -1
- package/lib/rtp/src/helper.d.ts +0 -1
- package/lib/rtp/src/helper.js +6 -6
- package/lib/rtp/src/helper.js.map +1 -1
- package/lib/rtp/src/index.d.ts +0 -1
- package/lib/rtp/src/rtcp/header.d.ts +0 -1
- package/lib/rtp/src/rtcp/psfb/fullIntraRequest.d.ts +0 -1
- package/lib/rtp/src/rtcp/psfb/index.d.ts +1 -2
- package/lib/rtp/src/rtcp/psfb/index.js.map +1 -1
- package/lib/rtp/src/rtcp/psfb/pictureLossIndication.d.ts +0 -1
- package/lib/rtp/src/rtcp/psfb/remb.d.ts +0 -1
- package/lib/rtp/src/rtcp/rr.d.ts +0 -1
- package/lib/rtp/src/rtcp/rtcp.d.ts +0 -1
- package/lib/rtp/src/rtcp/rtcp.js +2 -2
- package/lib/rtp/src/rtcp/rtcp.js.map +1 -1
- package/lib/rtp/src/rtcp/rtpfb/index.d.ts +1 -2
- package/lib/rtp/src/rtcp/rtpfb/index.js.map +1 -1
- package/lib/rtp/src/rtcp/rtpfb/nack.d.ts +0 -1
- package/lib/rtp/src/rtcp/rtpfb/twcc.d.ts +0 -1
- package/lib/rtp/src/rtcp/rtpfb/twcc.js +1 -2
- package/lib/rtp/src/rtcp/rtpfb/twcc.js.map +1 -1
- package/lib/rtp/src/rtcp/sdes.d.ts +1 -2
- package/lib/rtp/src/rtcp/sdes.js.map +1 -1
- package/lib/rtp/src/rtcp/sr.d.ts +0 -1
- package/lib/rtp/src/rtp/headerExtension.d.ts +1 -2
- package/lib/rtp/src/rtp/headerExtension.js +12 -12
- package/lib/rtp/src/rtp/headerExtension.js.map +1 -1
- package/lib/rtp/src/rtp/red/encoder.d.ts +0 -1
- package/lib/rtp/src/rtp/red/handler.d.ts +1 -1
- package/lib/rtp/src/rtp/red/handler.js.map +1 -1
- package/lib/rtp/src/rtp/red/packet.d.ts +0 -1
- package/lib/rtp/src/rtp/rtp.d.ts +0 -1
- package/lib/rtp/src/rtp/rtp.js.map +1 -1
- package/lib/rtp/src/rtp/rtx.js +2 -3
- package/lib/rtp/src/rtp/rtx.js.map +1 -1
- package/lib/rtp/src/srtp/cipher/ctr.d.ts +0 -1
- package/lib/rtp/src/srtp/cipher/gcm.d.ts +0 -1
- package/lib/rtp/src/srtp/cipher/index.d.ts +2 -3
- package/lib/rtp/src/srtp/cipher/index.js.map +1 -1
- package/lib/rtp/src/srtp/context/context.d.ts +3 -5
- package/lib/rtp/src/srtp/context/context.js.map +1 -1
- package/lib/rtp/src/srtp/context/srtcp.d.ts +2 -3
- package/lib/rtp/src/srtp/context/srtcp.js.map +1 -1
- package/lib/rtp/src/srtp/context/srtp.d.ts +1 -2
- package/lib/rtp/src/srtp/context/srtp.js.map +1 -1
- package/lib/rtp/src/srtp/session.d.ts +1 -2
- package/lib/rtp/src/srtp/session.js.map +1 -1
- package/lib/rtp/src/srtp/srtcp.d.ts +1 -2
- package/lib/rtp/src/srtp/srtcp.js.map +1 -1
- package/lib/rtp/src/srtp/srtp.d.ts +2 -3
- package/lib/rtp/src/srtp/srtp.js.map +1 -1
- package/lib/rtp/src/util.d.ts +0 -1
- package/lib/sctp/src/chunk.d.ts +0 -1
- package/lib/sctp/src/chunk.js +4 -4
- package/lib/sctp/src/chunk.js.map +1 -1
- package/lib/sctp/src/helper.js +2 -3
- package/lib/sctp/src/helper.js.map +1 -1
- package/lib/sctp/src/param.d.ts +0 -1
- package/lib/sctp/src/param.js.map +1 -1
- package/lib/sctp/src/sctp.d.ts +5 -6
- package/lib/sctp/src/sctp.js.map +1 -1
- package/lib/sctp/src/transport.d.ts +1 -3
- package/lib/sctp/src/transport.js.map +1 -1
- package/lib/webrtc/src/const.d.ts +1 -1
- package/lib/webrtc/src/const.js.map +1 -1
- package/lib/webrtc/src/dataChannel.d.ts +2 -3
- package/lib/webrtc/src/dataChannel.js.map +1 -1
- package/lib/webrtc/src/helper.d.ts +0 -1
- package/lib/webrtc/src/helper.js +3 -3
- package/lib/webrtc/src/helper.js.map +1 -1
- package/lib/webrtc/src/media/extension/rtcpFeedback.d.ts +1 -1
- package/lib/webrtc/src/media/extension/rtcpFeedback.js.map +1 -1
- package/lib/webrtc/src/media/extension/rtpExtension.js +7 -8
- package/lib/webrtc/src/media/extension/rtpExtension.js.map +1 -1
- package/lib/webrtc/src/media/parameters.d.ts +1 -1
- package/lib/webrtc/src/media/parameters.js.map +1 -1
- package/lib/webrtc/src/media/receiver/nack.d.ts +2 -2
- package/lib/webrtc/src/media/receiver/nack.js.map +1 -1
- package/lib/webrtc/src/media/receiver/receiverTwcc.d.ts +1 -1
- package/lib/webrtc/src/media/receiver/receiverTwcc.js.map +1 -1
- package/lib/webrtc/src/media/receiver/statistics.d.ts +1 -1
- package/lib/webrtc/src/media/receiver/statistics.js.map +1 -1
- package/lib/webrtc/src/media/router.d.ts +4 -4
- package/lib/webrtc/src/media/router.js.map +1 -1
- package/lib/webrtc/src/media/rtpReceiver.d.ts +7 -7
- package/lib/webrtc/src/media/rtpReceiver.js.map +1 -1
- package/lib/webrtc/src/media/rtpSender.d.ts +5 -6
- package/lib/webrtc/src/media/rtpSender.js.map +1 -1
- package/lib/webrtc/src/media/rtpTransceiver.d.ts +6 -6
- package/lib/webrtc/src/media/rtpTransceiver.js.map +1 -1
- package/lib/webrtc/src/media/sender/senderBWE.d.ts +1 -1
- package/lib/webrtc/src/media/sender/senderBWE.js.map +1 -1
- package/lib/webrtc/src/media/track.d.ts +3 -4
- package/lib/webrtc/src/media/track.js.map +1 -1
- package/lib/webrtc/src/nonstandard/index.d.ts +1 -0
- package/lib/webrtc/src/nonstandard/index.js +1 -0
- package/lib/webrtc/src/nonstandard/index.js.map +1 -1
- package/lib/webrtc/src/nonstandard/navigator.d.ts +4 -2
- package/lib/webrtc/src/nonstandard/navigator.js +6 -0
- package/lib/webrtc/src/nonstandard/navigator.js.map +1 -1
- package/lib/webrtc/src/nonstandard/recorder/index.d.ts +23 -7
- package/lib/webrtc/src/nonstandard/recorder/index.js +30 -27
- package/lib/webrtc/src/nonstandard/recorder/index.js.map +1 -1
- package/lib/webrtc/src/nonstandard/recorder/writer/index.d.ts +17 -5
- package/lib/webrtc/src/nonstandard/recorder/writer/index.js +3 -9
- package/lib/webrtc/src/nonstandard/recorder/writer/index.js.map +1 -1
- package/lib/webrtc/src/nonstandard/recorder/writer/webm.d.ts +1 -1
- package/lib/webrtc/src/nonstandard/recorder/writer/webm.js +23 -12
- package/lib/webrtc/src/nonstandard/recorder/writer/webm.js.map +1 -1
- package/lib/webrtc/src/nonstandard/userMedia.d.ts +4 -5
- package/lib/webrtc/src/nonstandard/userMedia.js.map +1 -1
- package/lib/webrtc/src/peerConnection.d.ts +10 -10
- package/lib/webrtc/src/peerConnection.js +15 -21
- package/lib/webrtc/src/peerConnection.js.map +1 -1
- package/lib/webrtc/src/sdp.d.ts +4 -4
- package/lib/webrtc/src/sdp.js +21 -21
- package/lib/webrtc/src/sdp.js.map +1 -1
- package/lib/webrtc/src/transport/dtls.d.ts +8 -8
- package/lib/webrtc/src/transport/dtls.js +16 -3
- package/lib/webrtc/src/transport/dtls.js.map +1 -1
- package/lib/webrtc/src/transport/ice.d.ts +1 -1
- package/lib/webrtc/src/transport/ice.js +3 -3
- package/lib/webrtc/src/transport/ice.js.map +1 -1
- package/lib/webrtc/src/transport/sctp.d.ts +1 -2
- package/lib/webrtc/src/transport/sctp.js +1 -1
- package/lib/webrtc/src/transport/sctp.js.map +1 -1
- package/lib/webrtc/src/utils.d.ts +3 -4
- package/lib/webrtc/src/utils.js +11 -8
- package/lib/webrtc/src/utils.js.map +1 -1
- package/package.json +12 -8
- package/src/const.ts +1 -1
- package/src/dataChannel.ts +2 -2
- package/src/media/extension/rtcpFeedback.ts +1 -1
- package/src/media/parameters.ts +1 -1
- package/src/media/receiver/nack.ts +9 -6
- package/src/media/receiver/receiverTwcc.ts +3 -3
- package/src/media/receiver/statistics.ts +1 -1
- package/src/media/router.ts +45 -39
- package/src/media/rtpReceiver.ts +30 -19
- package/src/media/rtpSender.ts +84 -71
- package/src/media/rtpTransceiver.ts +6 -6
- package/src/media/sender/senderBWE.ts +1 -1
- package/src/media/track.ts +3 -3
- package/src/nonstandard/index.ts +1 -0
- package/src/nonstandard/navigator.ts +3 -1
- package/src/nonstandard/recorder/index.ts +47 -19
- package/src/nonstandard/recorder/writer/index.ts +7 -4
- package/src/nonstandard/recorder/writer/webm.ts +25 -14
- package/src/nonstandard/userMedia.ts +1 -1
- package/src/peerConnection.ts +43 -51
- package/src/sdp.ts +108 -94
- package/src/transport/dtls.ts +28 -14
- package/src/transport/ice.ts +1 -1
- package/src/transport/sctp.ts +75 -67
- package/src/utils.ts +7 -5
package/src/peerConnection.ts
CHANGED
|
@@ -5,24 +5,24 @@ import Event from "rx.mini";
|
|
|
5
5
|
import * as uuid from "uuid";
|
|
6
6
|
|
|
7
7
|
import {
|
|
8
|
-
Address,
|
|
9
|
-
CandidatePair,
|
|
10
|
-
InterfaceAddresses,
|
|
8
|
+
type Address,
|
|
9
|
+
type CandidatePair,
|
|
10
|
+
type InterfaceAddresses,
|
|
11
11
|
Recvonly,
|
|
12
12
|
Sendonly,
|
|
13
13
|
Sendrecv,
|
|
14
14
|
deepMerge,
|
|
15
15
|
} from ".";
|
|
16
16
|
import {
|
|
17
|
-
DtlsKeys,
|
|
17
|
+
type DtlsKeys,
|
|
18
18
|
codecParametersFromString,
|
|
19
19
|
useNACK,
|
|
20
20
|
usePLI,
|
|
21
21
|
useREMB,
|
|
22
22
|
} from ".";
|
|
23
|
-
import { Profile } from "../../dtls/src/context/srtp";
|
|
24
|
-
import { Message } from "../../ice/src/stun/message";
|
|
25
|
-
import { Protocol } from "../../ice/src/types/model";
|
|
23
|
+
import type { Profile } from "../../dtls/src/context/srtp";
|
|
24
|
+
import type { Message } from "../../ice/src/stun/message";
|
|
25
|
+
import type { Protocol } from "../../ice/src/types/model";
|
|
26
26
|
import {
|
|
27
27
|
DISCARD_HOST,
|
|
28
28
|
DISCARD_PORT,
|
|
@@ -35,9 +35,9 @@ import { EventTarget, enumerate } from "./helper";
|
|
|
35
35
|
import {
|
|
36
36
|
RTCRtpCodecParameters,
|
|
37
37
|
RTCRtpCodingParameters,
|
|
38
|
-
RTCRtpHeaderExtensionParameters,
|
|
39
|
-
RTCRtpParameters,
|
|
40
|
-
RTCRtpReceiveParameters,
|
|
38
|
+
type RTCRtpHeaderExtensionParameters,
|
|
39
|
+
type RTCRtpParameters,
|
|
40
|
+
type RTCRtpReceiveParameters,
|
|
41
41
|
RTCRtpRtxParameters,
|
|
42
42
|
RTCRtpSimulcastParameters,
|
|
43
43
|
} from "./media/parameters";
|
|
@@ -45,11 +45,11 @@ import { RtpRouter } from "./media/router";
|
|
|
45
45
|
import { RTCRtpReceiver } from "./media/rtpReceiver";
|
|
46
46
|
import { RTCRtpSender } from "./media/rtpSender";
|
|
47
47
|
import {
|
|
48
|
-
Direction,
|
|
48
|
+
type Direction,
|
|
49
49
|
RTCRtpTransceiver,
|
|
50
|
-
TransceiverOptions,
|
|
50
|
+
type TransceiverOptions,
|
|
51
51
|
} from "./media/rtpTransceiver";
|
|
52
|
-
import { MediaStream, MediaStreamTrack } from "./media/track";
|
|
52
|
+
import { MediaStream, type MediaStreamTrack } from "./media/track";
|
|
53
53
|
import {
|
|
54
54
|
GroupDescription,
|
|
55
55
|
MediaDescription,
|
|
@@ -60,15 +60,15 @@ import {
|
|
|
60
60
|
import { RTCCertificate, RTCDtlsTransport } from "./transport/dtls";
|
|
61
61
|
import {
|
|
62
62
|
IceCandidate,
|
|
63
|
-
IceGathererState,
|
|
64
|
-
RTCIceCandidate,
|
|
65
|
-
RTCIceConnectionState,
|
|
63
|
+
type IceGathererState,
|
|
64
|
+
type RTCIceCandidate,
|
|
65
|
+
type RTCIceConnectionState,
|
|
66
66
|
RTCIceGatherer,
|
|
67
67
|
RTCIceTransport,
|
|
68
68
|
} from "./transport/ice";
|
|
69
69
|
import { RTCSctpTransport } from "./transport/sctp";
|
|
70
|
-
import { ConnectionState, Kind, RTCSignalingState } from "./types/domain";
|
|
71
|
-
import { Callback, CallbackWithValue } from "./types/util";
|
|
70
|
+
import type { ConnectionState, Kind, RTCSignalingState } from "./types/domain";
|
|
71
|
+
import type { Callback, CallbackWithValue } from "./types/util";
|
|
72
72
|
import {
|
|
73
73
|
andDirection,
|
|
74
74
|
parseIceServers,
|
|
@@ -168,18 +168,20 @@ export class RTCPeerConnection extends EventTarget {
|
|
|
168
168
|
|
|
169
169
|
codecParams.payloadType = 96 + i;
|
|
170
170
|
switch (codecParams.name.toLowerCase()) {
|
|
171
|
-
case "rtx":
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
break;
|
|
175
|
-
case "red": {
|
|
176
|
-
if (codecParams.contentType === "audio") {
|
|
177
|
-
const redundant = codecParams.payloadType + 1;
|
|
178
|
-
codecParams.parameters = `${redundant}/${redundant}`;
|
|
179
|
-
codecParams.payloadType = 63;
|
|
171
|
+
case "rtx":
|
|
172
|
+
{
|
|
173
|
+
codecParams.parameters = `apt=${codecParams.payloadType - 1}`;
|
|
180
174
|
}
|
|
181
|
-
|
|
182
|
-
|
|
175
|
+
break;
|
|
176
|
+
case "red":
|
|
177
|
+
{
|
|
178
|
+
if (codecParams.contentType === "audio") {
|
|
179
|
+
const redundant = codecParams.payloadType + 1;
|
|
180
|
+
codecParams.parameters = `${redundant}/${redundant}`;
|
|
181
|
+
codecParams.payloadType = 63;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
break;
|
|
183
185
|
}
|
|
184
186
|
}
|
|
185
187
|
|
|
@@ -506,8 +508,10 @@ export class RTCPeerConnection extends EventTarget {
|
|
|
506
508
|
});
|
|
507
509
|
|
|
508
510
|
iceTransport.iceGather.onIceCandidate = (candidate) => {
|
|
509
|
-
if (!this.localDescription)
|
|
510
|
-
|
|
511
|
+
if (!this.localDescription) {
|
|
512
|
+
log("localDescription not found when ice candidate was gathered");
|
|
513
|
+
return;
|
|
514
|
+
}
|
|
511
515
|
if (this.config.bundlePolicy === "max-bundle" || this.remoteIsBundled) {
|
|
512
516
|
candidate.sdpMLineIndex = 0;
|
|
513
517
|
const media = this._localDescription?.media[0];
|
|
@@ -651,14 +655,6 @@ export class RTCPeerConnection extends EventTarget {
|
|
|
651
655
|
// for trickle ice
|
|
652
656
|
this.setLocal(description);
|
|
653
657
|
|
|
654
|
-
// connect transports
|
|
655
|
-
if (description.type === "answer") {
|
|
656
|
-
this.connect().catch((err) => {
|
|
657
|
-
log("connect failed", err);
|
|
658
|
-
this.setConnectionState("failed");
|
|
659
|
-
});
|
|
660
|
-
}
|
|
661
|
-
|
|
662
658
|
// # gather candidates
|
|
663
659
|
const connected = this.iceTransports.find(
|
|
664
660
|
(transport) => transport.state === "connected",
|
|
@@ -674,6 +670,14 @@ export class RTCPeerConnection extends EventTarget {
|
|
|
674
670
|
);
|
|
675
671
|
}
|
|
676
672
|
|
|
673
|
+
// connect transports
|
|
674
|
+
if (description.type === "answer") {
|
|
675
|
+
this.connect().catch((err) => {
|
|
676
|
+
log("connect failed", err);
|
|
677
|
+
this.setConnectionState("failed");
|
|
678
|
+
});
|
|
679
|
+
}
|
|
680
|
+
|
|
677
681
|
description.media
|
|
678
682
|
.filter((m) => ["audio", "video"].includes(m.kind))
|
|
679
683
|
.forEach((m, i) => {
|
|
@@ -996,18 +1000,6 @@ export class RTCPeerConnection extends EventTarget {
|
|
|
996
1000
|
});
|
|
997
1001
|
}
|
|
998
1002
|
|
|
999
|
-
const connected = this.iceTransports.find(
|
|
1000
|
-
(transport) => transport.state === "connected",
|
|
1001
|
-
);
|
|
1002
|
-
if (this.remoteIsBundled && connected) {
|
|
1003
|
-
// no need to gather ice candidates on an existing bundled connection
|
|
1004
|
-
await connected.iceGather.gather();
|
|
1005
|
-
} else {
|
|
1006
|
-
await Promise.allSettled(
|
|
1007
|
-
transports.map((iceTransport) => iceTransport.iceGather.gather()),
|
|
1008
|
-
);
|
|
1009
|
-
}
|
|
1010
|
-
|
|
1011
1003
|
this.negotiationneeded = false;
|
|
1012
1004
|
if (this.shouldNegotiationneeded) {
|
|
1013
1005
|
this.needNegotiation();
|
package/src/sdp.ts
CHANGED
|
@@ -14,18 +14,18 @@ import {
|
|
|
14
14
|
RTCRtcpFeedback,
|
|
15
15
|
RTCRtpCodecParameters,
|
|
16
16
|
RTCRtpHeaderExtensionParameters,
|
|
17
|
-
RTCRtpParameters,
|
|
17
|
+
type RTCRtpParameters,
|
|
18
18
|
RTCRtpSimulcastParameters,
|
|
19
19
|
} from "./media/parameters";
|
|
20
|
-
import { Direction } from "./media/rtpTransceiver";
|
|
20
|
+
import type { Direction } from "./media/rtpTransceiver";
|
|
21
21
|
import {
|
|
22
|
-
DtlsRole,
|
|
22
|
+
type DtlsRole,
|
|
23
23
|
RTCDtlsFingerprint,
|
|
24
24
|
RTCDtlsParameters,
|
|
25
25
|
} from "./transport/dtls";
|
|
26
26
|
import { IceCandidate, RTCIceParameters } from "./transport/ice";
|
|
27
27
|
import { RTCSctpCapabilities } from "./transport/sctp";
|
|
28
|
-
import { Kind } from "./types/domain";
|
|
28
|
+
import type { Kind } from "./types/domain";
|
|
29
29
|
|
|
30
30
|
export class SessionDescription {
|
|
31
31
|
version = 0;
|
|
@@ -51,7 +51,7 @@ export class SessionDescription {
|
|
|
51
51
|
const session = new SessionDescription();
|
|
52
52
|
sessionLines.forEach((line) => {
|
|
53
53
|
if (line.startsWith("v=")) {
|
|
54
|
-
session.version = parseInt(line.slice(2), 10);
|
|
54
|
+
session.version = Number.parseInt(line.slice(2), 10);
|
|
55
55
|
} else if (line.startsWith("o=")) {
|
|
56
56
|
session.origin = line.slice(2);
|
|
57
57
|
} else if (line.startsWith("s=")) {
|
|
@@ -63,13 +63,14 @@ export class SessionDescription {
|
|
|
63
63
|
} else if (line.startsWith("a=")) {
|
|
64
64
|
const [attr, value] = parseAttr(line);
|
|
65
65
|
switch (attr) {
|
|
66
|
-
case "fingerprint":
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
66
|
+
case "fingerprint":
|
|
67
|
+
{
|
|
68
|
+
const [algorithm, fingerprint] = value?.split(" ") || [];
|
|
69
|
+
session.dtlsFingerprints.push(
|
|
70
|
+
new RTCDtlsFingerprint(algorithm, fingerprint),
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
break;
|
|
73
74
|
case "ice-lite":
|
|
74
75
|
session.iceLite = true;
|
|
75
76
|
break;
|
|
@@ -116,7 +117,7 @@ export class SessionDescription {
|
|
|
116
117
|
|
|
117
118
|
const currentMedia = new MediaDescription(
|
|
118
119
|
kind,
|
|
119
|
-
parseInt(m[2]),
|
|
120
|
+
Number.parseInt(m[2]),
|
|
120
121
|
m[3],
|
|
121
122
|
fmtInt || fmt,
|
|
122
123
|
);
|
|
@@ -148,28 +149,30 @@ export class SessionDescription {
|
|
|
148
149
|
case "end-of-candidates":
|
|
149
150
|
currentMedia.iceCandidatesComplete = true;
|
|
150
151
|
break;
|
|
151
|
-
case "extmap":
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
152
|
+
case "extmap":
|
|
153
|
+
{
|
|
154
|
+
// eslint-disable-next-line prefer-const
|
|
155
|
+
let [extId, extUri] = value.split(" ");
|
|
156
|
+
if (extId.includes("/")) {
|
|
157
|
+
[extId] = extId.split("/");
|
|
158
|
+
}
|
|
159
|
+
currentMedia.rtp.headerExtensions.push(
|
|
160
|
+
new RTCRtpHeaderExtensionParameters({
|
|
161
|
+
id: Number.parseInt(extId),
|
|
162
|
+
uri: extUri,
|
|
163
|
+
}),
|
|
164
|
+
);
|
|
156
165
|
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
const [algorithm, fingerprint] = value.split(" ");
|
|
168
|
-
currentMedia.dtlsParams?.fingerprints.push(
|
|
169
|
-
new RTCDtlsFingerprint(algorithm, fingerprint),
|
|
170
|
-
);
|
|
171
|
-
}
|
|
172
|
-
break;
|
|
166
|
+
break;
|
|
167
|
+
case "fingerprint":
|
|
168
|
+
{
|
|
169
|
+
if (!value) throw new Error();
|
|
170
|
+
const [algorithm, fingerprint] = value.split(" ");
|
|
171
|
+
currentMedia.dtlsParams?.fingerprints.push(
|
|
172
|
+
new RTCDtlsFingerprint(algorithm, fingerprint),
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
break;
|
|
173
176
|
case "ice-options":
|
|
174
177
|
currentMedia.iceOptions = value;
|
|
175
178
|
break;
|
|
@@ -184,7 +187,7 @@ export class SessionDescription {
|
|
|
184
187
|
break;
|
|
185
188
|
case "max-message-size":
|
|
186
189
|
currentMedia.sctpCapabilities = new RTCSctpCapabilities(
|
|
187
|
-
parseInt(value, 10),
|
|
190
|
+
Number.parseInt(value, 10),
|
|
188
191
|
);
|
|
189
192
|
break;
|
|
190
193
|
case "mid":
|
|
@@ -193,12 +196,13 @@ export class SessionDescription {
|
|
|
193
196
|
case "msid":
|
|
194
197
|
currentMedia.msid = value;
|
|
195
198
|
break;
|
|
196
|
-
case "rtcp":
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
199
|
+
case "rtcp":
|
|
200
|
+
{
|
|
201
|
+
const [port, rest] = divide(value, " ");
|
|
202
|
+
currentMedia.rtcpPort = Number.parseInt(port);
|
|
203
|
+
currentMedia.rtcpHost = ipAddressFromSdp(rest);
|
|
204
|
+
}
|
|
205
|
+
break;
|
|
202
206
|
case "rtcp-mux":
|
|
203
207
|
currentMedia.rtcpMux = true;
|
|
204
208
|
break;
|
|
@@ -211,61 +215,65 @@ export class SessionDescription {
|
|
|
211
215
|
case "inactive":
|
|
212
216
|
currentMedia.direction = attr;
|
|
213
217
|
break;
|
|
214
|
-
case "rtpmap":
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
218
|
+
case "rtpmap":
|
|
219
|
+
{
|
|
220
|
+
const [formatId, formatDesc] = divide(value, " ");
|
|
221
|
+
const [type, clock, channel] = formatDesc.split("/");
|
|
222
|
+
let channels: number | undefined;
|
|
223
|
+
if (currentMedia.kind === "audio") {
|
|
224
|
+
channels = channel ? Number.parseInt(channel) : 1;
|
|
225
|
+
}
|
|
226
|
+
const codec = new RTCRtpCodecParameters({
|
|
227
|
+
mimeType: currentMedia.kind + "/" + type,
|
|
228
|
+
channels,
|
|
229
|
+
clockRate: Number.parseInt(clock),
|
|
230
|
+
payloadType: Number.parseInt(formatId),
|
|
231
|
+
});
|
|
232
|
+
currentMedia.rtp.codecs.push(codec);
|
|
220
233
|
}
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
case "sctpmap": {
|
|
231
|
-
if (!value) throw new Error();
|
|
232
|
-
const [formatId, formatDesc] = divide(value, " ");
|
|
233
|
-
currentMedia.sctpMap[parseInt(formatId)] = formatDesc;
|
|
234
|
-
currentMedia.sctpPort = parseInt(formatId);
|
|
235
|
-
}
|
|
236
|
-
break;
|
|
234
|
+
break;
|
|
235
|
+
case "sctpmap":
|
|
236
|
+
{
|
|
237
|
+
if (!value) throw new Error();
|
|
238
|
+
const [formatId, formatDesc] = divide(value, " ");
|
|
239
|
+
currentMedia.sctpMap[Number.parseInt(formatId)] = formatDesc;
|
|
240
|
+
currentMedia.sctpPort = Number.parseInt(formatId);
|
|
241
|
+
}
|
|
242
|
+
break;
|
|
237
243
|
case "sctp-port":
|
|
238
244
|
if (!value) throw new Error();
|
|
239
|
-
currentMedia.sctpPort = parseInt(value);
|
|
245
|
+
currentMedia.sctpPort = Number.parseInt(value);
|
|
240
246
|
break;
|
|
241
|
-
case "ssrc":
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
ssrcInfo
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
247
|
+
case "ssrc":
|
|
248
|
+
{
|
|
249
|
+
const [ssrcStr, ssrcDesc] = divide(value, " ");
|
|
250
|
+
const ssrc = Number.parseInt(ssrcStr);
|
|
251
|
+
const [ssrcAttr, ssrcValue] = divide(ssrcDesc, ":");
|
|
252
|
+
let ssrcInfo = currentMedia.ssrc.find((v) => v.ssrc === ssrc);
|
|
253
|
+
if (!ssrcInfo) {
|
|
254
|
+
ssrcInfo = new SsrcDescription({ ssrc });
|
|
255
|
+
currentMedia.ssrc.push(ssrcInfo);
|
|
256
|
+
}
|
|
257
|
+
if (SSRC_INFO_ATTRS.includes(ssrcAttr)) {
|
|
258
|
+
ssrcInfo[ssrcAttr] = ssrcValue;
|
|
259
|
+
}
|
|
252
260
|
}
|
|
253
|
-
|
|
254
|
-
break;
|
|
261
|
+
break;
|
|
255
262
|
case "ssrc-group":
|
|
256
263
|
parseGroup(currentMedia.ssrcGroup, value);
|
|
257
264
|
break;
|
|
258
|
-
case "rid":
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
265
|
+
case "rid":
|
|
266
|
+
{
|
|
267
|
+
const [rid, direction] = divide(value, " ");
|
|
268
|
+
|
|
269
|
+
currentMedia.simulcastParameters.push(
|
|
270
|
+
new RTCRtpSimulcastParameters({
|
|
271
|
+
rid,
|
|
272
|
+
direction: direction as any,
|
|
273
|
+
}),
|
|
274
|
+
);
|
|
275
|
+
}
|
|
276
|
+
break;
|
|
269
277
|
}
|
|
270
278
|
}
|
|
271
279
|
});
|
|
@@ -532,7 +540,10 @@ export class MediaDescription {
|
|
|
532
540
|
}
|
|
533
541
|
|
|
534
542
|
export class GroupDescription {
|
|
535
|
-
constructor(
|
|
543
|
+
constructor(
|
|
544
|
+
public semantic: string,
|
|
545
|
+
public items: string[],
|
|
546
|
+
) {}
|
|
536
547
|
|
|
537
548
|
get str() {
|
|
538
549
|
return `${this.semantic} ${this.items.join(" ")}`;
|
|
@@ -613,11 +624,11 @@ export function candidateFromSdp(sdp: string) {
|
|
|
613
624
|
}
|
|
614
625
|
|
|
615
626
|
const candidate = new IceCandidate(
|
|
616
|
-
parseInt(bits[1], 10),
|
|
627
|
+
Number.parseInt(bits[1], 10),
|
|
617
628
|
bits[0],
|
|
618
629
|
bits[4],
|
|
619
|
-
parseInt(bits[5], 10),
|
|
620
|
-
parseInt(bits[3], 10),
|
|
630
|
+
Number.parseInt(bits[5], 10),
|
|
631
|
+
Number.parseInt(bits[3], 10),
|
|
621
632
|
bits[2],
|
|
622
633
|
bits[7],
|
|
623
634
|
);
|
|
@@ -628,7 +639,7 @@ export function candidateFromSdp(sdp: string) {
|
|
|
628
639
|
candidate.relatedAddress = bits[i + 1];
|
|
629
640
|
break;
|
|
630
641
|
case "rport":
|
|
631
|
-
candidate.relatedPort = parseInt(bits[i + 1]);
|
|
642
|
+
candidate.relatedPort = Number.parseInt(bits[i + 1]);
|
|
632
643
|
break;
|
|
633
644
|
case "tcptype":
|
|
634
645
|
candidate.tcpType = bits[i + 1];
|
|
@@ -640,7 +651,10 @@ export function candidateFromSdp(sdp: string) {
|
|
|
640
651
|
}
|
|
641
652
|
|
|
642
653
|
export class RTCSessionDescription {
|
|
643
|
-
constructor(
|
|
654
|
+
constructor(
|
|
655
|
+
public sdp: string,
|
|
656
|
+
public type: "offer" | "answer",
|
|
657
|
+
) {}
|
|
644
658
|
static isThis(o: any) {
|
|
645
659
|
if (typeof o?.sdp === "string") return true;
|
|
646
660
|
}
|
package/src/transport/dtls.ts
CHANGED
|
@@ -7,22 +7,22 @@ import { v4 } from "uuid";
|
|
|
7
7
|
import {
|
|
8
8
|
DtlsClient,
|
|
9
9
|
DtlsServer,
|
|
10
|
-
DtlsSocket,
|
|
11
|
-
Transport,
|
|
10
|
+
type DtlsSocket,
|
|
11
|
+
type Transport,
|
|
12
12
|
} from "../../../dtls/src";
|
|
13
13
|
import {
|
|
14
14
|
HashAlgorithm,
|
|
15
15
|
NamedCurveAlgorithm,
|
|
16
16
|
SignatureAlgorithm,
|
|
17
|
-
SignatureHash,
|
|
17
|
+
type SignatureHash,
|
|
18
18
|
} from "../../../dtls/src/cipher/const";
|
|
19
19
|
import { CipherContext } from "../../../dtls/src/context/cipher";
|
|
20
|
-
import { Profile } from "../../../dtls/src/context/srtp";
|
|
21
|
-
import { Connection } from "../../../ice/src";
|
|
20
|
+
import type { Profile } from "../../../dtls/src/context/srtp";
|
|
21
|
+
import type { Connection } from "../../../ice/src";
|
|
22
22
|
import {
|
|
23
|
-
RtcpPacket,
|
|
23
|
+
type RtcpPacket,
|
|
24
24
|
RtcpPacketConverter,
|
|
25
|
-
RtpHeader,
|
|
25
|
+
type RtpHeader,
|
|
26
26
|
RtpPacket,
|
|
27
27
|
SrtcpSession,
|
|
28
28
|
SrtpSession,
|
|
@@ -30,10 +30,10 @@ import {
|
|
|
30
30
|
isRtcp,
|
|
31
31
|
} from "../../../rtp/src";
|
|
32
32
|
import { keyLength, saltLength } from "../../../rtp/src/srtp/const";
|
|
33
|
-
import { RtpRouter } from "../media/router";
|
|
34
|
-
import { PeerConfig } from "../peerConnection";
|
|
33
|
+
import type { RtpRouter } from "../media/router";
|
|
34
|
+
import type { PeerConfig } from "../peerConnection";
|
|
35
35
|
import { fingerprint, isDtls } from "../utils";
|
|
36
|
-
import { RTCIceTransport } from "./ice";
|
|
36
|
+
import type { RTCIceTransport } from "./ice";
|
|
37
37
|
|
|
38
38
|
const log = debug("werift:packages/webrtc/src/transport/dtls.ts");
|
|
39
39
|
|
|
@@ -52,6 +52,7 @@ export class RTCDtlsTransport {
|
|
|
52
52
|
readonly onStateChange = new Event<[DtlsState]>();
|
|
53
53
|
|
|
54
54
|
localCertificate?: RTCCertificate;
|
|
55
|
+
localCertificatePromise?: Promise<RTCCertificate>;
|
|
55
56
|
private remoteParameters?: RTCDtlsParameters;
|
|
56
57
|
|
|
57
58
|
constructor(
|
|
@@ -72,7 +73,15 @@ export class RTCDtlsTransport {
|
|
|
72
73
|
}
|
|
73
74
|
|
|
74
75
|
async setupCertificate() {
|
|
75
|
-
if (
|
|
76
|
+
if (this.localCertificate) {
|
|
77
|
+
return this.localCertificate;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if (this.localCertificatePromise) {
|
|
81
|
+
return this.localCertificatePromise;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
this.localCertificatePromise = (async () => {
|
|
76
85
|
const { certPem, keyPem, signatureHash } =
|
|
77
86
|
await CipherContext.createSelfSignedCertificateWithKey(
|
|
78
87
|
{
|
|
@@ -86,8 +95,10 @@ export class RTCDtlsTransport {
|
|
|
86
95
|
certPem,
|
|
87
96
|
signatureHash,
|
|
88
97
|
);
|
|
89
|
-
|
|
90
|
-
|
|
98
|
+
return this.localCertificate;
|
|
99
|
+
})();
|
|
100
|
+
|
|
101
|
+
return this.localCertificatePromise;
|
|
91
102
|
}
|
|
92
103
|
|
|
93
104
|
setRemoteParams(remoteParameters: RTCDtlsParameters) {
|
|
@@ -329,7 +340,10 @@ export type DtlsKeys = {
|
|
|
329
340
|
};
|
|
330
341
|
|
|
331
342
|
export class RTCDtlsFingerprint {
|
|
332
|
-
constructor(
|
|
343
|
+
constructor(
|
|
344
|
+
public algorithm: string,
|
|
345
|
+
public value: string,
|
|
346
|
+
) {}
|
|
333
347
|
}
|
|
334
348
|
|
|
335
349
|
export class RTCDtlsParameters {
|
package/src/transport/ice.ts
CHANGED
|
@@ -2,7 +2,7 @@ import debug from "debug";
|
|
|
2
2
|
import Event from "rx.mini";
|
|
3
3
|
import { v4 } from "uuid";
|
|
4
4
|
|
|
5
|
-
import { Candidate, Connection, IceOptions } from "../../../ice/src";
|
|
5
|
+
import { Candidate, Connection, type IceOptions } from "../../../ice/src";
|
|
6
6
|
import { candidateFromSdp, candidateToSdp } from "../sdp";
|
|
7
7
|
|
|
8
8
|
const log = debug("werift:packages/webrtc/src/transport/ice.ts");
|