@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,356 @@
|
|
|
1
|
+
import { type ResourceLimits } from 'node:worker_threads';
|
|
2
|
+
import { Component, type ComponentOptions } from '@lakutata/core';
|
|
3
|
+
import type { MediaKind, MediaTrack } from '../peer/MediaTrack.js';
|
|
4
|
+
import type { SignalingPeer } from '../protocol/SignalingProtocol.js';
|
|
5
|
+
/**
|
|
6
|
+
* A track published in a room of the media server.
|
|
7
|
+
*/
|
|
8
|
+
export interface SFUTrack {
|
|
9
|
+
/**
|
|
10
|
+
* The room.
|
|
11
|
+
*/
|
|
12
|
+
room: string;
|
|
13
|
+
/**
|
|
14
|
+
* The id of the member publishing it.
|
|
15
|
+
*/
|
|
16
|
+
peerId: string;
|
|
17
|
+
/**
|
|
18
|
+
* Its id: the one the member gave it (the track id of its MSID), else the media id of its transceiver.
|
|
19
|
+
*/
|
|
20
|
+
id: string;
|
|
21
|
+
/**
|
|
22
|
+
* `audio` or `video`.
|
|
23
|
+
*/
|
|
24
|
+
kind: MediaKind;
|
|
25
|
+
/**
|
|
26
|
+
* The MIME type of its codec (`video/VP8`).
|
|
27
|
+
*/
|
|
28
|
+
codec: string;
|
|
29
|
+
/**
|
|
30
|
+
* The id of its stream on the connection of the member; empty when it has none.
|
|
31
|
+
*/
|
|
32
|
+
stream: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Decides whether a member receives a track published in its room (the `select` option of {@link SFU}).
|
|
36
|
+
* @param subscriber The member: its id and its metadata.
|
|
37
|
+
* @param track The track, and the member publishing it.
|
|
38
|
+
* @returns Whether the member receives it.
|
|
39
|
+
*/
|
|
40
|
+
export type SFUSelect = (subscriber: SignalingPeer, track: SFUTrack) => boolean;
|
|
41
|
+
/**
|
|
42
|
+
* What joins a room of the media servers of a cluster: a member, a stream published with WHIP, or a viewer of WHEP.
|
|
43
|
+
*/
|
|
44
|
+
export interface SFUPlacement {
|
|
45
|
+
/**
|
|
46
|
+
* The room.
|
|
47
|
+
*/
|
|
48
|
+
room: string;
|
|
49
|
+
/**
|
|
50
|
+
* The id of the member (`whip:…` for a stream of WHIP, `whep:…` for a viewer).
|
|
51
|
+
*/
|
|
52
|
+
peerId: string;
|
|
53
|
+
/**
|
|
54
|
+
* `member`, `whip` or `viewer`.
|
|
55
|
+
*/
|
|
56
|
+
kind: 'member' | 'whip' | 'viewer';
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* A node of the cluster with a media server, as it announces itself.
|
|
60
|
+
*/
|
|
61
|
+
export interface SFUNode {
|
|
62
|
+
/**
|
|
63
|
+
* The id of the node.
|
|
64
|
+
*/
|
|
65
|
+
id: string;
|
|
66
|
+
/**
|
|
67
|
+
* Its labels (a zone, a region: the `labels` of its `Cluster`).
|
|
68
|
+
*/
|
|
69
|
+
labels: Readonly<Record<string, string>>;
|
|
70
|
+
/**
|
|
71
|
+
* Whether it is this node.
|
|
72
|
+
*/
|
|
73
|
+
local: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* The members it has (the streams of WHIP included).
|
|
76
|
+
*/
|
|
77
|
+
members: number;
|
|
78
|
+
/**
|
|
79
|
+
* The viewers of WHEP it has.
|
|
80
|
+
*/
|
|
81
|
+
viewers: number;
|
|
82
|
+
/**
|
|
83
|
+
* The members it takes at most; 0 for no limit.
|
|
84
|
+
*/
|
|
85
|
+
maxMembers: number;
|
|
86
|
+
/**
|
|
87
|
+
* Whether it has members of the room already.
|
|
88
|
+
*/
|
|
89
|
+
serving: boolean;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Chooses the node whose media server a member, a stream of WHIP or a viewer of WHEP connects to (the `selectSFU`
|
|
93
|
+
* option of {@link SFU}), the node closest to it for example, by the labels of the nodes.
|
|
94
|
+
* @param placement The room, and what joins it.
|
|
95
|
+
* @param nodes The nodes with a media server, this one included.
|
|
96
|
+
* @returns The id of the node, or undefined for the default choice. When the node chosen is full or does not answer,
|
|
97
|
+
* the default choice is made.
|
|
98
|
+
*/
|
|
99
|
+
export type SFUSelectNode = (placement: SFUPlacement, nodes: SFUNode[]) => string | undefined | Promise<string | undefined>;
|
|
100
|
+
/**
|
|
101
|
+
* The options of a {@link SFU} (see {@link buildSFUOptions}).
|
|
102
|
+
*/
|
|
103
|
+
export interface SFUOptions {
|
|
104
|
+
/**
|
|
105
|
+
* The name of the {@link Signaling} component whose rooms the server serves.
|
|
106
|
+
* @default 'signaling'
|
|
107
|
+
*/
|
|
108
|
+
signaling?: string;
|
|
109
|
+
/**
|
|
110
|
+
* The name of the `Cluster` component: the media servers of the nodes share the rooms. Each member, stream of WHIP
|
|
111
|
+
* and viewer of WHEP is given the media server of a node (see `selectSFU`); the nodes of a room forward its tracks to
|
|
112
|
+
* each other. The signaling of the node must be in the same cluster.
|
|
113
|
+
* @default none: the media server of this node serves the members joining through it
|
|
114
|
+
*/
|
|
115
|
+
cluster?: string;
|
|
116
|
+
/**
|
|
117
|
+
* Chooses the node whose media server a member, a stream of WHIP or a viewer of WHEP connects to, with a cluster. By
|
|
118
|
+
* default, a room without members on any node goes to this node when it is not full, else to the least loaded node;
|
|
119
|
+
* a room with members on some nodes goes to the least loaded of those that is not full, else to the least loaded
|
|
120
|
+
* node of all.
|
|
121
|
+
* @default the default choice
|
|
122
|
+
*/
|
|
123
|
+
selectSFU?: SFUSelectNode;
|
|
124
|
+
/**
|
|
125
|
+
* Which rooms the server serves; the others stay peer to peer.
|
|
126
|
+
* @default all the rooms
|
|
127
|
+
*/
|
|
128
|
+
serves?: (room: string) => boolean;
|
|
129
|
+
/**
|
|
130
|
+
* The codecs the members may publish, as MIME types in the order of preference (see `PeerConnection`); the server
|
|
131
|
+
* does not transcode, so a member receives only the tracks of the codecs it supports.
|
|
132
|
+
* @default ['audio/opus', 'audio/PCMU', 'video/VP8', 'video/H264', 'video/VP9']
|
|
133
|
+
*/
|
|
134
|
+
codecs?: string[];
|
|
135
|
+
/**
|
|
136
|
+
* The UDP ports of the connections to the members, as `[first, last]`: the range opened in the firewall. Each
|
|
137
|
+
* connection (a member, a stream of WHIP, a viewer of WHEP, another node's media server) takes a port on each address
|
|
138
|
+
* of the machine.
|
|
139
|
+
* @default any free port
|
|
140
|
+
*/
|
|
141
|
+
icePortRange?: [number, number];
|
|
142
|
+
/**
|
|
143
|
+
* More addresses given as local candidates: the public address of a NAT forwarding `icePortRange` with the same
|
|
144
|
+
* port numbers.
|
|
145
|
+
* @default none
|
|
146
|
+
*/
|
|
147
|
+
iceAdditionalHostAddresses?: string[];
|
|
148
|
+
/**
|
|
149
|
+
* The members of all the rooms at most; a member joining once it is reached is refused
|
|
150
|
+
* (`SignalingLimitException`). 0 for no limit.
|
|
151
|
+
* @default 0
|
|
152
|
+
*/
|
|
153
|
+
maxMembers?: number;
|
|
154
|
+
/**
|
|
155
|
+
* Decides which member receives which track. It is asked again for a member that joins the room again with other
|
|
156
|
+
* metadata; the tracks the member receives follow the new answers. When it throws, the member does not receive the
|
|
157
|
+
* track, and the error goes to the debug messages (`webrtc/sfu`, see `setDebugHandler`).
|
|
158
|
+
* @default every member receives every track of the others
|
|
159
|
+
*/
|
|
160
|
+
select?: SFUSelect;
|
|
161
|
+
/**
|
|
162
|
+
* Worker threads that forward the rooms, to use more cores: each room is forwarded in one of them (the one
|
|
163
|
+
* forwarding the fewest members and viewers when the room opens), with its connections, its UDP ports and its
|
|
164
|
+
* relaying, while the hooks and the events stay in the main thread. `icePortRange`, when given, is split among the
|
|
165
|
+
* threads and needs at least one port for each. A thread that stops (only a bug stops one) closes its rooms; the
|
|
166
|
+
* server joins them again in another thread, and their members connect to it again. With 0, the rooms are forwarded
|
|
167
|
+
* in the main thread.
|
|
168
|
+
* @default 0
|
|
169
|
+
*/
|
|
170
|
+
workers?: number;
|
|
171
|
+
/**
|
|
172
|
+
* The limits of the heap and of the stack of each worker thread (`resourceLimits` of `node:worker_threads`). Each
|
|
173
|
+
* thread has a heap of its own, with the large young generation V8 gives it for speed: a smaller one
|
|
174
|
+
* (`maxYoungGenerationSizeMb`) takes less memory for a little more CPU, the garbage being collected more often. A
|
|
175
|
+
* thread reaching `maxOldGenerationSizeMb` stops, as one stopped by a bug. Bun ignores these limits.
|
|
176
|
+
* @default the limits of V8
|
|
177
|
+
*/
|
|
178
|
+
workerResourceLimits?: ResourceLimits;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* The media server of the rooms of a {@link Signaling} (a selective forwarding unit): each member connects to the
|
|
182
|
+
* server only, publishes its tracks once, and receives the tracks of the others from the server, which forwards their
|
|
183
|
+
* packets without decoding them. A room of many members then costs each of them one connection and one upload, instead
|
|
184
|
+
* of one of each per other member.
|
|
185
|
+
*
|
|
186
|
+
* The server is a member of each room it serves (its id starts with `sfu:`, its role is `sfu`); the clients of this
|
|
187
|
+
* package (`SignalingClient`, `SignalingConnection` of `./client`) connect to it by themselves, and their rooms and
|
|
188
|
+
* peers work as without it: `room.publish()` sends a track to every member, each peer emits the tracks of its member,
|
|
189
|
+
* and a data channel to a member goes through the server, which relays its messages (unlike between two members, the
|
|
190
|
+
* server sees them; with a cluster, the servers of both members relay them). The key frame requests of the members go
|
|
191
|
+
* to the publisher, at most every 500 ms; the lost packets are sent again by the server; the bandwidth of each
|
|
192
|
+
* connection is estimated from the transport-wide feedback. A member receiving the messages of a channel slower than
|
|
193
|
+
* they are sent makes the sender wait, without the server keeping more than a few megabytes of them.
|
|
194
|
+
*
|
|
195
|
+
* Events: `publish` and `unpublish` (an {@link SFUTrack}) when a member of this node starts and stops publishing a
|
|
196
|
+
* track (with a cluster, they are emitted on the node of the member only), `unsupported` (the room, the id of the
|
|
197
|
+
* member or of the viewer of WHEP, the track) when a member or a viewer does not support the codec of a track it should
|
|
198
|
+
* receive, `congestion` (the room, the id of the member, whether it is congested, the bit rate estimated in bits per
|
|
199
|
+
* second) when the bandwidth to a member is too low, and when it is enough again.
|
|
200
|
+
*
|
|
201
|
+
* Register it with {@link buildSFUOptions}, and bootstrap it: it attaches itself to the signaling when it starts.
|
|
202
|
+
* @example
|
|
203
|
+
* ```typescript
|
|
204
|
+
* import {Application} from 'lakutata'
|
|
205
|
+
* import {buildEntrypoints} from 'lakutata/com/entrypoint'
|
|
206
|
+
* import {socketIOServiceEntrypoint} from 'lakutata/adapter/socket.io'
|
|
207
|
+
* import {buildSFUOptions, buildSignalingOptions, SignalingController} from '@lakutata/webrtc'
|
|
208
|
+
*
|
|
209
|
+
* Application.run(() => ({
|
|
210
|
+
* id: 'meet.app',
|
|
211
|
+
* name: 'Meet',
|
|
212
|
+
* components: {
|
|
213
|
+
* signaling: buildSignalingOptions(),
|
|
214
|
+
* //The meetings go through the server; the other rooms stay peer to peer
|
|
215
|
+
* sfu: buildSFUOptions({
|
|
216
|
+
* serves: (room: string): boolean => room.startsWith('meeting-'),
|
|
217
|
+
* iceAdditionalHostAddresses: ['203.0.113.10'],
|
|
218
|
+
* icePortRange: [40000, 40999]
|
|
219
|
+
* }),
|
|
220
|
+
* entrypoint: buildEntrypoints({
|
|
221
|
+
* controllers: [SignalingController],
|
|
222
|
+
* service: socketIOServiceEntrypoint({port: 3000})
|
|
223
|
+
* })
|
|
224
|
+
* },
|
|
225
|
+
* bootstrap: ['sfu', 'entrypoint']
|
|
226
|
+
* }))
|
|
227
|
+
* ```
|
|
228
|
+
*/
|
|
229
|
+
export declare class SFU extends Component {
|
|
230
|
+
#private;
|
|
231
|
+
/**
|
|
232
|
+
* The name of the signaling component.
|
|
233
|
+
*/
|
|
234
|
+
protected readonly signaling: string;
|
|
235
|
+
/**
|
|
236
|
+
* The name of the cluster component.
|
|
237
|
+
*/
|
|
238
|
+
protected readonly cluster?: string;
|
|
239
|
+
/**
|
|
240
|
+
* Chooses the node of a member.
|
|
241
|
+
*/
|
|
242
|
+
protected readonly selectSFU?: SFUSelectNode;
|
|
243
|
+
/**
|
|
244
|
+
* Which rooms the server serves.
|
|
245
|
+
*/
|
|
246
|
+
protected readonly serves?: (room: string) => boolean;
|
|
247
|
+
/**
|
|
248
|
+
* The codecs the members may publish.
|
|
249
|
+
*/
|
|
250
|
+
protected readonly codecs?: string[];
|
|
251
|
+
/**
|
|
252
|
+
* The UDP ports of the connections.
|
|
253
|
+
*/
|
|
254
|
+
protected readonly icePortRange?: [number, number];
|
|
255
|
+
/**
|
|
256
|
+
* More addresses given as local candidates.
|
|
257
|
+
*/
|
|
258
|
+
protected readonly iceAdditionalHostAddresses?: string[];
|
|
259
|
+
/**
|
|
260
|
+
* The members of all the rooms at most.
|
|
261
|
+
*/
|
|
262
|
+
protected readonly maxMembers: number;
|
|
263
|
+
/**
|
|
264
|
+
* Which member receives which track.
|
|
265
|
+
*/
|
|
266
|
+
protected readonly select?: SFUSelect;
|
|
267
|
+
/**
|
|
268
|
+
* The worker threads forwarding the rooms.
|
|
269
|
+
*/
|
|
270
|
+
protected readonly workers: number;
|
|
271
|
+
/**
|
|
272
|
+
* The limits of the heap and of the stack of each worker thread.
|
|
273
|
+
*/
|
|
274
|
+
protected readonly workerResourceLimits?: ResourceLimits;
|
|
275
|
+
/**
|
|
276
|
+
* Attach the server to the signaling.
|
|
277
|
+
* @protected
|
|
278
|
+
*/
|
|
279
|
+
protected init(): Promise<void>;
|
|
280
|
+
/**
|
|
281
|
+
* Detach the server, and leave the rooms.
|
|
282
|
+
* @protected
|
|
283
|
+
*/
|
|
284
|
+
protected destroy(): Promise<void>;
|
|
285
|
+
/**
|
|
286
|
+
* The rooms the server is in, with their members on this node, the tracks these members publish and the number of
|
|
287
|
+
* viewers of WHEP on this node; with a cluster, each node reports its own. With `workers`, each thread reports its
|
|
288
|
+
* rooms: a change made in a thread (a session of WHEP ending) shows here a moment later.
|
|
289
|
+
* @returns For each room, the ids of its members, its tracks and its viewers.
|
|
290
|
+
* @example
|
|
291
|
+
* ```typescript
|
|
292
|
+
* import type {SFU} from '@lakutata/webrtc'
|
|
293
|
+
*
|
|
294
|
+
* declare const sfu: SFU
|
|
295
|
+
* for (const [room, {members, tracks}] of Object.entries(sfu.rooms())) console.log(room, members.length, tracks.length)
|
|
296
|
+
* ```
|
|
297
|
+
*/
|
|
298
|
+
rooms(): Record<string, {
|
|
299
|
+
members: string[];
|
|
300
|
+
tracks: SFUTrack[];
|
|
301
|
+
viewers: number;
|
|
302
|
+
}>;
|
|
303
|
+
/**
|
|
304
|
+
* A track published in a room, to read its packets (to record them) or to send it on another connection. With a
|
|
305
|
+
* cluster, a track of a member of another node is received from that node while it is read here.
|
|
306
|
+
* @param room The room.
|
|
307
|
+
* @param peerId The member publishing it.
|
|
308
|
+
* @param trackId The id of the track ({@link SFUTrack.id}).
|
|
309
|
+
* @returns The track, or undefined when it is not published.
|
|
310
|
+
* @example
|
|
311
|
+
* ```typescript
|
|
312
|
+
* import type {RtpPacket, SFU, SFUTrack} from '@lakutata/webrtc'
|
|
313
|
+
*
|
|
314
|
+
* declare const sfu: SFU
|
|
315
|
+
* //Record the audio of the members of the room
|
|
316
|
+
* sfu.on('publish', (track: SFUTrack): void => {
|
|
317
|
+
* if (track.kind === 'audio') sfu.track(track.room, track.peerId, track.id)?.on('rtp', (packet: RtpPacket): void => console.log(packet.timestamp))
|
|
318
|
+
* })
|
|
319
|
+
* ```
|
|
320
|
+
*/
|
|
321
|
+
track(room: string, peerId: string, trackId: string): MediaTrack | undefined;
|
|
322
|
+
/**
|
|
323
|
+
* Give a member joining a room a media server, once the server is in the room: this one, or with a cluster the one
|
|
324
|
+
* of the node chosen (`selectSFU`)
|
|
325
|
+
* @param room The room.
|
|
326
|
+
* @param peerId The id of the member.
|
|
327
|
+
* @param kind A member, a stream of WHIP, or a viewer of WHEP (`maxMembers` does not count the viewers).
|
|
328
|
+
* @returns The id of the member of the server, or undefined for a room the servers do not serve.
|
|
329
|
+
* @throws {SignalingLimitException} When no media server takes the member.
|
|
330
|
+
* @protected
|
|
331
|
+
*/
|
|
332
|
+
protected assign(room: string, peerId: string, kind?: SFUPlacement['kind']): Promise<string | undefined>;
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* Build the options of a {@link SFU} component, for the `components` of an application.
|
|
336
|
+
* @param options The signaling, the rooms served, the codecs, the ports, the limits, the selection of the tracks (all
|
|
337
|
+
* optional).
|
|
338
|
+
* @returns The component options.
|
|
339
|
+
* @example
|
|
340
|
+
* ```typescript
|
|
341
|
+
* import {Application} from 'lakutata'
|
|
342
|
+
* import {buildSFUOptions, buildSignalingOptions} from '@lakutata/webrtc'
|
|
343
|
+
*
|
|
344
|
+
* Application.run(() => ({
|
|
345
|
+
* id: 'meet.app',
|
|
346
|
+
* name: 'Meet',
|
|
347
|
+
* components: {
|
|
348
|
+
* signaling: buildSignalingOptions(),
|
|
349
|
+
* //The members whose metadata says they only listen receive the audio only
|
|
350
|
+
* sfu: buildSFUOptions({select: (subscriber, track): boolean => track.kind === 'audio' || (subscriber.metadata as {listener?: boolean})?.listener !== true})
|
|
351
|
+
* },
|
|
352
|
+
* bootstrap: ['sfu']
|
|
353
|
+
* }))
|
|
354
|
+
* ```
|
|
355
|
+
*/
|
|
356
|
+
export declare function buildSFUOptions(options?: SFUOptions): ComponentOptions<SFUOptions>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { EndpointLeg } from '../peer/Endpoints.js';
|
|
2
|
+
import type { SignalingDescription } from '../protocol/SignalingProtocol.js';
|
|
3
|
+
import type { SFU } from './SFU.js';
|
|
4
|
+
import type { SFUServedRoom, SFUViewerSelect } from './SFURoom.js';
|
|
5
|
+
import type { SFUWorkers } from './SFUWorkers.js';
|
|
6
|
+
/**
|
|
7
|
+
* What the HTTP endpoints (WHIP, WHEP) need of a media server
|
|
8
|
+
*/
|
|
9
|
+
export interface SFUAccess {
|
|
10
|
+
/**
|
|
11
|
+
* A stream published with WHIP joins a room, as a member of role `whip`
|
|
12
|
+
* @param room The room.
|
|
13
|
+
* @param offer The offer of the publisher.
|
|
14
|
+
* @returns The id of the member, and its connection.
|
|
15
|
+
* @throws {SignalingLimitException} When the server takes no more members.
|
|
16
|
+
* @throws {Error} When the server does not serve the room, or the offer is refused.
|
|
17
|
+
*/
|
|
18
|
+
publish(room: string, offer: SignalingDescription): Promise<{
|
|
19
|
+
peerId: string;
|
|
20
|
+
leg: EndpointLeg;
|
|
21
|
+
}>;
|
|
22
|
+
/**
|
|
23
|
+
* A viewer of WHEP receives the audio and the video of a member of a room
|
|
24
|
+
* @param room The room.
|
|
25
|
+
* @param offer The offer of the viewer.
|
|
26
|
+
* @param select Chooses the member among the tracks published; the default one without it.
|
|
27
|
+
* @returns The id of the viewer, its connection, and its source now.
|
|
28
|
+
* @throws {Error} When the server does not serve the room, or the offer is refused.
|
|
29
|
+
*/
|
|
30
|
+
play(room: string, offer: SignalingDescription, select?: SFUViewerSelect): Promise<{
|
|
31
|
+
viewerId: string;
|
|
32
|
+
leg: EndpointLeg & {
|
|
33
|
+
source(): string | undefined;
|
|
34
|
+
};
|
|
35
|
+
}>;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* What the HTTP endpoints may do with each media server
|
|
39
|
+
*/
|
|
40
|
+
export declare const sfuAccess: WeakMap<SFU, SFUAccess>;
|
|
41
|
+
/**
|
|
42
|
+
* The worker threads of each media server forwarding in some (for the tests)
|
|
43
|
+
*/
|
|
44
|
+
export declare const sfuWorkers: WeakMap<SFU, SFUWorkers>;
|
|
45
|
+
/**
|
|
46
|
+
* The rooms of each media server (for the tests)
|
|
47
|
+
*/
|
|
48
|
+
export declare const sfuRooms: WeakMap<SFU, Map<string, SFUServedRoom>>;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import type { EndpointLeg } from '../peer/Endpoints.js';
|
|
2
|
+
import type { SignalingDescription } from '../protocol/SignalingProtocol.js';
|
|
3
|
+
/**
|
|
4
|
+
* The topics of the requests of the media servers of a cluster to each other
|
|
5
|
+
*/
|
|
6
|
+
export declare const SFU_TOPICS: {
|
|
7
|
+
readonly serve: "webrtc.sfu.serve";
|
|
8
|
+
readonly publish: "webrtc.sfu.publish";
|
|
9
|
+
readonly play: "webrtc.sfu.play";
|
|
10
|
+
readonly patch: "webrtc.sfu.leg.patch";
|
|
11
|
+
readonly end: "webrtc.sfu.leg.end";
|
|
12
|
+
readonly ended: "webrtc.sfu.leg.ended";
|
|
13
|
+
readonly source: "webrtc.sfu.leg.source";
|
|
14
|
+
readonly choose: "webrtc.sfu.leg.choose";
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* The answer of a node taking a stream of WHIP or a viewer of WHEP: the answer to its offer (and the source of a
|
|
18
|
+
* viewer), or full, or refused (the room is not served, the offer is refused)
|
|
19
|
+
*/
|
|
20
|
+
export type LegReply = {
|
|
21
|
+
answer: SignalingDescription;
|
|
22
|
+
source?: string | null;
|
|
23
|
+
} | {
|
|
24
|
+
full: true;
|
|
25
|
+
} | {
|
|
26
|
+
refused: string;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* The answer of the node of a leg to a PATCH (see patchConnection): the fragment answering an ICE restart, or stale
|
|
30
|
+
*/
|
|
31
|
+
export type LegPatchReply = {
|
|
32
|
+
fragment?: string;
|
|
33
|
+
stale?: boolean;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* How long a node may take to answer an offer or a PATCH (its candidates gathered), in milliseconds
|
|
37
|
+
*/
|
|
38
|
+
export declare const LEG_TIMEOUT: number;
|
|
39
|
+
/**
|
|
40
|
+
* What a leg of another node needs of the media server
|
|
41
|
+
*/
|
|
42
|
+
export interface ClusterLegLink {
|
|
43
|
+
readonly legs: Map<string, ClusterLeg>;
|
|
44
|
+
request<Result>(node: string, topic: string, message: unknown): Promise<Result>;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The connection of a session of WHIP or WHEP held by this node to its client, on the media server of another node:
|
|
48
|
+
* its PATCH requests and its end go there, its end and the source of a viewer come from there
|
|
49
|
+
*/
|
|
50
|
+
export declare class ClusterLeg implements EndpointLeg {
|
|
51
|
+
#private;
|
|
52
|
+
/**
|
|
53
|
+
* The id of the leg: the member of the stream of WHIP, or the viewer.
|
|
54
|
+
*/
|
|
55
|
+
readonly id: string;
|
|
56
|
+
/**
|
|
57
|
+
* The node of the connection.
|
|
58
|
+
*/
|
|
59
|
+
readonly node: string;
|
|
60
|
+
/**
|
|
61
|
+
* The answer, with all the candidates.
|
|
62
|
+
*/
|
|
63
|
+
readonly answer: SignalingDescription;
|
|
64
|
+
/**
|
|
65
|
+
* Keep a leg of another node.
|
|
66
|
+
* @param link The media server.
|
|
67
|
+
* @param node The node of the connection.
|
|
68
|
+
* @param id The id of the leg.
|
|
69
|
+
* @param answer The answer.
|
|
70
|
+
* @param source The source of a viewer.
|
|
71
|
+
*/
|
|
72
|
+
constructor(link: ClusterLegLink, node: string, id: string, answer: SignalingDescription, source?: string);
|
|
73
|
+
/**
|
|
74
|
+
* The source of a viewer of WHEP.
|
|
75
|
+
*/
|
|
76
|
+
source(): string | undefined;
|
|
77
|
+
/**
|
|
78
|
+
* The source of a viewer changed.
|
|
79
|
+
* @param source
|
|
80
|
+
*/
|
|
81
|
+
sourced(source: string | undefined): void;
|
|
82
|
+
/**
|
|
83
|
+
* Apply a PATCH on the node of the connection.
|
|
84
|
+
* @param fragment
|
|
85
|
+
* @param restart
|
|
86
|
+
*/
|
|
87
|
+
patch(fragment: string, restart: boolean): Promise<string | undefined | null>;
|
|
88
|
+
/**
|
|
89
|
+
* Call a listener once the leg ends.
|
|
90
|
+
* @param listener
|
|
91
|
+
*/
|
|
92
|
+
ended(listener: () => void): void;
|
|
93
|
+
/**
|
|
94
|
+
* Close the connection, on its node.
|
|
95
|
+
*/
|
|
96
|
+
close(): void;
|
|
97
|
+
/**
|
|
98
|
+
* The connection is gone (closed on its node, or its node is down).
|
|
99
|
+
*/
|
|
100
|
+
end(): void;
|
|
101
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { type MediaTrack } from '../peer/MediaTrack.js';
|
|
2
|
+
import { type EndpointLeg } from '../peer/Endpoints.js';
|
|
3
|
+
import type { PeerConnection } from '../peer/PeerConnection.js';
|
|
4
|
+
import { type SignalingCandidate, type SignalingDescription, type SignalingJoinResult, type SignalingPeer, type SignalingRole, type SignalingStream } from '../protocol/SignalingProtocol.js';
|
|
5
|
+
import type { SignalingReceiver } from '../signaling/Signaling.js';
|
|
6
|
+
import type { SFUTrack } from './SFU.js';
|
|
7
|
+
import type { SFUWorkerCodec } from './SFUWorkerChannel.js';
|
|
8
|
+
/**
|
|
9
|
+
* What a room needs of the signaling (the Signaling component, or its proxy in a worker thread)
|
|
10
|
+
*/
|
|
11
|
+
export interface SFUSignaling {
|
|
12
|
+
join(peerId: string, room: string, options: {
|
|
13
|
+
role: SignalingRole;
|
|
14
|
+
receive: SignalingReceiver;
|
|
15
|
+
}): Promise<SignalingJoinResult>;
|
|
16
|
+
leave(peerId: string, room: string): Promise<void>;
|
|
17
|
+
signal(peerId: string, room: string, to: string, signal: {
|
|
18
|
+
description?: SignalingDescription;
|
|
19
|
+
candidate?: SignalingCandidate | null;
|
|
20
|
+
streams?: SignalingStream[];
|
|
21
|
+
}): Promise<boolean>;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* What a room needs of its media server
|
|
25
|
+
*/
|
|
26
|
+
export interface SFUHost {
|
|
27
|
+
readonly id: string;
|
|
28
|
+
readonly signaling: SFUSignaling;
|
|
29
|
+
connect(): Promise<PeerConnection>;
|
|
30
|
+
select(subscriber: SignalingPeer, track: SFUTrack): boolean | Promise<boolean>;
|
|
31
|
+
emit(event: string, ...args: unknown[]): unknown;
|
|
32
|
+
emptied(room: SFURoom): void;
|
|
33
|
+
changed?(room: SFURoom): void;
|
|
34
|
+
sourced?(viewerId: string, source: string | undefined): void;
|
|
35
|
+
known?(room: SFURoom, tracks: SFUOfferedTrack[]): void;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* A track a media server offers the ones of the other nodes of its room: a track published by one of its members, and
|
|
39
|
+
* the codec of its packets
|
|
40
|
+
*/
|
|
41
|
+
export interface SFUOfferedTrack {
|
|
42
|
+
readonly track: SFUTrack;
|
|
43
|
+
readonly codec?: SFUWorkerCodec;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Chooses the member a viewer of WHEP receives, among the tracks published (see WHEPSelect)
|
|
47
|
+
*/
|
|
48
|
+
export type SFUViewerSelect = (tracks: SFUTrack[]) => string | undefined | Promise<string | undefined>;
|
|
49
|
+
/**
|
|
50
|
+
* A room of the media server, wherever it forwards (in the main thread, an SFURoom, or in a worker thread)
|
|
51
|
+
*/
|
|
52
|
+
export interface SFUServedRoom {
|
|
53
|
+
readonly name: string;
|
|
54
|
+
readonly ready: Promise<void>;
|
|
55
|
+
readonly closed: boolean;
|
|
56
|
+
readonly members: string[];
|
|
57
|
+
readonly tracks: SFUTrack[];
|
|
58
|
+
readonly viewers: number;
|
|
59
|
+
track(peerId: string, trackId: string): MediaTrack | undefined;
|
|
60
|
+
publish(id: string, offer: SignalingDescription): Promise<EndpointLeg>;
|
|
61
|
+
play(id: string, offer: SignalingDescription, select?: SFUViewerSelect): Promise<EndpointLeg & {
|
|
62
|
+
source(): string | undefined;
|
|
63
|
+
}>;
|
|
64
|
+
close(): Promise<void>;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* The part of a room on the media server: a connection to each member (the server never gives up its offers), the
|
|
68
|
+
* tracks they publish, forwarded to the others the server selects for them
|
|
69
|
+
*/
|
|
70
|
+
export declare class SFURoom implements SFUServedRoom {
|
|
71
|
+
#private;
|
|
72
|
+
/**
|
|
73
|
+
* The name of the room.
|
|
74
|
+
*/
|
|
75
|
+
readonly name: string;
|
|
76
|
+
/**
|
|
77
|
+
* Resolves once the server is in the room.
|
|
78
|
+
*/
|
|
79
|
+
readonly ready: Promise<void>;
|
|
80
|
+
/**
|
|
81
|
+
* Create the part of a room, and join it.
|
|
82
|
+
* @param host The media server.
|
|
83
|
+
* @param name The room.
|
|
84
|
+
*/
|
|
85
|
+
constructor(host: SFUHost, name: string);
|
|
86
|
+
/**
|
|
87
|
+
* Whether the room has no member and no viewer left.
|
|
88
|
+
*/
|
|
89
|
+
get empty(): boolean;
|
|
90
|
+
/**
|
|
91
|
+
* The number of the viewers of WHEP.
|
|
92
|
+
*/
|
|
93
|
+
get viewers(): number;
|
|
94
|
+
/**
|
|
95
|
+
* Whether the server left the room.
|
|
96
|
+
*/
|
|
97
|
+
get closed(): boolean;
|
|
98
|
+
/**
|
|
99
|
+
* The ids of the members of this node (the media servers of the other nodes are not counted).
|
|
100
|
+
*/
|
|
101
|
+
get members(): string[];
|
|
102
|
+
/**
|
|
103
|
+
* The tracks the members of this node publish.
|
|
104
|
+
*/
|
|
105
|
+
get tracks(): SFUTrack[];
|
|
106
|
+
/**
|
|
107
|
+
* A track published in the room: received from its member, or from the media server of its node while it is read.
|
|
108
|
+
* @param peerId The member.
|
|
109
|
+
* @param trackId The id of the track.
|
|
110
|
+
* @returns The track, or undefined when it is not published.
|
|
111
|
+
*/
|
|
112
|
+
track(peerId: string, trackId: string): MediaTrack | undefined;
|
|
113
|
+
/**
|
|
114
|
+
* The connections to the media servers of the other nodes: the tracks sent on each, the ones received (for the
|
|
115
|
+
* tests).
|
|
116
|
+
* @returns By the id of the member of each server.
|
|
117
|
+
*/
|
|
118
|
+
cascades(): Record<string, {
|
|
119
|
+
sends: number;
|
|
120
|
+
receives: number;
|
|
121
|
+
}>;
|
|
122
|
+
/**
|
|
123
|
+
* Leave the room: the connections to the members are closed.
|
|
124
|
+
* @returns Resolves once the signaling is told.
|
|
125
|
+
*/
|
|
126
|
+
close(): Promise<void>;
|
|
127
|
+
/**
|
|
128
|
+
* A viewer of WHEP: the connection answering its offer sends it an audio and a video track of a member of the room
|
|
129
|
+
* (its source), once and as long as there is one, from a key frame. Its media negotiate every codec it offers that
|
|
130
|
+
* the server has, so a source publishing later with any of them is sent too.
|
|
131
|
+
* @param id The id of the viewer.
|
|
132
|
+
* @param offer The offer of the viewer.
|
|
133
|
+
* @param select Chooses its source among the members publishing; the newest stream of WHIP, else the first member
|
|
134
|
+
* publishing, without it.
|
|
135
|
+
* @returns The connection, its answer with all its candidates, and its source now.
|
|
136
|
+
*/
|
|
137
|
+
play(id: string, offer: SignalingDescription, select?: SFUViewerSelect): Promise<EndpointLeg & {
|
|
138
|
+
source(): string | undefined;
|
|
139
|
+
}>;
|
|
140
|
+
/**
|
|
141
|
+
* A stream published with WHIP joins the room: a member (of role `whip`) whose connection answers the offer of the
|
|
142
|
+
* publisher, publishing its tracks and receiving nothing
|
|
143
|
+
* @param id The id of the member.
|
|
144
|
+
* @param offer The offer of the publisher.
|
|
145
|
+
* @returns The connection, its answer with all its candidates.
|
|
146
|
+
*/
|
|
147
|
+
publish(id: string, offer: SignalingDescription): Promise<EndpointLeg>;
|
|
148
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a worker thread forwarding rooms is started with
|
|
3
|
+
*/
|
|
4
|
+
export interface SFUWorkerData {
|
|
5
|
+
readonly thread: number;
|
|
6
|
+
readonly connection: Record<string, unknown>;
|
|
7
|
+
readonly select: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Forward the rooms the main thread opens in this worker thread: each is a SFURoom, whose signaling, hooks and events
|
|
11
|
+
* go through the parent port
|
|
12
|
+
*/
|
|
13
|
+
export declare function runSFUWorker(): void;
|