@lakutata/webrtc 0.0.0-stage → 3.1.4
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/LICENSE +23 -0
- package/README.md +509 -2
- package/README.zh-CN.md +399 -0
- package/THIRD_PARTY_NOTICES.md +652 -0
- package/dist/cjs/client/SignalingConnection.d.ts +81 -0
- package/dist/cjs/client/SignalingConnection.js +67 -0
- package/dist/cjs/cluster/Cluster.d.ts +503 -0
- package/dist/cjs/cluster/Cluster.js +546 -0
- package/dist/cjs/cluster/ClusterFrames.d.ts +24 -0
- package/dist/cjs/cluster/ClusterFrames.js +90 -0
- package/dist/cjs/cluster/ClusterTURN.d.ts +63 -0
- package/dist/cjs/cluster/ClusterTURN.js +78 -0
- package/dist/cjs/cluster/Rendezvous.d.ts +8 -0
- package/dist/cjs/cluster/Rendezvous.js +23 -0
- package/dist/cjs/cluster/transports/ClusterTransport.d.ts +34 -0
- package/dist/cjs/cluster/transports/ClusterTransport.js +2 -0
- package/dist/cjs/cluster/transports/LoadClient.d.ts +6 -0
- package/dist/cjs/cluster/transports/LoadClient.js +80 -0
- package/dist/cjs/cluster/transports/MemoryClusterTransport.d.ts +13 -0
- package/dist/cjs/cluster/transports/MemoryClusterTransport.js +47 -0
- package/dist/cjs/cluster/transports/NATSClusterTransport.d.ts +23 -0
- package/dist/cjs/cluster/transports/NATSClusterTransport.js +70 -0
- package/dist/cjs/cluster/transports/RedisClusterTransport.d.ts +23 -0
- package/dist/cjs/cluster/transports/RedisClusterTransport.js +77 -0
- package/dist/cjs/exceptions/ClusterRequestException.d.ts +11 -0
- package/dist/cjs/exceptions/ClusterRequestException.js +18 -0
- package/dist/cjs/exceptions/ClusterTimeoutException.d.ts +10 -0
- package/dist/cjs/exceptions/ClusterTimeoutException.js +17 -0
- package/dist/cjs/exceptions/ClusterTransportNotFoundException.d.ts +11 -0
- package/dist/cjs/exceptions/ClusterTransportNotFoundException.js +18 -0
- package/dist/cjs/exceptions/SignalingClientRequiredException.d.ts +12 -0
- package/dist/cjs/exceptions/SignalingClientRequiredException.js +19 -0
- package/dist/cjs/exceptions/SignalingConnectionException.d.ts +12 -0
- package/dist/cjs/exceptions/SignalingConnectionException.js +19 -0
- package/dist/cjs/exceptions/SignalingDeniedException.d.ts +11 -0
- package/dist/cjs/exceptions/SignalingDeniedException.js +18 -0
- package/dist/cjs/exceptions/SignalingLimitException.d.ts +11 -0
- package/dist/cjs/exceptions/SignalingLimitException.js +18 -0
- package/dist/cjs/exceptions/SignalingNotAMemberException.d.ts +11 -0
- package/dist/cjs/exceptions/SignalingNotAMemberException.js +18 -0
- package/dist/cjs/exceptions/WHEPDeniedException.d.ts +15 -0
- package/dist/cjs/exceptions/WHEPDeniedException.js +22 -0
- package/dist/cjs/exceptions/WHEPLimitException.d.ts +15 -0
- package/dist/cjs/exceptions/WHEPLimitException.js +22 -0
- package/dist/cjs/exceptions/WHEPMediaTypeException.d.ts +15 -0
- package/dist/cjs/exceptions/WHEPMediaTypeException.js +22 -0
- package/dist/cjs/exceptions/WHEPOfferException.d.ts +16 -0
- package/dist/cjs/exceptions/WHEPOfferException.js +23 -0
- package/dist/cjs/exceptions/WHEPSessionNotFoundException.d.ts +15 -0
- package/dist/cjs/exceptions/WHEPSessionNotFoundException.js +22 -0
- package/dist/cjs/exceptions/WHIPDeniedException.d.ts +15 -0
- package/dist/cjs/exceptions/WHIPDeniedException.js +22 -0
- package/dist/cjs/exceptions/WHIPLimitException.d.ts +15 -0
- package/dist/cjs/exceptions/WHIPLimitException.js +22 -0
- package/dist/cjs/exceptions/WHIPMediaTypeException.d.ts +15 -0
- package/dist/cjs/exceptions/WHIPMediaTypeException.js +22 -0
- package/dist/cjs/exceptions/WHIPOfferException.d.ts +16 -0
- package/dist/cjs/exceptions/WHIPOfferException.js +23 -0
- package/dist/cjs/exceptions/WHIPSessionNotFoundException.d.ts +15 -0
- package/dist/cjs/exceptions/WHIPSessionNotFoundException.js +22 -0
- package/dist/cjs/exports/Client.d.ts +11 -0
- package/dist/cjs/exports/Client.js +29 -0
- package/dist/cjs/exports/WebRTC.d.ts +48 -0
- package/dist/cjs/exports/WebRTC.js +72 -0
- package/dist/cjs/lib/common/binary.d.ts +51 -0
- package/dist/cjs/lib/common/binary.js +264 -0
- package/dist/cjs/lib/common/binaryData.d.ts +116 -0
- package/dist/cjs/lib/common/binaryData.js +400 -0
- package/dist/cjs/lib/common/crc.d.ts +4 -0
- package/dist/cjs/lib/common/crc.js +122 -0
- package/dist/cjs/lib/common/deque.d.ts +36 -0
- package/dist/cjs/lib/common/deque.js +89 -0
- package/dist/cjs/lib/common/event.d.ts +48 -0
- package/dist/cjs/lib/common/event.js +207 -0
- package/dist/cjs/lib/common/index.d.ts +11 -0
- package/dist/cjs/lib/common/index.js +50 -0
- package/dist/cjs/lib/common/log.d.ts +47 -0
- package/dist/cjs/lib/common/log.js +62 -0
- package/dist/cjs/lib/common/network.d.ts +10 -0
- package/dist/cjs/lib/common/network.js +60 -0
- package/dist/cjs/lib/common/number.d.ts +13 -0
- package/dist/cjs/lib/common/number.js +43 -0
- package/dist/cjs/lib/common/promise.d.ts +21 -0
- package/dist/cjs/lib/common/promise.js +70 -0
- package/dist/cjs/lib/common/transport.d.ts +104 -0
- package/dist/cjs/lib/common/transport.js +441 -0
- package/dist/cjs/lib/common/type.d.ts +3 -0
- package/dist/cjs/lib/common/type.js +2 -0
- package/dist/cjs/lib/dtls/cipher/const.d.ts +42 -0
- package/dist/cjs/lib/dtls/cipher/const.js +33 -0
- package/dist/cjs/lib/dtls/cipher/create.d.ts +21 -0
- package/dist/cjs/lib/dtls/cipher/create.js +105 -0
- package/dist/cjs/lib/dtls/cipher/ec.d.ts +28 -0
- package/dist/cjs/lib/dtls/cipher/ec.js +44 -0
- package/dist/cjs/lib/dtls/cipher/key-exchange.d.ts +43 -0
- package/dist/cjs/lib/dtls/cipher/key-exchange.js +113 -0
- package/dist/cjs/lib/dtls/cipher/namedCurve.d.ts +7 -0
- package/dist/cjs/lib/dtls/cipher/namedCurve.js +27 -0
- package/dist/cjs/lib/dtls/cipher/prf.d.ts +17 -0
- package/dist/cjs/lib/dtls/cipher/prf.js +92 -0
- package/dist/cjs/lib/dtls/cipher/suites/abstract.d.ts +40 -0
- package/dist/cjs/lib/dtls/cipher/suites/abstract.js +41 -0
- package/dist/cjs/lib/dtls/cipher/suites/aead.d.ts +28 -0
- package/dist/cjs/lib/dtls/cipher/suites/aead.js +132 -0
- package/dist/cjs/lib/dtls/cipher/suites/null.d.ts +24 -0
- package/dist/cjs/lib/dtls/cipher/suites/null.js +41 -0
- package/dist/cjs/lib/dtls/cipher/utils.d.ts +18 -0
- package/dist/cjs/lib/dtls/cipher/utils.js +70 -0
- package/dist/cjs/lib/dtls/cipher/x509.d.ts +33 -0
- package/dist/cjs/lib/dtls/cipher/x509.js +100 -0
- package/dist/cjs/lib/dtls/client.d.ts +7 -0
- package/dist/cjs/lib/dtls/client.js +76 -0
- package/dist/cjs/lib/dtls/context/cipher.d.ts +42 -0
- package/dist/cjs/lib/dtls/context/cipher.js +87 -0
- package/dist/cjs/lib/dtls/context/dtls.d.ts +38 -0
- package/dist/cjs/lib/dtls/context/dtls.js +49 -0
- package/dist/cjs/lib/dtls/context/srtp.d.ts +5 -0
- package/dist/cjs/lib/dtls/context/srtp.js +12 -0
- package/dist/cjs/lib/dtls/context/transport.d.ts +8 -0
- package/dist/cjs/lib/dtls/context/transport.js +17 -0
- package/dist/cjs/lib/dtls/flight/client/flight1.d.ts +10 -0
- package/dist/cjs/lib/dtls/flight/client/flight1.js +26 -0
- package/dist/cjs/lib/dtls/flight/client/flight3.d.ts +8 -0
- package/dist/cjs/lib/dtls/flight/client/flight3.js +25 -0
- package/dist/cjs/lib/dtls/flight/client/flight5.d.ts +18 -0
- package/dist/cjs/lib/dtls/flight/client/flight5.js +206 -0
- package/dist/cjs/lib/dtls/flight/flight.d.ts +18 -0
- package/dist/cjs/lib/dtls/flight/flight.js +68 -0
- package/dist/cjs/lib/dtls/flight/server/flight2.d.ts +6 -0
- package/dist/cjs/lib/dtls/flight/server/flight2.js +126 -0
- package/dist/cjs/lib/dtls/flight/server/flight4.d.ts +17 -0
- package/dist/cjs/lib/dtls/flight/server/flight4.js +87 -0
- package/dist/cjs/lib/dtls/flight/server/flight6.d.ts +13 -0
- package/dist/cjs/lib/dtls/flight/server/flight6.js +111 -0
- package/dist/cjs/lib/dtls/handshake/binary.d.ts +16 -0
- package/dist/cjs/lib/dtls/handshake/binary.js +20 -0
- package/dist/cjs/lib/dtls/handshake/const.d.ts +13 -0
- package/dist/cjs/lib/dtls/handshake/const.js +17 -0
- package/dist/cjs/lib/dtls/handshake/extensions/ellipticCurves.d.ts +17 -0
- package/dist/cjs/lib/dtls/handshake/extensions/ellipticCurves.js +40 -0
- package/dist/cjs/lib/dtls/handshake/extensions/extendedMasterSecret.d.ts +3 -0
- package/dist/cjs/lib/dtls/handshake/extensions/extendedMasterSecret.js +7 -0
- package/dist/cjs/lib/dtls/handshake/extensions/renegotiationIndication.d.ts +18 -0
- package/dist/cjs/lib/dtls/handshake/extensions/renegotiationIndication.js +34 -0
- package/dist/cjs/lib/dtls/handshake/extensions/signature.d.ts +26 -0
- package/dist/cjs/lib/dtls/handshake/extensions/signature.js +39 -0
- package/dist/cjs/lib/dtls/handshake/extensions/useSrtp.d.ts +19 -0
- package/dist/cjs/lib/dtls/handshake/extensions/useSrtp.js +65 -0
- package/dist/cjs/lib/dtls/handshake/message/alert.d.ts +12 -0
- package/dist/cjs/lib/dtls/handshake/message/alert.js +24 -0
- package/dist/cjs/lib/dtls/handshake/message/certificate.d.ts +17 -0
- package/dist/cjs/lib/dtls/handshake/message/certificate.js +35 -0
- package/dist/cjs/lib/dtls/handshake/message/changeCipherSpec.d.ts +11 -0
- package/dist/cjs/lib/dtls/handshake/message/changeCipherSpec.js +24 -0
- package/dist/cjs/lib/dtls/handshake/message/client/certificateVerify.d.ts +20 -0
- package/dist/cjs/lib/dtls/handshake/message/client/certificateVerify.js +35 -0
- package/dist/cjs/lib/dtls/handshake/message/client/hello.d.ts +50 -0
- package/dist/cjs/lib/dtls/handshake/message/client/hello.js +48 -0
- package/dist/cjs/lib/dtls/handshake/message/client/keyExchange.d.ts +17 -0
- package/dist/cjs/lib/dtls/handshake/message/client/keyExchange.js +33 -0
- package/dist/cjs/lib/dtls/handshake/message/finished.d.ts +13 -0
- package/dist/cjs/lib/dtls/handshake/message/finished.js +26 -0
- package/dist/cjs/lib/dtls/handshake/message/server/certificateRequest.d.ts +31 -0
- package/dist/cjs/lib/dtls/handshake/message/server/certificateRequest.js +38 -0
- package/dist/cjs/lib/dtls/handshake/message/server/hello.d.ts +33 -0
- package/dist/cjs/lib/dtls/handshake/message/server/hello.js +57 -0
- package/dist/cjs/lib/dtls/handshake/message/server/helloDone.d.ts +12 -0
- package/dist/cjs/lib/dtls/handshake/message/server/helloDone.js +30 -0
- package/dist/cjs/lib/dtls/handshake/message/server/helloVerifyRequest.d.ts +32 -0
- package/dist/cjs/lib/dtls/handshake/message/server/helloVerifyRequest.js +42 -0
- package/dist/cjs/lib/dtls/handshake/message/server/keyExchange.d.ts +32 -0
- package/dist/cjs/lib/dtls/handshake/message/server/keyExchange.js +49 -0
- package/dist/cjs/lib/dtls/handshake/random.d.ts +13 -0
- package/dist/cjs/lib/dtls/handshake/random.js +29 -0
- package/dist/cjs/lib/dtls/helper.d.ts +4 -0
- package/dist/cjs/lib/dtls/helper.js +30 -0
- package/dist/cjs/lib/dtls/imports/common.d.ts +1 -0
- package/dist/cjs/lib/dtls/imports/common.js +17 -0
- package/dist/cjs/lib/dtls/imports/rtp.d.ts +1 -0
- package/dist/cjs/lib/dtls/imports/rtp.js +17 -0
- package/dist/cjs/lib/dtls/index.d.ts +7 -0
- package/dist/cjs/lib/dtls/index.js +117 -0
- package/dist/cjs/lib/dtls/record/antiReplayWindow.d.ts +27 -0
- package/dist/cjs/lib/dtls/record/antiReplayWindow.js +102 -0
- package/dist/cjs/lib/dtls/record/builder.d.ts +9 -0
- package/dist/cjs/lib/dtls/record/builder.js +27 -0
- package/dist/cjs/lib/dtls/record/const.d.ts +33 -0
- package/dist/cjs/lib/dtls/record/const.js +38 -0
- package/dist/cjs/lib/dtls/record/message/fragment.d.ts +26 -0
- package/dist/cjs/lib/dtls/record/message/fragment.js +96 -0
- package/dist/cjs/lib/dtls/record/message/header.d.ts +38 -0
- package/dist/cjs/lib/dtls/record/message/header.js +34 -0
- package/dist/cjs/lib/dtls/record/message/plaintext.d.ts +14 -0
- package/dist/cjs/lib/dtls/record/message/plaintext.js +63 -0
- package/dist/cjs/lib/dtls/record/receive.d.ts +9 -0
- package/dist/cjs/lib/dtls/record/receive.js +91 -0
- package/dist/cjs/lib/dtls/server.d.ts +6 -0
- package/dist/cjs/lib/dtls/server.js +78 -0
- package/dist/cjs/lib/dtls/socket.d.ts +52 -0
- package/dist/cjs/lib/dtls/socket.js +188 -0
- package/dist/cjs/lib/dtls/typings/domain.d.ts +20 -0
- package/dist/cjs/lib/dtls/typings/domain.js +2 -0
- package/dist/cjs/lib/dtls/util/binary.d.ts +2 -0
- package/dist/cjs/lib/dtls/util/binary.js +8 -0
- package/dist/cjs/lib/ice/candidate.d.ts +35 -0
- package/dist/cjs/lib/ice/candidate.js +198 -0
- package/dist/cjs/lib/ice/dns/lookup.d.ts +16 -0
- package/dist/cjs/lib/ice/dns/lookup.js +133 -0
- package/dist/cjs/lib/ice/dns/mdns.d.ts +38 -0
- package/dist/cjs/lib/ice/dns/mdns.js +145 -0
- package/dist/cjs/lib/ice/exceptions.d.ts +24 -0
- package/dist/cjs/lib/ice/exceptions.js +41 -0
- package/dist/cjs/lib/ice/helper.d.ts +17 -0
- package/dist/cjs/lib/ice/helper.js +74 -0
- package/dist/cjs/lib/ice/ice.d.ts +182 -0
- package/dist/cjs/lib/ice/ice.js +1584 -0
- package/dist/cjs/lib/ice/iceBase.d.ts +214 -0
- package/dist/cjs/lib/ice/iceBase.js +182 -0
- package/dist/cjs/lib/ice/imports/common.d.ts +1 -0
- package/dist/cjs/lib/ice/imports/common.js +17 -0
- package/dist/cjs/lib/ice/index.d.ts +12 -0
- package/dist/cjs/lib/ice/index.js +30 -0
- package/dist/cjs/lib/ice/internal/selectAddresses.d.ts +9 -0
- package/dist/cjs/lib/ice/internal/selectAddresses.js +39 -0
- package/dist/cjs/lib/ice/stun/attributes.d.ts +1 -0
- package/dist/cjs/lib/ice/stun/attributes.js +17 -0
- package/dist/cjs/lib/ice/stun/const.d.ts +8 -0
- package/dist/cjs/lib/ice/stun/const.js +25 -0
- package/dist/cjs/lib/ice/stun/message.d.ts +1 -0
- package/dist/cjs/lib/ice/stun/message.js +17 -0
- package/dist/cjs/lib/ice/stun/protocol.d.ts +30 -0
- package/dist/cjs/lib/ice/stun/protocol.js +125 -0
- package/dist/cjs/lib/ice/stun/tcpFrame.d.ts +5 -0
- package/dist/cjs/lib/ice/stun/tcpFrame.js +25 -0
- package/dist/cjs/lib/ice/stun/tcpProtocol.d.ts +57 -0
- package/dist/cjs/lib/ice/stun/tcpProtocol.js +323 -0
- package/dist/cjs/lib/ice/stun/transaction.d.ts +75 -0
- package/dist/cjs/lib/ice/stun/transaction.js +239 -0
- package/dist/cjs/lib/ice/turn/frame.d.ts +1 -0
- package/dist/cjs/lib/ice/turn/frame.js +17 -0
- package/dist/cjs/lib/ice/turn/protocol.d.ts +170 -0
- package/dist/cjs/lib/ice/turn/protocol.js +638 -0
- package/dist/cjs/lib/ice/types/model.d.ts +56 -0
- package/dist/cjs/lib/ice/types/model.js +2 -0
- package/dist/cjs/lib/ice/utils.d.ts +13 -0
- package/dist/cjs/lib/ice/utils.js +84 -0
- package/dist/cjs/lib/peer/const.d.ts +36 -0
- package/dist/cjs/lib/peer/const.js +53 -0
- package/dist/cjs/lib/peer/dataChannel.d.ts +69 -0
- package/dist/cjs/lib/peer/dataChannel.js +133 -0
- package/dist/cjs/lib/peer/errors.d.ts +11 -0
- package/dist/cjs/lib/peer/errors.js +23 -0
- package/dist/cjs/lib/peer/helper.d.ts +20 -0
- package/dist/cjs/lib/peer/helper.js +84 -0
- package/dist/cjs/lib/peer/imports/common.d.ts +1 -0
- package/dist/cjs/lib/peer/imports/common.js +17 -0
- package/dist/cjs/lib/peer/imports/dtls.d.ts +1 -0
- package/dist/cjs/lib/peer/imports/dtls.js +17 -0
- package/dist/cjs/lib/peer/imports/ice.d.ts +1 -0
- package/dist/cjs/lib/peer/imports/ice.js +17 -0
- package/dist/cjs/lib/peer/imports/rtp.d.ts +1 -0
- package/dist/cjs/lib/peer/imports/rtp.js +17 -0
- package/dist/cjs/lib/peer/index.d.ts +14 -0
- package/dist/cjs/lib/peer/index.js +30 -0
- package/dist/cjs/lib/peer/media/codec.d.ts +15 -0
- package/dist/cjs/lib/peer/media/codec.js +80 -0
- package/dist/cjs/lib/peer/media/codecCompatibility.d.ts +23 -0
- package/dist/cjs/lib/peer/media/codecCompatibility.js +137 -0
- package/dist/cjs/lib/peer/media/extension/rtcpFeedback.d.ts +6 -0
- package/dist/cjs/lib/peer/media/extension/rtcpFeedback.js +13 -0
- package/dist/cjs/lib/peer/media/extension/rtpExtension.d.ts +9 -0
- package/dist/cjs/lib/peer/media/extension/rtpExtension.js +52 -0
- package/dist/cjs/lib/peer/media/index.d.ts +12 -0
- package/dist/cjs/lib/peer/media/index.js +28 -0
- package/dist/cjs/lib/peer/media/parameters.d.ts +65 -0
- package/dist/cjs/lib/peer/media/parameters.js +60 -0
- package/dist/cjs/lib/peer/media/receiver/nack.d.ts +23 -0
- package/dist/cjs/lib/peer/media/receiver/nack.js +104 -0
- package/dist/cjs/lib/peer/media/receiver/receiverTwcc.d.ts +47 -0
- package/dist/cjs/lib/peer/media/receiver/receiverTwcc.js +179 -0
- package/dist/cjs/lib/peer/media/receiver/statistics.d.ts +22 -0
- package/dist/cjs/lib/peer/media/receiver/statistics.js +71 -0
- package/dist/cjs/lib/peer/media/router.d.ts +25 -0
- package/dist/cjs/lib/peer/media/router.js +166 -0
- package/dist/cjs/lib/peer/media/rtpReceiver.d.ts +90 -0
- package/dist/cjs/lib/peer/media/rtpReceiver.js +407 -0
- package/dist/cjs/lib/peer/media/rtpSender.d.ts +209 -0
- package/dist/cjs/lib/peer/media/rtpSender.js +826 -0
- package/dist/cjs/lib/peer/media/rtpTransceiver.d.ts +117 -0
- package/dist/cjs/lib/peer/media/rtpTransceiver.js +245 -0
- package/dist/cjs/lib/peer/media/sender/cumulativeResult.d.ts +19 -0
- package/dist/cjs/lib/peer/media/sender/cumulativeResult.js +61 -0
- package/dist/cjs/lib/peer/media/sender/senderBWE.d.ts +32 -0
- package/dist/cjs/lib/peer/media/sender/senderBWE.js +99 -0
- package/dist/cjs/lib/peer/media/stats.d.ts +293 -0
- package/dist/cjs/lib/peer/media/stats.js +90 -0
- package/dist/cjs/lib/peer/media/track.d.ts +67 -0
- package/dist/cjs/lib/peer/media/track.js +216 -0
- package/dist/cjs/lib/peer/peerConnection.d.ts +458 -0
- package/dist/cjs/lib/peer/peerConnection.js +1591 -0
- package/dist/cjs/lib/peer/sctpManager.d.ts +28 -0
- package/dist/cjs/lib/peer/sctpManager.js +138 -0
- package/dist/cjs/lib/peer/sdp.d.ts +97 -0
- package/dist/cjs/lib/peer/sdp.js +628 -0
- package/dist/cjs/lib/peer/sdpManager.d.ts +116 -0
- package/dist/cjs/lib/peer/sdpManager.js +573 -0
- package/dist/cjs/lib/peer/secureTransportManager.d.ts +96 -0
- package/dist/cjs/lib/peer/secureTransportManager.js +472 -0
- package/dist/cjs/lib/peer/transceiverManager.d.ts +151 -0
- package/dist/cjs/lib/peer/transceiverManager.js +767 -0
- package/dist/cjs/lib/peer/transport/dtls.d.ts +95 -0
- package/dist/cjs/lib/peer/transport/dtls.js +571 -0
- package/dist/cjs/lib/peer/transport/ice.d.ts +143 -0
- package/dist/cjs/lib/peer/transport/ice.js +436 -0
- package/dist/cjs/lib/peer/transport/sctp.d.ts +56 -0
- package/dist/cjs/lib/peer/transport/sctp.js +387 -0
- package/dist/cjs/lib/peer/types/domain.d.ts +5 -0
- package/dist/cjs/lib/peer/types/domain.js +19 -0
- package/dist/cjs/lib/peer/types/util.d.ts +2 -0
- package/dist/cjs/lib/peer/types/util.js +2 -0
- package/dist/cjs/lib/peer/utils.d.ts +73 -0
- package/dist/cjs/lib/peer/utils.js +306 -0
- package/dist/cjs/lib/rtp/codec/av1.d.ts +56 -0
- package/dist/cjs/lib/rtp/codec/av1.js +209 -0
- package/dist/cjs/lib/rtp/codec/base.d.ts +8 -0
- package/dist/cjs/lib/rtp/codec/base.js +15 -0
- package/dist/cjs/lib/rtp/codec/h264.d.ts +32 -0
- package/dist/cjs/lib/rtp/codec/h264.js +122 -0
- package/dist/cjs/lib/rtp/codec/index.d.ts +16 -0
- package/dist/cjs/lib/rtp/codec/index.js +84 -0
- package/dist/cjs/lib/rtp/codec/leb128.d.ts +5 -0
- package/dist/cjs/lib/rtp/codec/leb128.js +23 -0
- package/dist/cjs/lib/rtp/codec/opus.d.ts +9 -0
- package/dist/cjs/lib/rtp/codec/opus.js +25 -0
- package/dist/cjs/lib/rtp/codec/vp8.d.ts +27 -0
- package/dist/cjs/lib/rtp/codec/vp8.js +109 -0
- package/dist/cjs/lib/rtp/codec/vp9.d.ts +46 -0
- package/dist/cjs/lib/rtp/codec/vp9.js +161 -0
- package/dist/cjs/lib/rtp/const.d.ts +1 -0
- package/dist/cjs/lib/rtp/const.js +4 -0
- package/dist/cjs/lib/rtp/helper.d.ts +8 -0
- package/dist/cjs/lib/rtp/helper.js +36 -0
- package/dist/cjs/lib/rtp/imports/common.d.ts +1 -0
- package/dist/cjs/lib/rtp/imports/common.js +17 -0
- package/dist/cjs/lib/rtp/index.d.ts +25 -0
- package/dist/cjs/lib/rtp/index.js +41 -0
- package/dist/cjs/lib/rtp/rtcp/header.d.ts +13 -0
- package/dist/cjs/lib/rtp/rtcp/header.js +50 -0
- package/dist/cjs/lib/rtp/rtcp/psfb/fullIntraRequest.d.ts +16 -0
- package/dist/cjs/lib/rtp/rtcp/psfb/fullIntraRequest.js +34 -0
- package/dist/cjs/lib/rtp/rtcp/psfb/index.d.ts +14 -0
- package/dist/cjs/lib/rtp/rtcp/psfb/index.js +39 -0
- package/dist/cjs/lib/rtp/rtcp/psfb/pictureLossIndication.d.ts +10 -0
- package/dist/cjs/lib/rtp/rtcp/psfb/pictureLossIndication.js +20 -0
- package/dist/cjs/lib/rtp/rtcp/psfb/remb.d.ts +16 -0
- package/dist/cjs/lib/rtp/rtcp/psfb/remb.js +53 -0
- package/dist/cjs/lib/rtp/rtcp/rr.d.ts +32 -0
- package/dist/cjs/lib/rtp/rtcp/rr.js +73 -0
- package/dist/cjs/lib/rtp/rtcp/rtcp.d.ts +10 -0
- package/dist/cjs/lib/rtp/rtcp/rtcp.js +58 -0
- package/dist/cjs/lib/rtp/rtcp/rtpfb/const.d.ts +1 -0
- package/dist/cjs/lib/rtp/rtcp/rtpfb/const.js +4 -0
- package/dist/cjs/lib/rtp/rtcp/rtpfb/index.d.ts +14 -0
- package/dist/cjs/lib/rtp/rtcp/rtpfb/index.js +35 -0
- package/dist/cjs/lib/rtp/rtcp/rtpfb/nack.d.ts +17 -0
- package/dist/cjs/lib/rtp/rtcp/rtpfb/nack.js +77 -0
- package/dist/cjs/lib/rtp/rtcp/rtpfb/twcc.d.ts +71 -0
- package/dist/cjs/lib/rtp/rtcp/rtpfb/twcc.js +352 -0
- package/dist/cjs/lib/rtp/rtcp/sdes.d.ts +26 -0
- package/dist/cjs/lib/rtp/rtcp/sdes.js +97 -0
- package/dist/cjs/lib/rtp/rtcp/sr.d.ts +41 -0
- package/dist/cjs/lib/rtp/rtcp/sr.js +110 -0
- package/dist/cjs/lib/rtp/rtp/headerExtension.d.ts +72 -0
- package/dist/cjs/lib/rtp/rtp/headerExtension.js +117 -0
- package/dist/cjs/lib/rtp/rtp/red/encoder.d.ts +13 -0
- package/dist/cjs/lib/rtp/rtp/red/encoder.js +44 -0
- package/dist/cjs/lib/rtp/rtp/red/handler.d.ts +6 -0
- package/dist/cjs/lib/rtp/rtp/red/handler.js +59 -0
- package/dist/cjs/lib/rtp/rtp/red/packet.d.ts +26 -0
- package/dist/cjs/lib/rtp/rtp/red/packet.js +112 -0
- package/dist/cjs/lib/rtp/rtp/rtp.d.ts +44 -0
- package/dist/cjs/lib/rtp/rtp/rtp.js +271 -0
- package/dist/cjs/lib/rtp/rtp/rtx.d.ts +3 -0
- package/dist/cjs/lib/rtp/rtp/rtx.js +29 -0
- package/dist/cjs/lib/rtp/srtp/cipher/ctr.d.ts +16 -0
- package/dist/cjs/lib/rtp/srtp/cipher/ctr.js +107 -0
- package/dist/cjs/lib/rtp/srtp/cipher/gcm.d.ts +17 -0
- package/dist/cjs/lib/rtp/srtp/cipher/gcm.js +145 -0
- package/dist/cjs/lib/rtp/srtp/cipher/index.d.ts +13 -0
- package/dist/cjs/lib/rtp/srtp/cipher/index.js +24 -0
- package/dist/cjs/lib/rtp/srtp/const.d.ts +6 -0
- package/dist/cjs/lib/rtp/srtp/const.js +26 -0
- package/dist/cjs/lib/rtp/srtp/context/context.d.ts +45 -0
- package/dist/cjs/lib/rtp/srtp/context/context.js +180 -0
- package/dist/cjs/lib/rtp/srtp/context/srtcp.d.ts +8 -0
- package/dist/cjs/lib/rtp/srtp/context/srtcp.js +25 -0
- package/dist/cjs/lib/rtp/srtp/context/srtp.d.ts +9 -0
- package/dist/cjs/lib/rtp/srtp/context/srtp.js +41 -0
- package/dist/cjs/lib/rtp/srtp/error.d.ts +3 -0
- package/dist/cjs/lib/rtp/srtp/error.js +10 -0
- package/dist/cjs/lib/rtp/srtp/packet.d.ts +5 -0
- package/dist/cjs/lib/rtp/srtp/packet.js +47 -0
- package/dist/cjs/lib/rtp/srtp/session.d.ts +19 -0
- package/dist/cjs/lib/rtp/srtp/session.js +13 -0
- package/dist/cjs/lib/rtp/srtp/srtcp.d.ts +8 -0
- package/dist/cjs/lib/rtp/srtp/srtcp.js +21 -0
- package/dist/cjs/lib/rtp/srtp/srtp.d.ts +9 -0
- package/dist/cjs/lib/rtp/srtp/srtp.js +20 -0
- package/dist/cjs/lib/rtp/transport.d.ts +15 -0
- package/dist/cjs/lib/rtp/transport.js +23 -0
- package/dist/cjs/lib/rtp/util.d.ts +11 -0
- package/dist/cjs/lib/rtp/util.js +28 -0
- package/dist/cjs/lib/sctp/chunk.d.ts +164 -0
- package/dist/cjs/lib/sctp/chunk.js +542 -0
- package/dist/cjs/lib/sctp/const.d.ts +17 -0
- package/dist/cjs/lib/sctp/const.js +22 -0
- package/dist/cjs/lib/sctp/helper.d.ts +5 -0
- package/dist/cjs/lib/sctp/helper.js +14 -0
- package/dist/cjs/lib/sctp/imports/common.d.ts +1 -0
- package/dist/cjs/lib/sctp/imports/common.js +17 -0
- package/dist/cjs/lib/sctp/index.d.ts +6 -0
- package/dist/cjs/lib/sctp/index.js +20 -0
- package/dist/cjs/lib/sctp/param.d.ts +40 -0
- package/dist/cjs/lib/sctp/param.js +132 -0
- package/dist/cjs/lib/sctp/sctp.d.ts +210 -0
- package/dist/cjs/lib/sctp/sctp.js +1467 -0
- package/dist/cjs/lib/sctp/transport.d.ts +15 -0
- package/dist/cjs/lib/sctp/transport.js +28 -0
- package/dist/cjs/lib/turn/index.d.ts +9 -0
- package/dist/cjs/lib/turn/index.js +25 -0
- package/dist/cjs/lib/turn/node/server.d.ts +21 -0
- package/dist/cjs/lib/turn/node/server.js +94 -0
- package/dist/cjs/lib/turn/node/turnServer.d.ts +91 -0
- package/dist/cjs/lib/turn/node/turnServer.js +565 -0
- package/dist/cjs/lib/turn/protocol.d.ts +47 -0
- package/dist/cjs/lib/turn/protocol.js +116 -0
- package/dist/cjs/lib/turn/stun/attributes.d.ts +37 -0
- package/dist/cjs/lib/turn/stun/attributes.js +208 -0
- package/dist/cjs/lib/turn/stun/const.d.ts +28 -0
- package/dist/cjs/lib/turn/stun/const.js +87 -0
- package/dist/cjs/lib/turn/stun/ip.d.ts +12 -0
- package/dist/cjs/lib/turn/stun/ip.js +87 -0
- package/dist/cjs/lib/turn/stun/message.d.ts +37 -0
- package/dist/cjs/lib/turn/stun/message.js +180 -0
- package/dist/cjs/lib/turn/turn/auth.d.ts +1 -0
- package/dist/cjs/lib/turn/turn/auth.js +9 -0
- package/dist/cjs/lib/turn/turn/frame.d.ts +13 -0
- package/dist/cjs/lib/turn/turn/frame.js +68 -0
- package/dist/cjs/lib/turn/turn/protocol.d.ts +147 -0
- package/dist/cjs/lib/turn/turn/protocol.js +785 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/peer/Endpoints.d.ts +75 -0
- package/dist/cjs/peer/Endpoints.js +154 -0
- package/dist/cjs/peer/EngineConfig.d.ts +20 -0
- package/dist/cjs/peer/EngineConfig.js +36 -0
- package/dist/cjs/peer/EngineConnection.d.ts +22 -0
- package/dist/cjs/peer/EngineConnection.js +27 -0
- package/dist/cjs/peer/Events.d.ts +55 -0
- package/dist/cjs/peer/Events.js +85 -0
- package/dist/cjs/peer/MediaCodecs.d.ts +27 -0
- package/dist/cjs/peer/MediaCodecs.js +53 -0
- package/dist/cjs/peer/MediaTrack.d.ts +212 -0
- package/dist/cjs/peer/MediaTrack.js +313 -0
- package/dist/cjs/peer/PeerChannel.d.ts +248 -0
- package/dist/cjs/peer/PeerChannel.js +319 -0
- package/dist/cjs/peer/PeerConnection.d.ts +603 -0
- package/dist/cjs/peer/PeerConnection.js +697 -0
- package/dist/cjs/peer/PeerThreadChannel.d.ts +112 -0
- package/dist/cjs/peer/PeerThreadChannel.js +273 -0
- package/dist/cjs/peer/PeerThreadProtocol.d.ts +325 -0
- package/dist/cjs/peer/PeerThreadProtocol.js +2 -0
- package/dist/cjs/peer/PeerThreads.d.ts +114 -0
- package/dist/cjs/peer/PeerThreads.js +268 -0
- package/dist/cjs/peer/PeerWorker.d.ts +6 -0
- package/dist/cjs/peer/PeerWorker.js +461 -0
- package/dist/cjs/peer/PeerWorkerCode.d.ts +5 -0
- package/dist/cjs/peer/PeerWorkerCode.js +4 -0
- package/dist/cjs/peer/RemoteConnection.d.ts +314 -0
- package/dist/cjs/peer/RemoteConnection.js +913 -0
- package/dist/cjs/peer/RtpPacket.d.ts +112 -0
- package/dist/cjs/peer/RtpPacket.js +92 -0
- package/dist/cjs/peer/RtpTransceiver.d.ts +167 -0
- package/dist/cjs/peer/RtpTransceiver.js +235 -0
- package/dist/cjs/peer/SignalingClient.d.ts +236 -0
- package/dist/cjs/peer/SignalingClient.js +285 -0
- package/dist/cjs/protocol/SignalingProtocol.d.ts +266 -0
- package/dist/cjs/protocol/SignalingProtocol.js +65 -0
- package/dist/cjs/service/WebRTCServiceEntrypoint.d.ts +158 -0
- package/dist/cjs/service/WebRTCServiceEntrypoint.js +356 -0
- package/dist/cjs/sfu/SFU.d.ts +356 -0
- package/dist/cjs/sfu/SFU.js +763 -0
- package/dist/cjs/sfu/SFUAccess.d.ts +48 -0
- package/dist/cjs/sfu/SFUAccess.js +15 -0
- package/dist/cjs/sfu/SFUClusterLeg.d.ts +101 -0
- package/dist/cjs/sfu/SFUClusterLeg.js +106 -0
- package/dist/cjs/sfu/SFURoom.d.ts +148 -0
- package/dist/cjs/sfu/SFURoom.js +1300 -0
- package/dist/cjs/sfu/SFUWorker.d.ts +13 -0
- package/dist/cjs/sfu/SFUWorker.js +168 -0
- package/dist/cjs/sfu/SFUWorkerChannel.d.ts +204 -0
- package/dist/cjs/sfu/SFUWorkerChannel.js +105 -0
- package/dist/cjs/sfu/SFUWorkerCode.d.ts +5 -0
- package/dist/cjs/sfu/SFUWorkerCode.js +4 -0
- package/dist/cjs/sfu/SFUWorkers.d.ts +247 -0
- package/dist/cjs/sfu/SFUWorkers.js +552 -0
- package/dist/cjs/shared/ChunkedChannel.d.ts +122 -0
- package/dist/cjs/shared/ChunkedChannel.js +182 -0
- package/dist/cjs/shared/Connections.d.ts +231 -0
- package/dist/cjs/shared/Connections.js +2 -0
- package/dist/cjs/shared/Emitter.d.ts +50 -0
- package/dist/cjs/shared/Emitter.js +80 -0
- package/dist/cjs/shared/Peer.d.ts +182 -0
- package/dist/cjs/shared/Peer.js +509 -0
- package/dist/cjs/shared/PeerServiceProxy.d.ts +173 -0
- package/dist/cjs/shared/PeerServiceProxy.js +304 -0
- package/dist/cjs/shared/Room.d.ts +143 -0
- package/dist/cjs/shared/Room.js +515 -0
- package/dist/cjs/shared/SignalingError.d.ts +40 -0
- package/dist/cjs/shared/SignalingError.js +48 -0
- package/dist/cjs/shared/SignalingSession.d.ts +97 -0
- package/dist/cjs/shared/SignalingSession.js +347 -0
- package/dist/cjs/shared/Transports.d.ts +139 -0
- package/dist/cjs/shared/Transports.js +285 -0
- package/dist/cjs/signaling/MediaServers.d.ts +40 -0
- package/dist/cjs/signaling/MediaServers.js +16 -0
- package/dist/cjs/signaling/Signaling.d.ts +573 -0
- package/dist/cjs/signaling/Signaling.js +945 -0
- package/dist/cjs/signaling/SignalingController.d.ts +128 -0
- package/dist/cjs/signaling/SignalingController.js +229 -0
- package/dist/cjs/turn/TURNCredentials.d.ts +49 -0
- package/dist/cjs/turn/TURNCredentials.js +49 -0
- package/dist/cjs/turn/TURNIceServers.d.ts +11 -0
- package/dist/cjs/turn/TURNIceServers.js +25 -0
- package/dist/cjs/turn/TURNServer.d.ts +309 -0
- package/dist/cjs/turn/TURNServer.js +331 -0
- package/dist/cjs/turn/TURNWorker.d.ts +42 -0
- package/dist/cjs/turn/TURNWorker.js +52 -0
- package/dist/cjs/turn/TURNWorkerCode.d.ts +5 -0
- package/dist/cjs/turn/TURNWorkerCode.js +4 -0
- package/dist/cjs/turn/TURNWorkers.d.ts +52 -0
- package/dist/cjs/turn/TURNWorkers.js +211 -0
- package/dist/cjs/whep/WHEP.d.ts +386 -0
- package/dist/cjs/whep/WHEP.js +426 -0
- package/dist/cjs/whep/WHEPController.d.ts +134 -0
- package/dist/cjs/whep/WHEPController.js +301 -0
- package/dist/cjs/whip/WHIP.d.ts +426 -0
- package/dist/cjs/whip/WHIP.js +470 -0
- package/dist/cjs/whip/WHIPController.d.ts +132 -0
- package/dist/cjs/whip/WHIPController.js +299 -0
- package/dist/esm/client/SignalingConnection.js +63 -0
- package/dist/esm/cluster/Cluster.js +542 -0
- package/dist/esm/cluster/ClusterFrames.js +85 -0
- package/dist/esm/cluster/ClusterTURN.js +73 -0
- package/dist/esm/cluster/Rendezvous.js +20 -0
- package/dist/esm/cluster/transports/ClusterTransport.js +1 -0
- package/dist/esm/cluster/transports/LoadClient.js +44 -0
- package/dist/esm/cluster/transports/MemoryClusterTransport.js +43 -0
- package/dist/esm/cluster/transports/NATSClusterTransport.js +66 -0
- package/dist/esm/cluster/transports/RedisClusterTransport.js +73 -0
- package/dist/esm/exceptions/ClusterRequestException.js +14 -0
- package/dist/esm/exceptions/ClusterTimeoutException.js +13 -0
- package/dist/esm/exceptions/ClusterTransportNotFoundException.js +14 -0
- package/dist/esm/exceptions/SignalingClientRequiredException.js +15 -0
- package/dist/esm/exceptions/SignalingConnectionException.js +15 -0
- package/dist/esm/exceptions/SignalingDeniedException.js +14 -0
- package/dist/esm/exceptions/SignalingLimitException.js +14 -0
- package/dist/esm/exceptions/SignalingNotAMemberException.js +14 -0
- package/dist/esm/exceptions/WHEPDeniedException.js +18 -0
- package/dist/esm/exceptions/WHEPLimitException.js +18 -0
- package/dist/esm/exceptions/WHEPMediaTypeException.js +18 -0
- package/dist/esm/exceptions/WHEPOfferException.js +19 -0
- package/dist/esm/exceptions/WHEPSessionNotFoundException.js +18 -0
- package/dist/esm/exceptions/WHIPDeniedException.js +18 -0
- package/dist/esm/exceptions/WHIPLimitException.js +18 -0
- package/dist/esm/exceptions/WHIPMediaTypeException.js +18 -0
- package/dist/esm/exceptions/WHIPOfferException.js +19 -0
- package/dist/esm/exceptions/WHIPSessionNotFoundException.js +18 -0
- package/dist/esm/exports/Client.js +5 -0
- package/dist/esm/exports/WebRTC.js +41 -0
- package/dist/esm/lib/common/binary.js +244 -0
- package/dist/esm/lib/common/binaryData.js +392 -0
- package/dist/esm/lib/common/crc.js +118 -0
- package/dist/esm/lib/common/deque.js +85 -0
- package/dist/esm/lib/common/event.js +202 -0
- package/dist/esm/lib/common/index.js +11 -0
- package/dist/esm/lib/common/log.js +55 -0
- package/dist/esm/lib/common/network.js +52 -0
- package/dist/esm/lib/common/number.js +31 -0
- package/dist/esm/lib/common/promise.js +64 -0
- package/dist/esm/lib/common/transport.js +401 -0
- package/dist/esm/lib/common/type.js +1 -0
- package/dist/esm/lib/dtls/cipher/const.js +30 -0
- package/dist/esm/lib/dtls/cipher/create.js +98 -0
- package/dist/esm/lib/dtls/cipher/ec.js +37 -0
- package/dist/esm/lib/dtls/cipher/key-exchange.js +103 -0
- package/dist/esm/lib/dtls/cipher/namedCurve.js +24 -0
- package/dist/esm/lib/dtls/cipher/prf.js +79 -0
- package/dist/esm/lib/dtls/cipher/suites/abstract.js +37 -0
- package/dist/esm/lib/dtls/cipher/suites/aead.js +96 -0
- package/dist/esm/lib/dtls/cipher/suites/null.js +35 -0
- package/dist/esm/lib/dtls/cipher/utils.js +34 -0
- package/dist/esm/lib/dtls/cipher/x509.js +94 -0
- package/dist/esm/lib/dtls/client.js +72 -0
- package/dist/esm/lib/dtls/context/cipher.js +83 -0
- package/dist/esm/lib/dtls/context/dtls.js +45 -0
- package/dist/esm/lib/dtls/context/srtp.js +8 -0
- package/dist/esm/lib/dtls/context/transport.js +13 -0
- package/dist/esm/lib/dtls/flight/client/flight1.js +22 -0
- package/dist/esm/lib/dtls/flight/client/flight3.js +21 -0
- package/dist/esm/lib/dtls/flight/client/flight5.js +202 -0
- package/dist/esm/lib/dtls/flight/flight.js +64 -0
- package/dist/esm/lib/dtls/flight/server/flight2.js +122 -0
- package/dist/esm/lib/dtls/flight/server/flight4.js +83 -0
- package/dist/esm/lib/dtls/flight/server/flight6.js +107 -0
- package/dist/esm/lib/dtls/handshake/binary.js +17 -0
- package/dist/esm/lib/dtls/handshake/const.js +14 -0
- package/dist/esm/lib/dtls/handshake/extensions/ellipticCurves.js +36 -0
- package/dist/esm/lib/dtls/handshake/extensions/extendedMasterSecret.js +3 -0
- package/dist/esm/lib/dtls/handshake/extensions/renegotiationIndication.js +30 -0
- package/dist/esm/lib/dtls/handshake/extensions/signature.js +35 -0
- package/dist/esm/lib/dtls/handshake/extensions/useSrtp.js +61 -0
- package/dist/esm/lib/dtls/handshake/message/alert.js +20 -0
- package/dist/esm/lib/dtls/handshake/message/certificate.js +31 -0
- package/dist/esm/lib/dtls/handshake/message/changeCipherSpec.js +20 -0
- package/dist/esm/lib/dtls/handshake/message/client/certificateVerify.js +31 -0
- package/dist/esm/lib/dtls/handshake/message/client/hello.js +44 -0
- package/dist/esm/lib/dtls/handshake/message/client/keyExchange.js +29 -0
- package/dist/esm/lib/dtls/handshake/message/finished.js +22 -0
- package/dist/esm/lib/dtls/handshake/message/server/certificateRequest.js +34 -0
- package/dist/esm/lib/dtls/handshake/message/server/hello.js +53 -0
- package/dist/esm/lib/dtls/handshake/message/server/helloDone.js +26 -0
- package/dist/esm/lib/dtls/handshake/message/server/helloVerifyRequest.js +38 -0
- package/dist/esm/lib/dtls/handshake/message/server/keyExchange.js +45 -0
- package/dist/esm/lib/dtls/handshake/random.js +25 -0
- package/dist/esm/lib/dtls/helper.js +23 -0
- package/dist/esm/lib/dtls/imports/common.js +1 -0
- package/dist/esm/lib/dtls/imports/rtp.js +1 -0
- package/dist/esm/lib/dtls/index.js +97 -0
- package/dist/esm/lib/dtls/record/antiReplayWindow.js +98 -0
- package/dist/esm/lib/dtls/record/builder.js +22 -0
- package/dist/esm/lib/dtls/record/const.js +35 -0
- package/dist/esm/lib/dtls/record/message/fragment.js +92 -0
- package/dist/esm/lib/dtls/record/message/header.js +30 -0
- package/dist/esm/lib/dtls/record/message/plaintext.js +59 -0
- package/dist/esm/lib/dtls/record/receive.js +86 -0
- package/dist/esm/lib/dtls/server.js +74 -0
- package/dist/esm/lib/dtls/socket.js +184 -0
- package/dist/esm/lib/dtls/typings/domain.js +1 -0
- package/dist/esm/lib/dtls/util/binary.js +5 -0
- package/dist/esm/lib/ice/candidate.js +190 -0
- package/dist/esm/lib/ice/dns/lookup.js +95 -0
- package/dist/esm/lib/ice/dns/mdns.js +139 -0
- package/dist/esm/lib/ice/exceptions.js +34 -0
- package/dist/esm/lib/ice/helper.js +65 -0
- package/dist/esm/lib/ice/ice.js +1547 -0
- package/dist/esm/lib/ice/iceBase.js +172 -0
- package/dist/esm/lib/ice/imports/common.js +1 -0
- package/dist/esm/lib/ice/index.js +12 -0
- package/dist/esm/lib/ice/internal/selectAddresses.js +36 -0
- package/dist/esm/lib/ice/stun/attributes.js +1 -0
- package/dist/esm/lib/ice/stun/const.js +8 -0
- package/dist/esm/lib/ice/stun/message.js +1 -0
- package/dist/esm/lib/ice/stun/protocol.js +121 -0
- package/dist/esm/lib/ice/stun/tcpFrame.js +21 -0
- package/dist/esm/lib/ice/stun/tcpProtocol.js +318 -0
- package/dist/esm/lib/ice/stun/transaction.js +230 -0
- package/dist/esm/lib/ice/turn/frame.js +1 -0
- package/dist/esm/lib/ice/turn/protocol.js +630 -0
- package/dist/esm/lib/ice/types/model.js +1 -0
- package/dist/esm/lib/ice/utils.js +43 -0
- package/dist/esm/lib/peer/const.js +50 -0
- package/dist/esm/lib/peer/dataChannel.js +127 -0
- package/dist/esm/lib/peer/errors.js +17 -0
- package/dist/esm/lib/peer/helper.js +77 -0
- package/dist/esm/lib/peer/imports/common.js +1 -0
- package/dist/esm/lib/peer/imports/dtls.js +1 -0
- package/dist/esm/lib/peer/imports/ice.js +1 -0
- package/dist/esm/lib/peer/imports/rtp.js +1 -0
- package/dist/esm/lib/peer/index.js +14 -0
- package/dist/esm/lib/peer/media/codec.js +69 -0
- package/dist/esm/lib/peer/media/codecCompatibility.js +128 -0
- package/dist/esm/lib/peer/media/extension/rtcpFeedback.js +5 -0
- package/dist/esm/lib/peer/media/extension/rtpExtension.js +42 -0
- package/dist/esm/lib/peer/media/index.js +12 -0
- package/dist/esm/lib/peer/media/parameters.js +50 -0
- package/dist/esm/lib/peer/media/receiver/nack.js +100 -0
- package/dist/esm/lib/peer/media/receiver/receiverTwcc.js +175 -0
- package/dist/esm/lib/peer/media/receiver/statistics.js +67 -0
- package/dist/esm/lib/peer/media/router.js +162 -0
- package/dist/esm/lib/peer/media/rtpReceiver.js +403 -0
- package/dist/esm/lib/peer/media/rtpSender.js +822 -0
- package/dist/esm/lib/peer/media/rtpTransceiver.js +241 -0
- package/dist/esm/lib/peer/media/sender/cumulativeResult.js +57 -0
- package/dist/esm/lib/peer/media/sender/senderBWE.js +95 -0
- package/dist/esm/lib/peer/media/stats.js +81 -0
- package/dist/esm/lib/peer/media/track.js +208 -0
- package/dist/esm/lib/peer/peerConnection.js +1585 -0
- package/dist/esm/lib/peer/sctpManager.js +134 -0
- package/dist/esm/lib/peer/sdp.js +614 -0
- package/dist/esm/lib/peer/sdpManager.js +569 -0
- package/dist/esm/lib/peer/secureTransportManager.js +468 -0
- package/dist/esm/lib/peer/transceiverManager.js +763 -0
- package/dist/esm/lib/peer/transport/dtls.js +564 -0
- package/dist/esm/lib/peer/transport/ice.js +426 -0
- package/dist/esm/lib/peer/transport/sctp.js +382 -0
- package/dist/esm/lib/peer/types/domain.js +16 -0
- package/dist/esm/lib/peer/types/util.js +1 -0
- package/dist/esm/lib/peer/utils.js +286 -0
- package/dist/esm/lib/rtp/codec/av1.js +203 -0
- package/dist/esm/lib/rtp/codec/base.js +11 -0
- package/dist/esm/lib/rtp/codec/h264.js +118 -0
- package/dist/esm/lib/rtp/codec/index.js +66 -0
- package/dist/esm/lib/rtp/codec/leb128.js +20 -0
- package/dist/esm/lib/rtp/codec/opus.js +21 -0
- package/dist/esm/lib/rtp/codec/vp8.js +105 -0
- package/dist/esm/lib/rtp/codec/vp9.js +157 -0
- package/dist/esm/lib/rtp/const.js +1 -0
- package/dist/esm/lib/rtp/helper.js +29 -0
- package/dist/esm/lib/rtp/imports/common.js +1 -0
- package/dist/esm/lib/rtp/index.js +25 -0
- package/dist/esm/lib/rtp/rtcp/header.js +46 -0
- package/dist/esm/lib/rtp/rtcp/psfb/fullIntraRequest.js +30 -0
- package/dist/esm/lib/rtp/rtcp/psfb/index.js +35 -0
- package/dist/esm/lib/rtp/rtcp/psfb/pictureLossIndication.js +16 -0
- package/dist/esm/lib/rtp/rtcp/psfb/remb.js +49 -0
- package/dist/esm/lib/rtp/rtcp/rr.js +68 -0
- package/dist/esm/lib/rtp/rtcp/rtcp.js +53 -0
- package/dist/esm/lib/rtp/rtcp/rtpfb/const.js +1 -0
- package/dist/esm/lib/rtp/rtcp/rtpfb/index.js +31 -0
- package/dist/esm/lib/rtp/rtcp/rtpfb/nack.js +73 -0
- package/dist/esm/lib/rtp/rtcp/rtpfb/twcc.js +344 -0
- package/dist/esm/lib/rtp/rtcp/sdes.js +91 -0
- package/dist/esm/lib/rtp/rtcp/sr.js +104 -0
- package/dist/esm/lib/rtp/rtp/headerExtension.js +102 -0
- package/dist/esm/lib/rtp/rtp/red/encoder.js +40 -0
- package/dist/esm/lib/rtp/rtp/red/handler.js +55 -0
- package/dist/esm/lib/rtp/rtp/red/packet.js +107 -0
- package/dist/esm/lib/rtp/rtp/rtp.js +266 -0
- package/dist/esm/lib/rtp/rtp/rtx.js +25 -0
- package/dist/esm/lib/rtp/srtp/cipher/ctr.js +103 -0
- package/dist/esm/lib/rtp/srtp/cipher/gcm.js +141 -0
- package/dist/esm/lib/rtp/srtp/cipher/index.js +20 -0
- package/dist/esm/lib/rtp/srtp/const.js +21 -0
- package/dist/esm/lib/rtp/srtp/context/context.js +175 -0
- package/dist/esm/lib/rtp/srtp/context/srtcp.js +21 -0
- package/dist/esm/lib/rtp/srtp/context/srtp.js +37 -0
- package/dist/esm/lib/rtp/srtp/error.js +6 -0
- package/dist/esm/lib/rtp/srtp/packet.js +42 -0
- package/dist/esm/lib/rtp/srtp/session.js +9 -0
- package/dist/esm/lib/rtp/srtp/srtcp.js +17 -0
- package/dist/esm/lib/rtp/srtp/srtp.js +16 -0
- package/dist/esm/lib/rtp/transport.js +18 -0
- package/dist/esm/lib/rtp/util.js +24 -0
- package/dist/esm/lib/sctp/chunk.js +515 -0
- package/dist/esm/lib/sctp/const.js +19 -0
- package/dist/esm/lib/sctp/helper.js +10 -0
- package/dist/esm/lib/sctp/imports/common.js +1 -0
- package/dist/esm/lib/sctp/index.js +4 -0
- package/dist/esm/lib/sctp/param.js +126 -0
- package/dist/esm/lib/sctp/sctp.js +1459 -0
- package/dist/esm/lib/sctp/transport.js +23 -0
- package/dist/esm/lib/turn/index.js +9 -0
- package/dist/esm/lib/turn/node/server.js +89 -0
- package/dist/esm/lib/turn/node/turnServer.js +560 -0
- package/dist/esm/lib/turn/protocol.js +112 -0
- package/dist/esm/lib/turn/stun/attributes.js +198 -0
- package/dist/esm/lib/turn/stun/const.js +82 -0
- package/dist/esm/lib/turn/stun/ip.js +81 -0
- package/dist/esm/lib/turn/stun/message.js +174 -0
- package/dist/esm/lib/turn/turn/auth.js +6 -0
- package/dist/esm/lib/turn/turn/frame.js +61 -0
- package/dist/esm/lib/turn/turn/protocol.js +781 -0
- package/dist/esm/peer/Endpoints.js +143 -0
- package/dist/esm/peer/EngineConfig.js +33 -0
- package/dist/esm/peer/EngineConnection.js +22 -0
- package/dist/esm/peer/Events.js +81 -0
- package/dist/esm/peer/MediaCodecs.js +47 -0
- package/dist/esm/peer/MediaTrack.js +305 -0
- package/dist/esm/peer/PeerChannel.js +315 -0
- package/dist/esm/peer/PeerConnection.js +694 -0
- package/dist/esm/peer/PeerThreadChannel.js +266 -0
- package/dist/esm/peer/PeerThreadProtocol.js +1 -0
- package/dist/esm/peer/PeerThreads.js +264 -0
- package/dist/esm/peer/PeerWorker.js +458 -0
- package/dist/esm/peer/PeerWorkerCode.js +1 -0
- package/dist/esm/peer/RemoteConnection.js +905 -0
- package/dist/esm/peer/RtpPacket.js +86 -0
- package/dist/esm/peer/RtpTransceiver.js +225 -0
- package/dist/esm/peer/SignalingClient.js +249 -0
- package/dist/esm/protocol/SignalingProtocol.js +62 -0
- package/dist/esm/service/WebRTCServiceEntrypoint.js +352 -0
- package/dist/esm/sfu/SFU.js +759 -0
- package/dist/esm/sfu/SFUAccess.js +12 -0
- package/dist/esm/sfu/SFUClusterLeg.js +102 -0
- package/dist/esm/sfu/SFURoom.js +1296 -0
- package/dist/esm/sfu/SFUWorker.js +165 -0
- package/dist/esm/sfu/SFUWorkerChannel.js +101 -0
- package/dist/esm/sfu/SFUWorkerCode.js +1 -0
- package/dist/esm/sfu/SFUWorkers.js +547 -0
- package/dist/esm/shared/ChunkedChannel.js +178 -0
- package/dist/esm/shared/Connections.js +1 -0
- package/dist/esm/shared/Emitter.js +76 -0
- package/dist/esm/shared/Peer.js +505 -0
- package/dist/esm/shared/PeerServiceProxy.js +299 -0
- package/dist/esm/shared/Room.js +511 -0
- package/dist/esm/shared/SignalingError.js +43 -0
- package/dist/esm/shared/SignalingSession.js +343 -0
- package/dist/esm/shared/Transports.js +279 -0
- package/dist/esm/signaling/MediaServers.js +13 -0
- package/dist/esm/signaling/Signaling.js +941 -0
- package/dist/esm/signaling/SignalingController.js +225 -0
- package/dist/esm/turn/TURNCredentials.js +44 -0
- package/dist/esm/turn/TURNIceServers.js +22 -0
- package/dist/esm/turn/TURNServer.js +327 -0
- package/dist/esm/turn/TURNWorker.js +49 -0
- package/dist/esm/turn/TURNWorkerCode.js +1 -0
- package/dist/esm/turn/TURNWorkers.js +206 -0
- package/dist/esm/whep/WHEP.js +422 -0
- package/dist/esm/whep/WHEPController.js +298 -0
- package/dist/esm/whip/WHIP.js +466 -0
- package/dist/esm/whip/WHIPController.js +296 -0
- package/dist/types/client/SignalingConnection.d.ts +81 -0
- package/dist/types/cluster/Cluster.d.ts +503 -0
- package/dist/types/cluster/ClusterFrames.d.ts +24 -0
- package/dist/types/cluster/ClusterTURN.d.ts +63 -0
- package/dist/types/cluster/Rendezvous.d.ts +8 -0
- package/dist/types/cluster/transports/ClusterTransport.d.ts +34 -0
- package/dist/types/cluster/transports/LoadClient.d.ts +6 -0
- package/dist/types/cluster/transports/MemoryClusterTransport.d.ts +13 -0
- package/dist/types/cluster/transports/NATSClusterTransport.d.ts +23 -0
- package/dist/types/cluster/transports/RedisClusterTransport.d.ts +23 -0
- package/dist/types/exceptions/ClusterRequestException.d.ts +11 -0
- package/dist/types/exceptions/ClusterTimeoutException.d.ts +10 -0
- package/dist/types/exceptions/ClusterTransportNotFoundException.d.ts +11 -0
- package/dist/types/exceptions/SignalingClientRequiredException.d.ts +12 -0
- package/dist/types/exceptions/SignalingConnectionException.d.ts +12 -0
- package/dist/types/exceptions/SignalingDeniedException.d.ts +11 -0
- package/dist/types/exceptions/SignalingLimitException.d.ts +11 -0
- package/dist/types/exceptions/SignalingNotAMemberException.d.ts +11 -0
- package/dist/types/exceptions/WHEPDeniedException.d.ts +15 -0
- package/dist/types/exceptions/WHEPLimitException.d.ts +15 -0
- package/dist/types/exceptions/WHEPMediaTypeException.d.ts +15 -0
- package/dist/types/exceptions/WHEPOfferException.d.ts +16 -0
- package/dist/types/exceptions/WHEPSessionNotFoundException.d.ts +15 -0
- package/dist/types/exceptions/WHIPDeniedException.d.ts +15 -0
- package/dist/types/exceptions/WHIPLimitException.d.ts +15 -0
- package/dist/types/exceptions/WHIPMediaTypeException.d.ts +15 -0
- package/dist/types/exceptions/WHIPOfferException.d.ts +16 -0
- package/dist/types/exceptions/WHIPSessionNotFoundException.d.ts +15 -0
- package/dist/types/exports/Client.d.ts +11 -0
- package/dist/types/exports/WebRTC.d.ts +48 -0
- package/dist/types/lib/common/binary.d.ts +51 -0
- package/dist/types/lib/common/binaryData.d.ts +116 -0
- package/dist/types/lib/common/crc.d.ts +4 -0
- package/dist/types/lib/common/deque.d.ts +36 -0
- package/dist/types/lib/common/event.d.ts +48 -0
- package/dist/types/lib/common/index.d.ts +11 -0
- package/dist/types/lib/common/log.d.ts +47 -0
- package/dist/types/lib/common/network.d.ts +10 -0
- package/dist/types/lib/common/number.d.ts +13 -0
- package/dist/types/lib/common/promise.d.ts +21 -0
- package/dist/types/lib/common/transport.d.ts +104 -0
- package/dist/types/lib/common/type.d.ts +3 -0
- package/dist/types/lib/dtls/cipher/const.d.ts +42 -0
- package/dist/types/lib/dtls/cipher/create.d.ts +21 -0
- package/dist/types/lib/dtls/cipher/ec.d.ts +28 -0
- package/dist/types/lib/dtls/cipher/key-exchange.d.ts +43 -0
- package/dist/types/lib/dtls/cipher/namedCurve.d.ts +7 -0
- package/dist/types/lib/dtls/cipher/prf.d.ts +17 -0
- package/dist/types/lib/dtls/cipher/suites/abstract.d.ts +40 -0
- package/dist/types/lib/dtls/cipher/suites/aead.d.ts +28 -0
- package/dist/types/lib/dtls/cipher/suites/null.d.ts +24 -0
- package/dist/types/lib/dtls/cipher/utils.d.ts +18 -0
- package/dist/types/lib/dtls/cipher/x509.d.ts +33 -0
- package/dist/types/lib/dtls/client.d.ts +7 -0
- package/dist/types/lib/dtls/context/cipher.d.ts +42 -0
- package/dist/types/lib/dtls/context/dtls.d.ts +38 -0
- package/dist/types/lib/dtls/context/srtp.d.ts +5 -0
- package/dist/types/lib/dtls/context/transport.d.ts +8 -0
- package/dist/types/lib/dtls/flight/client/flight1.d.ts +10 -0
- package/dist/types/lib/dtls/flight/client/flight3.d.ts +8 -0
- package/dist/types/lib/dtls/flight/client/flight5.d.ts +18 -0
- package/dist/types/lib/dtls/flight/flight.d.ts +18 -0
- package/dist/types/lib/dtls/flight/server/flight2.d.ts +6 -0
- package/dist/types/lib/dtls/flight/server/flight4.d.ts +17 -0
- package/dist/types/lib/dtls/flight/server/flight6.d.ts +13 -0
- package/dist/types/lib/dtls/handshake/binary.d.ts +16 -0
- package/dist/types/lib/dtls/handshake/const.d.ts +13 -0
- package/dist/types/lib/dtls/handshake/extensions/ellipticCurves.d.ts +17 -0
- package/dist/types/lib/dtls/handshake/extensions/extendedMasterSecret.d.ts +3 -0
- package/dist/types/lib/dtls/handshake/extensions/renegotiationIndication.d.ts +18 -0
- package/dist/types/lib/dtls/handshake/extensions/signature.d.ts +26 -0
- package/dist/types/lib/dtls/handshake/extensions/useSrtp.d.ts +19 -0
- package/dist/types/lib/dtls/handshake/message/alert.d.ts +12 -0
- package/dist/types/lib/dtls/handshake/message/certificate.d.ts +17 -0
- package/dist/types/lib/dtls/handshake/message/changeCipherSpec.d.ts +11 -0
- package/dist/types/lib/dtls/handshake/message/client/certificateVerify.d.ts +20 -0
- package/dist/types/lib/dtls/handshake/message/client/hello.d.ts +50 -0
- package/dist/types/lib/dtls/handshake/message/client/keyExchange.d.ts +17 -0
- package/dist/types/lib/dtls/handshake/message/finished.d.ts +13 -0
- package/dist/types/lib/dtls/handshake/message/server/certificateRequest.d.ts +31 -0
- package/dist/types/lib/dtls/handshake/message/server/hello.d.ts +33 -0
- package/dist/types/lib/dtls/handshake/message/server/helloDone.d.ts +12 -0
- package/dist/types/lib/dtls/handshake/message/server/helloVerifyRequest.d.ts +32 -0
- package/dist/types/lib/dtls/handshake/message/server/keyExchange.d.ts +32 -0
- package/dist/types/lib/dtls/handshake/random.d.ts +13 -0
- package/dist/types/lib/dtls/helper.d.ts +4 -0
- package/dist/types/lib/dtls/imports/common.d.ts +1 -0
- package/dist/types/lib/dtls/imports/rtp.d.ts +1 -0
- package/dist/types/lib/dtls/index.d.ts +7 -0
- package/dist/types/lib/dtls/record/antiReplayWindow.d.ts +27 -0
- package/dist/types/lib/dtls/record/builder.d.ts +9 -0
- package/dist/types/lib/dtls/record/const.d.ts +33 -0
- package/dist/types/lib/dtls/record/message/fragment.d.ts +26 -0
- package/dist/types/lib/dtls/record/message/header.d.ts +38 -0
- package/dist/types/lib/dtls/record/message/plaintext.d.ts +14 -0
- package/dist/types/lib/dtls/record/receive.d.ts +9 -0
- package/dist/types/lib/dtls/server.d.ts +6 -0
- package/dist/types/lib/dtls/socket.d.ts +52 -0
- package/dist/types/lib/dtls/typings/domain.d.ts +20 -0
- package/dist/types/lib/dtls/util/binary.d.ts +2 -0
- package/dist/types/lib/ice/candidate.d.ts +35 -0
- package/dist/types/lib/ice/dns/lookup.d.ts +16 -0
- package/dist/types/lib/ice/dns/mdns.d.ts +38 -0
- package/dist/types/lib/ice/exceptions.d.ts +24 -0
- package/dist/types/lib/ice/helper.d.ts +17 -0
- package/dist/types/lib/ice/ice.d.ts +182 -0
- package/dist/types/lib/ice/iceBase.d.ts +214 -0
- package/dist/types/lib/ice/imports/common.d.ts +1 -0
- package/dist/types/lib/ice/index.d.ts +12 -0
- package/dist/types/lib/ice/internal/selectAddresses.d.ts +9 -0
- package/dist/types/lib/ice/stun/attributes.d.ts +1 -0
- package/dist/types/lib/ice/stun/const.d.ts +8 -0
- package/dist/types/lib/ice/stun/message.d.ts +1 -0
- package/dist/types/lib/ice/stun/protocol.d.ts +30 -0
- package/dist/types/lib/ice/stun/tcpFrame.d.ts +5 -0
- package/dist/types/lib/ice/stun/tcpProtocol.d.ts +57 -0
- package/dist/types/lib/ice/stun/transaction.d.ts +75 -0
- package/dist/types/lib/ice/turn/frame.d.ts +1 -0
- package/dist/types/lib/ice/turn/protocol.d.ts +170 -0
- package/dist/types/lib/ice/types/model.d.ts +56 -0
- package/dist/types/lib/ice/utils.d.ts +13 -0
- package/dist/types/lib/peer/const.d.ts +36 -0
- package/dist/types/lib/peer/dataChannel.d.ts +69 -0
- package/dist/types/lib/peer/errors.d.ts +11 -0
- package/dist/types/lib/peer/helper.d.ts +20 -0
- package/dist/types/lib/peer/imports/common.d.ts +1 -0
- package/dist/types/lib/peer/imports/dtls.d.ts +1 -0
- package/dist/types/lib/peer/imports/ice.d.ts +1 -0
- package/dist/types/lib/peer/imports/rtp.d.ts +1 -0
- package/dist/types/lib/peer/index.d.ts +14 -0
- package/dist/types/lib/peer/media/codec.d.ts +15 -0
- package/dist/types/lib/peer/media/codecCompatibility.d.ts +23 -0
- package/dist/types/lib/peer/media/extension/rtcpFeedback.d.ts +6 -0
- package/dist/types/lib/peer/media/extension/rtpExtension.d.ts +9 -0
- package/dist/types/lib/peer/media/index.d.ts +12 -0
- package/dist/types/lib/peer/media/parameters.d.ts +65 -0
- package/dist/types/lib/peer/media/receiver/nack.d.ts +23 -0
- package/dist/types/lib/peer/media/receiver/receiverTwcc.d.ts +47 -0
- package/dist/types/lib/peer/media/receiver/statistics.d.ts +22 -0
- package/dist/types/lib/peer/media/router.d.ts +25 -0
- package/dist/types/lib/peer/media/rtpReceiver.d.ts +90 -0
- package/dist/types/lib/peer/media/rtpSender.d.ts +209 -0
- package/dist/types/lib/peer/media/rtpTransceiver.d.ts +117 -0
- package/dist/types/lib/peer/media/sender/cumulativeResult.d.ts +19 -0
- package/dist/types/lib/peer/media/sender/senderBWE.d.ts +32 -0
- package/dist/types/lib/peer/media/stats.d.ts +293 -0
- package/dist/types/lib/peer/media/track.d.ts +67 -0
- package/dist/types/lib/peer/peerConnection.d.ts +458 -0
- package/dist/types/lib/peer/sctpManager.d.ts +28 -0
- package/dist/types/lib/peer/sdp.d.ts +97 -0
- package/dist/types/lib/peer/sdpManager.d.ts +116 -0
- package/dist/types/lib/peer/secureTransportManager.d.ts +96 -0
- package/dist/types/lib/peer/transceiverManager.d.ts +151 -0
- package/dist/types/lib/peer/transport/dtls.d.ts +95 -0
- package/dist/types/lib/peer/transport/ice.d.ts +143 -0
- package/dist/types/lib/peer/transport/sctp.d.ts +56 -0
- package/dist/types/lib/peer/types/domain.d.ts +5 -0
- package/dist/types/lib/peer/types/util.d.ts +2 -0
- package/dist/types/lib/peer/utils.d.ts +73 -0
- package/dist/types/lib/rtp/codec/av1.d.ts +56 -0
- package/dist/types/lib/rtp/codec/base.d.ts +8 -0
- package/dist/types/lib/rtp/codec/h264.d.ts +32 -0
- package/dist/types/lib/rtp/codec/index.d.ts +16 -0
- package/dist/types/lib/rtp/codec/leb128.d.ts +5 -0
- package/dist/types/lib/rtp/codec/opus.d.ts +9 -0
- package/dist/types/lib/rtp/codec/vp8.d.ts +27 -0
- package/dist/types/lib/rtp/codec/vp9.d.ts +46 -0
- package/dist/types/lib/rtp/const.d.ts +1 -0
- package/dist/types/lib/rtp/helper.d.ts +8 -0
- package/dist/types/lib/rtp/imports/common.d.ts +1 -0
- package/dist/types/lib/rtp/index.d.ts +25 -0
- package/dist/types/lib/rtp/rtcp/header.d.ts +13 -0
- package/dist/types/lib/rtp/rtcp/psfb/fullIntraRequest.d.ts +16 -0
- package/dist/types/lib/rtp/rtcp/psfb/index.d.ts +14 -0
- package/dist/types/lib/rtp/rtcp/psfb/pictureLossIndication.d.ts +10 -0
- package/dist/types/lib/rtp/rtcp/psfb/remb.d.ts +16 -0
- package/dist/types/lib/rtp/rtcp/rr.d.ts +32 -0
- package/dist/types/lib/rtp/rtcp/rtcp.d.ts +10 -0
- package/dist/types/lib/rtp/rtcp/rtpfb/const.d.ts +1 -0
- package/dist/types/lib/rtp/rtcp/rtpfb/index.d.ts +14 -0
- package/dist/types/lib/rtp/rtcp/rtpfb/nack.d.ts +17 -0
- package/dist/types/lib/rtp/rtcp/rtpfb/twcc.d.ts +71 -0
- package/dist/types/lib/rtp/rtcp/sdes.d.ts +26 -0
- package/dist/types/lib/rtp/rtcp/sr.d.ts +41 -0
- package/dist/types/lib/rtp/rtp/headerExtension.d.ts +72 -0
- package/dist/types/lib/rtp/rtp/red/encoder.d.ts +13 -0
- package/dist/types/lib/rtp/rtp/red/handler.d.ts +6 -0
- package/dist/types/lib/rtp/rtp/red/packet.d.ts +26 -0
- package/dist/types/lib/rtp/rtp/rtp.d.ts +44 -0
- package/dist/types/lib/rtp/rtp/rtx.d.ts +3 -0
- package/dist/types/lib/rtp/srtp/cipher/ctr.d.ts +16 -0
- package/dist/types/lib/rtp/srtp/cipher/gcm.d.ts +17 -0
- package/dist/types/lib/rtp/srtp/cipher/index.d.ts +13 -0
- package/dist/types/lib/rtp/srtp/const.d.ts +6 -0
- package/dist/types/lib/rtp/srtp/context/context.d.ts +45 -0
- package/dist/types/lib/rtp/srtp/context/srtcp.d.ts +8 -0
- package/dist/types/lib/rtp/srtp/context/srtp.d.ts +9 -0
- package/dist/types/lib/rtp/srtp/error.d.ts +3 -0
- package/dist/types/lib/rtp/srtp/packet.d.ts +5 -0
- package/dist/types/lib/rtp/srtp/session.d.ts +19 -0
- package/dist/types/lib/rtp/srtp/srtcp.d.ts +8 -0
- package/dist/types/lib/rtp/srtp/srtp.d.ts +9 -0
- package/dist/types/lib/rtp/transport.d.ts +15 -0
- package/dist/types/lib/rtp/util.d.ts +11 -0
- package/dist/types/lib/sctp/chunk.d.ts +164 -0
- package/dist/types/lib/sctp/const.d.ts +17 -0
- package/dist/types/lib/sctp/helper.d.ts +5 -0
- package/dist/types/lib/sctp/imports/common.d.ts +1 -0
- package/dist/types/lib/sctp/index.d.ts +6 -0
- package/dist/types/lib/sctp/param.d.ts +40 -0
- package/dist/types/lib/sctp/sctp.d.ts +210 -0
- package/dist/types/lib/sctp/transport.d.ts +15 -0
- package/dist/types/lib/turn/index.d.ts +9 -0
- package/dist/types/lib/turn/node/server.d.ts +21 -0
- package/dist/types/lib/turn/node/turnServer.d.ts +91 -0
- package/dist/types/lib/turn/protocol.d.ts +47 -0
- package/dist/types/lib/turn/stun/attributes.d.ts +37 -0
- package/dist/types/lib/turn/stun/const.d.ts +28 -0
- package/dist/types/lib/turn/stun/ip.d.ts +12 -0
- package/dist/types/lib/turn/stun/message.d.ts +37 -0
- package/dist/types/lib/turn/turn/auth.d.ts +1 -0
- package/dist/types/lib/turn/turn/frame.d.ts +13 -0
- package/dist/types/lib/turn/turn/protocol.d.ts +147 -0
- package/dist/types/peer/Endpoints.d.ts +75 -0
- package/dist/types/peer/EngineConfig.d.ts +20 -0
- package/dist/types/peer/EngineConnection.d.ts +22 -0
- package/dist/types/peer/Events.d.ts +55 -0
- package/dist/types/peer/MediaCodecs.d.ts +27 -0
- package/dist/types/peer/MediaTrack.d.ts +212 -0
- package/dist/types/peer/PeerChannel.d.ts +248 -0
- package/dist/types/peer/PeerConnection.d.ts +603 -0
- package/dist/types/peer/PeerThreadChannel.d.ts +112 -0
- package/dist/types/peer/PeerThreadProtocol.d.ts +325 -0
- package/dist/types/peer/PeerThreads.d.ts +114 -0
- package/dist/types/peer/PeerWorker.d.ts +6 -0
- package/dist/types/peer/PeerWorkerCode.d.ts +5 -0
- package/dist/types/peer/RemoteConnection.d.ts +314 -0
- package/dist/types/peer/RtpPacket.d.ts +112 -0
- package/dist/types/peer/RtpTransceiver.d.ts +167 -0
- package/dist/types/peer/SignalingClient.d.ts +236 -0
- package/dist/types/protocol/SignalingProtocol.d.ts +266 -0
- package/dist/types/service/WebRTCServiceEntrypoint.d.ts +158 -0
- package/dist/types/sfu/SFU.d.ts +356 -0
- package/dist/types/sfu/SFUAccess.d.ts +48 -0
- package/dist/types/sfu/SFUClusterLeg.d.ts +101 -0
- package/dist/types/sfu/SFURoom.d.ts +148 -0
- package/dist/types/sfu/SFUWorker.d.ts +13 -0
- package/dist/types/sfu/SFUWorkerChannel.d.ts +204 -0
- package/dist/types/sfu/SFUWorkerCode.d.ts +5 -0
- package/dist/types/sfu/SFUWorkers.d.ts +247 -0
- package/dist/types/shared/ChunkedChannel.d.ts +122 -0
- package/dist/types/shared/Connections.d.ts +231 -0
- package/dist/types/shared/Emitter.d.ts +50 -0
- package/dist/types/shared/Peer.d.ts +182 -0
- package/dist/types/shared/PeerServiceProxy.d.ts +173 -0
- package/dist/types/shared/Room.d.ts +143 -0
- package/dist/types/shared/SignalingError.d.ts +40 -0
- package/dist/types/shared/SignalingSession.d.ts +97 -0
- package/dist/types/shared/Transports.d.ts +139 -0
- package/dist/types/signaling/MediaServers.d.ts +40 -0
- package/dist/types/signaling/Signaling.d.ts +573 -0
- package/dist/types/signaling/SignalingController.d.ts +128 -0
- package/dist/types/turn/TURNCredentials.d.ts +49 -0
- package/dist/types/turn/TURNIceServers.d.ts +11 -0
- package/dist/types/turn/TURNServer.d.ts +309 -0
- package/dist/types/turn/TURNWorker.d.ts +42 -0
- package/dist/types/turn/TURNWorkerCode.d.ts +5 -0
- package/dist/types/turn/TURNWorkers.d.ts +52 -0
- package/dist/types/whep/WHEP.d.ts +386 -0
- package/dist/types/whep/WHEPController.d.ts +134 -0
- package/dist/types/whip/WHIP.d.ts +426 -0
- package/dist/types/whip/WHIPController.d.ts +132 -0
- package/package.json +115 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"commonjs"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { IncomingMessage } from 'node:http';
|
|
2
|
+
import type { SignalingDescription, SignalingIceServer } from '../protocol/SignalingProtocol.js';
|
|
3
|
+
import type { PeerConnection } from './PeerConnection.js';
|
|
4
|
+
/**
|
|
5
|
+
* How long an answer of an HTTP endpoint (WHIP, WHEP) waits for the candidates of its connection at most, in
|
|
6
|
+
* milliseconds
|
|
7
|
+
*/
|
|
8
|
+
export declare const GATHERING_TIMEOUT: number;
|
|
9
|
+
/**
|
|
10
|
+
* Wait for the candidates of a connection, all of them or for a time at most
|
|
11
|
+
* @param connection
|
|
12
|
+
* @param timeout
|
|
13
|
+
*/
|
|
14
|
+
export declare function gathered(connection: PeerConnection, timeout?: number): Promise<void>;
|
|
15
|
+
/**
|
|
16
|
+
* The connection of a session of an HTTP endpoint (WHIP, WHEP) to its client, wherever it is (in a worker thread for a
|
|
17
|
+
* media server forwarding in some): the answer to the offer of the client, its PATCH requests, and the end of the
|
|
18
|
+
* session
|
|
19
|
+
*/
|
|
20
|
+
export interface EndpointLeg {
|
|
21
|
+
readonly answer: SignalingDescription;
|
|
22
|
+
patch(fragment: string, restart: boolean): Promise<string | undefined | null>;
|
|
23
|
+
ended(listener: () => void): void;
|
|
24
|
+
close(): void;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The bearer token of a request
|
|
28
|
+
* @param request
|
|
29
|
+
*/
|
|
30
|
+
export declare function bearerOf(request: IncomingMessage): string | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* The path of a request, without its query and its last slash
|
|
33
|
+
* @param request
|
|
34
|
+
*/
|
|
35
|
+
export declare function pathOf(request: IncomingMessage): string;
|
|
36
|
+
/**
|
|
37
|
+
* A `Link` header of each ICE server (RFC 9725, section 4.6)
|
|
38
|
+
* @param iceServers
|
|
39
|
+
*/
|
|
40
|
+
export declare function linksOf(iceServers: SignalingIceServer[]): string[];
|
|
41
|
+
/**
|
|
42
|
+
* The ICE of a fragment of SDP (RFC 8840): its credentials, and its candidates with the media they belong to
|
|
43
|
+
* @param fragment
|
|
44
|
+
*/
|
|
45
|
+
export declare function iceOf(fragment: string): {
|
|
46
|
+
ufrag?: string;
|
|
47
|
+
pwd?: string;
|
|
48
|
+
candidates: {
|
|
49
|
+
candidate: string;
|
|
50
|
+
sdpMid?: string;
|
|
51
|
+
}[];
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Apply a PATCH of a session of an HTTP endpoint (RFC 9725, section 4.3) to its connection: the candidates of the
|
|
55
|
+
* client (trickle ICE), or an ICE restart when its credentials changed. The server answering the offer of the client,
|
|
56
|
+
* a restart is an offer of the client again, its credentials replaced, that the connection answers with new ones.
|
|
57
|
+
* @param connection
|
|
58
|
+
* @param fragment The fragment of SDP of the request (`application/trickle-ice-sdpfrag`).
|
|
59
|
+
* @param restart Whether the request may restart ICE (its `If-Match` is `*`): a fragment of other credentials without
|
|
60
|
+
* it is of an ICE session gone (a request sent again after a restart), not applied.
|
|
61
|
+
* @returns The fragment of the answer of a restart (its credentials, its candidates); none for trickle ICE; `null` for
|
|
62
|
+
* a fragment of an ICE session gone.
|
|
63
|
+
* @throws {Error} When the fragment has no ICE, or the connection refuses it.
|
|
64
|
+
*/
|
|
65
|
+
export declare function patchConnection(connection: PeerConnection, fragment: string, restart: boolean): Promise<string | undefined | null>;
|
|
66
|
+
/**
|
|
67
|
+
* The fragment of SDP of the ICE of a description (RFC 8840): its credentials, and the candidates of its first media
|
|
68
|
+
* (the one the others are bundled on)
|
|
69
|
+
* @param sdp
|
|
70
|
+
*/
|
|
71
|
+
export declare function fragmentOf(sdp: string): string;
|
|
72
|
+
/**
|
|
73
|
+
* A new entity tag of an ICE session (the `ETag` of a session of an HTTP endpoint)
|
|
74
|
+
*/
|
|
75
|
+
export declare function entityTag(): string;
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GATHERING_TIMEOUT = void 0;
|
|
4
|
+
exports.gathered = gathered;
|
|
5
|
+
exports.bearerOf = bearerOf;
|
|
6
|
+
exports.pathOf = pathOf;
|
|
7
|
+
exports.linksOf = linksOf;
|
|
8
|
+
exports.iceOf = iceOf;
|
|
9
|
+
exports.patchConnection = patchConnection;
|
|
10
|
+
exports.fragmentOf = fragmentOf;
|
|
11
|
+
exports.entityTag = entityTag;
|
|
12
|
+
const node_crypto_1 = require("node:crypto");
|
|
13
|
+
/**
|
|
14
|
+
* How long an answer of an HTTP endpoint (WHIP, WHEP) waits for the candidates of its connection at most, in
|
|
15
|
+
* milliseconds
|
|
16
|
+
*/
|
|
17
|
+
exports.GATHERING_TIMEOUT = 5000;
|
|
18
|
+
/**
|
|
19
|
+
* Wait for the candidates of a connection, all of them or for a time at most
|
|
20
|
+
* @param connection
|
|
21
|
+
* @param timeout
|
|
22
|
+
*/
|
|
23
|
+
function gathered(connection, timeout = exports.GATHERING_TIMEOUT) {
|
|
24
|
+
if (connection.iceGatheringState === 'complete')
|
|
25
|
+
return Promise.resolve();
|
|
26
|
+
return new Promise((resolve) => {
|
|
27
|
+
const done = () => {
|
|
28
|
+
clearTimeout(timer);
|
|
29
|
+
connection.off('icegatheringstatechange', changed);
|
|
30
|
+
resolve();
|
|
31
|
+
};
|
|
32
|
+
const changed = (state) => {
|
|
33
|
+
if (state === 'complete')
|
|
34
|
+
done();
|
|
35
|
+
};
|
|
36
|
+
const timer = setTimeout(done, timeout);
|
|
37
|
+
connection.on('icegatheringstatechange', changed);
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The bearer token of a request
|
|
42
|
+
* @param request
|
|
43
|
+
*/
|
|
44
|
+
function bearerOf(request) {
|
|
45
|
+
return /^Bearer\s+(\S+)\s*$/i.exec(request.headers.authorization ?? '')?.[1];
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The path of a request, without its query and its last slash
|
|
49
|
+
* @param request
|
|
50
|
+
*/
|
|
51
|
+
function pathOf(request) {
|
|
52
|
+
const url = request.originalUrl ?? request.url ?? '';
|
|
53
|
+
return url.split('?')[0].replace(/\/+$/, '');
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* A `Link` header of each ICE server (RFC 9725, section 4.6)
|
|
57
|
+
* @param iceServers
|
|
58
|
+
*/
|
|
59
|
+
function linksOf(iceServers) {
|
|
60
|
+
const quoted = (value) => `"${value.replace(/["\\]/g, '\\$&')}"`;
|
|
61
|
+
return iceServers.flatMap((server) => (Array.isArray(server.urls) ? server.urls : [server.urls]).map((url) => {
|
|
62
|
+
const credentials = server.username && server.credential
|
|
63
|
+
? `; username=${quoted(server.username)}; credential=${quoted(server.credential)}; credential-type="password"`
|
|
64
|
+
: '';
|
|
65
|
+
return `<${url}>; rel="ice-server"${credentials}`;
|
|
66
|
+
}));
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* The ICE of a fragment of SDP (RFC 8840): its credentials, and its candidates with the media they belong to
|
|
70
|
+
* @param fragment
|
|
71
|
+
*/
|
|
72
|
+
function iceOf(fragment) {
|
|
73
|
+
const ice = { candidates: [] };
|
|
74
|
+
//The session, then each media: the candidates of a media are of its mid, before or after them
|
|
75
|
+
for (const section of fragment.split(/^(?=m=)/m)) {
|
|
76
|
+
const lines = section.split(/\r?\n/);
|
|
77
|
+
const mid = lines.find((line) => line.startsWith('a=mid:'))?.slice('a=mid:'.length).trim();
|
|
78
|
+
for (const line of lines) {
|
|
79
|
+
if (line.startsWith('a=ice-ufrag:'))
|
|
80
|
+
ice.ufrag ??= line.slice('a=ice-ufrag:'.length).trim();
|
|
81
|
+
else if (line.startsWith('a=ice-pwd:'))
|
|
82
|
+
ice.pwd ??= line.slice('a=ice-pwd:'.length).trim();
|
|
83
|
+
else if (line.startsWith('a=candidate:'))
|
|
84
|
+
ice.candidates.push({ candidate: line.slice(2).trim(), ...mid === undefined ? {} : { sdpMid: mid } });
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return ice;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Apply a PATCH of a session of an HTTP endpoint (RFC 9725, section 4.3) to its connection: the candidates of the
|
|
91
|
+
* client (trickle ICE), or an ICE restart when its credentials changed. The server answering the offer of the client,
|
|
92
|
+
* a restart is an offer of the client again, its credentials replaced, that the connection answers with new ones.
|
|
93
|
+
* @param connection
|
|
94
|
+
* @param fragment The fragment of SDP of the request (`application/trickle-ice-sdpfrag`).
|
|
95
|
+
* @param restart Whether the request may restart ICE (its `If-Match` is `*`): a fragment of other credentials without
|
|
96
|
+
* it is of an ICE session gone (a request sent again after a restart), not applied.
|
|
97
|
+
* @returns The fragment of the answer of a restart (its credentials, its candidates); none for trickle ICE; `null` for
|
|
98
|
+
* a fragment of an ICE session gone.
|
|
99
|
+
* @throws {Error} When the fragment has no ICE, or the connection refuses it.
|
|
100
|
+
*/
|
|
101
|
+
async function patchConnection(connection, fragment, restart) {
|
|
102
|
+
const ice = iceOf(fragment);
|
|
103
|
+
const remote = connection.remoteDescription?.sdp ?? '';
|
|
104
|
+
const mids = [...remote.matchAll(/^a=mid:(\S+)/gm)].map((match) => match[1]);
|
|
105
|
+
const add = async () => {
|
|
106
|
+
for (const { candidate, sdpMid } of ice.candidates)
|
|
107
|
+
await connection.addIceCandidate({ candidate: candidate, sdpMid: sdpMid ?? mids[0] ?? null });
|
|
108
|
+
};
|
|
109
|
+
const restarting = !!ice.ufrag && ice.ufrag !== /^a=ice-ufrag:(\S+)/m.exec(remote)?.[1];
|
|
110
|
+
if (restarting && !restart)
|
|
111
|
+
return null;
|
|
112
|
+
if (!restarting) {
|
|
113
|
+
//The end of the candidates of the client has nothing to apply
|
|
114
|
+
if (!ice.ufrag && !ice.candidates.length && !/^a=end-of-candidates/m.test(fragment))
|
|
115
|
+
throw new Error('The fragment has no ICE');
|
|
116
|
+
await add();
|
|
117
|
+
return undefined;
|
|
118
|
+
}
|
|
119
|
+
if (!ice.pwd)
|
|
120
|
+
throw new Error('The fragment of an ICE restart has no password');
|
|
121
|
+
const offer = remote
|
|
122
|
+
.replace(/^a=ice-ufrag:.*$/gm, `a=ice-ufrag:${ice.ufrag}`)
|
|
123
|
+
.replace(/^a=ice-pwd:.*$/gm, `a=ice-pwd:${ice.pwd}`)
|
|
124
|
+
.replace(/^a=(candidate:.*|end-of-candidates)\r?\n/gm, '');
|
|
125
|
+
await connection.setRemoteDescription({ type: 'offer', sdp: offer });
|
|
126
|
+
await connection.setLocalDescription();
|
|
127
|
+
await add();
|
|
128
|
+
await gathered(connection);
|
|
129
|
+
return fragmentOf(connection.localDescription?.sdp ?? '');
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* The fragment of SDP of the ICE of a description (RFC 8840): its credentials, and the candidates of its first media
|
|
133
|
+
* (the one the others are bundled on)
|
|
134
|
+
* @param sdp
|
|
135
|
+
*/
|
|
136
|
+
function fragmentOf(sdp) {
|
|
137
|
+
const first = (sdp.split(/^(?=m=)/m)[1] ?? '').split(/\r?\n/);
|
|
138
|
+
return [
|
|
139
|
+
`a=ice-ufrag:${/^a=ice-ufrag:(\S+)/m.exec(sdp)?.[1] ?? ''}`,
|
|
140
|
+
`a=ice-pwd:${/^a=ice-pwd:(\S+)/m.exec(sdp)?.[1] ?? ''}`,
|
|
141
|
+
...first[0] ? [
|
|
142
|
+
first[0],
|
|
143
|
+
...first.filter((line) => line.startsWith('a=mid:')),
|
|
144
|
+
...first.filter((line) => line.startsWith('a=candidate:')),
|
|
145
|
+
'a=end-of-candidates'
|
|
146
|
+
] : []
|
|
147
|
+
].join('\r\n') + '\r\n';
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* A new entity tag of an ICE session (the `ETag` of a session of an HTTP endpoint)
|
|
151
|
+
*/
|
|
152
|
+
function entityTag() {
|
|
153
|
+
return (0, node_crypto_1.randomBytes)(12).toString('hex');
|
|
154
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { RTCPeerConnectionConfig } from '../lib/peer/peerConnection.js';
|
|
2
|
+
import type { SignalingIceServer } from '../protocol/SignalingProtocol.js';
|
|
3
|
+
/**
|
|
4
|
+
* The options of a connection the engine is configured from, plain data (given to a worker thread as they are)
|
|
5
|
+
*/
|
|
6
|
+
export interface EngineOptions {
|
|
7
|
+
readonly iceServers: SignalingIceServer[];
|
|
8
|
+
readonly iceTransportPolicy: 'all' | 'relay';
|
|
9
|
+
readonly icePortRange?: [number, number];
|
|
10
|
+
readonly iceAdditionalHostAddresses?: string[];
|
|
11
|
+
readonly iceUseIpv4: boolean;
|
|
12
|
+
readonly iceUseIpv6: boolean;
|
|
13
|
+
readonly codecs: string[];
|
|
14
|
+
readonly headerExtensions: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The configuration of the connection of the engine of a connection
|
|
18
|
+
* @param options
|
|
19
|
+
*/
|
|
20
|
+
export declare function engineConfigOf(options: EngineOptions): RTCPeerConnectionConfig;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.engineConfigOf = engineConfigOf;
|
|
4
|
+
const rtcpFeedback_js_1 = require("../lib/peer/media/extension/rtcpFeedback.js");
|
|
5
|
+
const rtpExtension_js_1 = require("../lib/peer/media/extension/rtpExtension.js");
|
|
6
|
+
const MediaCodecs_js_1 = require("./MediaCodecs.js");
|
|
7
|
+
/**
|
|
8
|
+
* The configuration of the connection of the engine of a connection
|
|
9
|
+
* @param options
|
|
10
|
+
*/
|
|
11
|
+
function engineConfigOf(options) {
|
|
12
|
+
const config = {
|
|
13
|
+
iceServers: options.iceServers,
|
|
14
|
+
iceTransportPolicy: options.iceTransportPolicy,
|
|
15
|
+
iceUseIpv4: options.iceUseIpv4,
|
|
16
|
+
iceUseIpv6: options.iceUseIpv6,
|
|
17
|
+
codecs: (0, MediaCodecs_js_1.engineCodecsOf)(options.codecs),
|
|
18
|
+
//The largest message the other peer may send, as Chrome accepts (below the SCTP window of 1 MiB)
|
|
19
|
+
maxMessageSize: 262144
|
|
20
|
+
};
|
|
21
|
+
if (options.icePortRange)
|
|
22
|
+
config.icePortRange = options.icePortRange;
|
|
23
|
+
if (options.iceAdditionalHostAddresses)
|
|
24
|
+
config.iceAdditionalHostAddresses = options.iceAdditionalHostAddresses;
|
|
25
|
+
if (options.headerExtensions) {
|
|
26
|
+
//The ids of Chrome and Safari: a browser rolling back an offer of its own keeps its ids, and refuses others
|
|
27
|
+
config.headerExtensions = {
|
|
28
|
+
audio: [(0, rtpExtension_js_1.useAudioLevelIndication)(), (0, rtpExtension_js_1.useAbsSendTime)(), (0, rtpExtension_js_1.useTransportWideCC)(), (0, rtpExtension_js_1.useSdesMid)()],
|
|
29
|
+
video: [(0, rtpExtension_js_1.useAbsSendTime)(), (0, rtpExtension_js_1.useTransportWideCC)(), (0, rtpExtension_js_1.useSdesMid)()]
|
|
30
|
+
};
|
|
31
|
+
//The feedback of the transport-wide sequence numbers
|
|
32
|
+
for (const codec of [...config.codecs.audio, ...config.codecs.video])
|
|
33
|
+
codec.rtcpFeedback.push((0, rtcpFeedback_js_1.useTWCC)());
|
|
34
|
+
}
|
|
35
|
+
return config;
|
|
36
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { RTCDataChannel } from '../lib/peer/dataChannel.js';
|
|
2
|
+
import type { RTCPeerConnection } from '../lib/peer/peerConnection.js';
|
|
3
|
+
import type { PeerChannel } from './PeerChannel.js';
|
|
4
|
+
import type { PeerConnection } from './PeerConnection.js';
|
|
5
|
+
/**
|
|
6
|
+
* The connections of the engine of the connections
|
|
7
|
+
*/
|
|
8
|
+
export declare const engineConnections: WeakMap<PeerConnection, RTCPeerConnection>;
|
|
9
|
+
/**
|
|
10
|
+
* The connection of the engine of a connection: its transports, its senders and receivers
|
|
11
|
+
* @param connection
|
|
12
|
+
*/
|
|
13
|
+
export declare function engineConnectionOf(connection: PeerConnection): RTCPeerConnection;
|
|
14
|
+
/**
|
|
15
|
+
* The channels of the engine of the channels
|
|
16
|
+
*/
|
|
17
|
+
export declare const engineChannels: WeakMap<PeerChannel, RTCDataChannel>;
|
|
18
|
+
/**
|
|
19
|
+
* The channel of the engine of a channel: its SCTP transport
|
|
20
|
+
* @param channel
|
|
21
|
+
*/
|
|
22
|
+
export declare function engineChannelOf(channel: PeerChannel): RTCDataChannel;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.engineChannels = exports.engineConnections = void 0;
|
|
4
|
+
exports.engineConnectionOf = engineConnectionOf;
|
|
5
|
+
exports.engineChannelOf = engineChannelOf;
|
|
6
|
+
/**
|
|
7
|
+
* The connections of the engine of the connections
|
|
8
|
+
*/
|
|
9
|
+
exports.engineConnections = new WeakMap();
|
|
10
|
+
/**
|
|
11
|
+
* The connection of the engine of a connection: its transports, its senders and receivers
|
|
12
|
+
* @param connection
|
|
13
|
+
*/
|
|
14
|
+
function engineConnectionOf(connection) {
|
|
15
|
+
return exports.engineConnections.get(connection);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The channels of the engine of the channels
|
|
19
|
+
*/
|
|
20
|
+
exports.engineChannels = new WeakMap();
|
|
21
|
+
/**
|
|
22
|
+
* The channel of the engine of a channel: its SCTP transport
|
|
23
|
+
* @param channel
|
|
24
|
+
*/
|
|
25
|
+
function engineChannelOf(channel) {
|
|
26
|
+
return exports.engineChannels.get(channel);
|
|
27
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The options of `addEventListener`.
|
|
3
|
+
*/
|
|
4
|
+
export interface ListenerOptions {
|
|
5
|
+
/**
|
|
6
|
+
* Remove the listener after its first call.
|
|
7
|
+
*/
|
|
8
|
+
once?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Remove the listener when the signal aborts.
|
|
11
|
+
*/
|
|
12
|
+
signal?: AbortSignal;
|
|
13
|
+
/**
|
|
14
|
+
* Unused (no capture phase), as in `EventTarget` of Node.js.
|
|
15
|
+
*/
|
|
16
|
+
capture?: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* A listener of the `on…` properties and of `addEventListener`.
|
|
20
|
+
*/
|
|
21
|
+
export type DOMEventListener = (event: any) => void;
|
|
22
|
+
/**
|
|
23
|
+
* The events of an object, in the two styles of the peer connections and of the channels: the W3C style
|
|
24
|
+
* (`addEventListener`, the `on…` properties, given an event object) and the Node.js style (`on`, given the value of the
|
|
25
|
+
* event)
|
|
26
|
+
*/
|
|
27
|
+
export declare class Events {
|
|
28
|
+
#private;
|
|
29
|
+
/**
|
|
30
|
+
* The events of an object
|
|
31
|
+
* @param owner
|
|
32
|
+
*/
|
|
33
|
+
constructor(owner: object);
|
|
34
|
+
/**
|
|
35
|
+
* Fire an event: the listeners of the W3C style get an event object holding the given properties, the ones of the
|
|
36
|
+
* Node.js style get the arguments
|
|
37
|
+
* @param type
|
|
38
|
+
* @param properties
|
|
39
|
+
* @param args
|
|
40
|
+
*/
|
|
41
|
+
fire(type: string, properties: Record<string, unknown>, ...args: unknown[]): void;
|
|
42
|
+
/**
|
|
43
|
+
* Dispatch an event given: the listeners of the W3C style get it, the ones of the Node.js style the arguments
|
|
44
|
+
* @param event
|
|
45
|
+
* @param args
|
|
46
|
+
*/
|
|
47
|
+
dispatch(event: Event, ...args: unknown[]): boolean;
|
|
48
|
+
addEventListener(type: string, listener: DOMEventListener, options?: boolean | ListenerOptions): void;
|
|
49
|
+
removeEventListener(type: string, listener: DOMEventListener, options?: boolean | ListenerOptions): void;
|
|
50
|
+
on(type: string, listener: (...args: any[]) => void): void;
|
|
51
|
+
once(type: string, listener: (...args: any[]) => void): void;
|
|
52
|
+
off(type: string, listener: (...args: any[]) => void): void;
|
|
53
|
+
handler(type: string): DOMEventListener | null;
|
|
54
|
+
setHandler(type: string, handler: DOMEventListener | null): void;
|
|
55
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Events = void 0;
|
|
4
|
+
const node_events_1 = require("node:events");
|
|
5
|
+
/**
|
|
6
|
+
* The events of an object, in the two styles of the peer connections and of the channels: the W3C style
|
|
7
|
+
* (`addEventListener`, the `on…` properties, given an event object) and the Node.js style (`on`, given the value of the
|
|
8
|
+
* event)
|
|
9
|
+
*/
|
|
10
|
+
class Events {
|
|
11
|
+
#target = new EventTarget();
|
|
12
|
+
#emitter = new node_events_1.EventEmitter();
|
|
13
|
+
#handlers = new Map();
|
|
14
|
+
#owner;
|
|
15
|
+
/**
|
|
16
|
+
* The events of an object
|
|
17
|
+
* @param owner
|
|
18
|
+
*/
|
|
19
|
+
constructor(owner) {
|
|
20
|
+
this.#owner = owner;
|
|
21
|
+
//More listeners than the warning threshold of Node.js are expected (a channel per peer…)
|
|
22
|
+
this.#emitter.setMaxListeners(0);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Fire an event: the listeners of the W3C style get an event object holding the given properties, the ones of the
|
|
26
|
+
* Node.js style get the arguments
|
|
27
|
+
* @param type
|
|
28
|
+
* @param properties
|
|
29
|
+
* @param args
|
|
30
|
+
*/
|
|
31
|
+
fire(type, properties, ...args) {
|
|
32
|
+
const event = type === 'message' ? new MessageEvent('message', { data: properties.data }) : new Event(type);
|
|
33
|
+
for (const [key, value] of Object.entries(properties)) {
|
|
34
|
+
if (key !== 'data')
|
|
35
|
+
Object.defineProperty(event, key, { value: value, enumerable: true });
|
|
36
|
+
}
|
|
37
|
+
Object.defineProperty(event, 'currentTarget', { value: this.#owner });
|
|
38
|
+
this.#target.dispatchEvent(event);
|
|
39
|
+
const handler = this.#handlers.get(type);
|
|
40
|
+
if (handler)
|
|
41
|
+
handler.call(this.#owner, event);
|
|
42
|
+
//An error without listeners would throw
|
|
43
|
+
if (type !== 'error' || this.#emitter.listenerCount('error'))
|
|
44
|
+
this.#emitter.emit(type, ...args);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Dispatch an event given: the listeners of the W3C style get it, the ones of the Node.js style the arguments
|
|
48
|
+
* @param event
|
|
49
|
+
* @param args
|
|
50
|
+
*/
|
|
51
|
+
dispatch(event, ...args) {
|
|
52
|
+
const dispatched = this.#target.dispatchEvent(event);
|
|
53
|
+
this.#handlers.get(event.type)?.call(this.#owner, event);
|
|
54
|
+
if (event.type !== 'error' || this.#emitter.listenerCount('error'))
|
|
55
|
+
this.#emitter.emit(event.type, ...args);
|
|
56
|
+
return dispatched && !event.defaultPrevented;
|
|
57
|
+
}
|
|
58
|
+
addEventListener(type, listener, options) {
|
|
59
|
+
this.#target.addEventListener(type, listener, options);
|
|
60
|
+
}
|
|
61
|
+
removeEventListener(type, listener, options) {
|
|
62
|
+
this.#target.removeEventListener(type, listener, options);
|
|
63
|
+
}
|
|
64
|
+
on(type, listener) {
|
|
65
|
+
this.#emitter.on(type, listener);
|
|
66
|
+
}
|
|
67
|
+
once(type, listener) {
|
|
68
|
+
this.#emitter.once(type, listener);
|
|
69
|
+
}
|
|
70
|
+
off(type, listener) {
|
|
71
|
+
this.#emitter.off(type, listener);
|
|
72
|
+
}
|
|
73
|
+
handler(type) {
|
|
74
|
+
return this.#handlers.get(type) ?? null;
|
|
75
|
+
}
|
|
76
|
+
setHandler(type, handler) {
|
|
77
|
+
if (handler) {
|
|
78
|
+
this.#handlers.set(type, handler);
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
this.#handlers.delete(type);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
exports.Events = Events;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { RTCRtpCodecParameters } from '../lib/peer/media/parameters.js';
|
|
2
|
+
/**
|
|
3
|
+
* The MIME types of the codecs supported
|
|
4
|
+
*/
|
|
5
|
+
export declare const SUPPORTED_CODECS: string[];
|
|
6
|
+
/**
|
|
7
|
+
* The codecs offered by default, in the order of preference: the ones of the browsers, VP8 first as Chrome does
|
|
8
|
+
*/
|
|
9
|
+
export declare const DEFAULT_CODECS: string[];
|
|
10
|
+
/**
|
|
11
|
+
* The MIME type of a codec as written in SUPPORTED_CODECS (`video/H264`, `audio/opus`), whatever its case
|
|
12
|
+
* @param mimeType
|
|
13
|
+
*/
|
|
14
|
+
export declare function canonicalCodec(mimeType: string): string;
|
|
15
|
+
/**
|
|
16
|
+
* The codec of the engine of a MIME type
|
|
17
|
+
* @param mimeType
|
|
18
|
+
*/
|
|
19
|
+
export declare function engineCodecOf(mimeType: string): RTCRtpCodecParameters;
|
|
20
|
+
/**
|
|
21
|
+
* The codecs of the engine of a list of MIME types, by kind
|
|
22
|
+
* @param mimeTypes
|
|
23
|
+
*/
|
|
24
|
+
export declare function engineCodecsOf(mimeTypes: string[]): {
|
|
25
|
+
audio: RTCRtpCodecParameters[];
|
|
26
|
+
video: RTCRtpCodecParameters[];
|
|
27
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_CODECS = exports.SUPPORTED_CODECS = void 0;
|
|
4
|
+
exports.canonicalCodec = canonicalCodec;
|
|
5
|
+
exports.engineCodecOf = engineCodecOf;
|
|
6
|
+
exports.engineCodecsOf = engineCodecsOf;
|
|
7
|
+
const codec_js_1 = require("../lib/peer/media/codec.js");
|
|
8
|
+
/**
|
|
9
|
+
* The codecs the connections negotiate, by their MIME type in lower case
|
|
10
|
+
*/
|
|
11
|
+
const CODECS = {
|
|
12
|
+
'audio/opus': () => (0, codec_js_1.useOPUS)(),
|
|
13
|
+
'audio/pcmu': () => (0, codec_js_1.usePCMU)(),
|
|
14
|
+
'video/vp8': () => (0, codec_js_1.useVP8)(),
|
|
15
|
+
'video/vp9': () => (0, codec_js_1.useVP9)(),
|
|
16
|
+
'video/h264': () => (0, codec_js_1.useH264)()
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* The MIME types of the codecs supported
|
|
20
|
+
*/
|
|
21
|
+
exports.SUPPORTED_CODECS = ['audio/opus', 'audio/PCMU', 'video/VP8', 'video/VP9', 'video/H264'];
|
|
22
|
+
/**
|
|
23
|
+
* The codecs offered by default, in the order of preference: the ones of the browsers, VP8 first as Chrome does
|
|
24
|
+
*/
|
|
25
|
+
exports.DEFAULT_CODECS = ['audio/opus', 'audio/PCMU', 'video/VP8', 'video/H264', 'video/VP9'];
|
|
26
|
+
/**
|
|
27
|
+
* The MIME type of a codec as written in SUPPORTED_CODECS (`video/H264`, `audio/opus`), whatever its case
|
|
28
|
+
* @param mimeType
|
|
29
|
+
*/
|
|
30
|
+
function canonicalCodec(mimeType) {
|
|
31
|
+
return exports.SUPPORTED_CODECS.find((codec) => codec.toLowerCase() === mimeType.toLowerCase()) ?? mimeType;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The codec of the engine of a MIME type
|
|
35
|
+
* @param mimeType
|
|
36
|
+
*/
|
|
37
|
+
function engineCodecOf(mimeType) {
|
|
38
|
+
const codec = CODECS[mimeType.toLowerCase()];
|
|
39
|
+
if (!codec)
|
|
40
|
+
throw new TypeError(`The codec ${mimeType} is not supported: ${exports.SUPPORTED_CODECS.join(', ')}`);
|
|
41
|
+
return codec();
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* The codecs of the engine of a list of MIME types, by kind
|
|
45
|
+
* @param mimeTypes
|
|
46
|
+
*/
|
|
47
|
+
function engineCodecsOf(mimeTypes) {
|
|
48
|
+
const codecs = mimeTypes.map(engineCodecOf);
|
|
49
|
+
return {
|
|
50
|
+
audio: codecs.filter((codec) => codec.mimeType.toLowerCase().startsWith('audio/')),
|
|
51
|
+
video: codecs.filter((codec) => codec.mimeType.toLowerCase().startsWith('video/'))
|
|
52
|
+
};
|
|
53
|
+
}
|