From c4401dfa2943104992b4846ececddb814281f419 Mon Sep 17 00:00:00 2001 From: shinyoshiaki Date: Sun, 5 Jan 2025 11:12:16 +0900 Subject: [PATCH] verup --- README.md | 6 +- doc/classes/Candidate.md | 10 +- doc/classes/CandidatePair.md | 66 +++-- doc/classes/Connection.md | 254 +++++++++++++----- doc/classes/IceCandidate.md | 18 +- doc/classes/MediaStreamTrack.md | 2 +- doc/classes/Message.md | 26 ++ doc/classes/RTCDtlsTransport.md | 50 ++-- doc/classes/RTCIceCandidate.md | 10 + doc/classes/RTCIceGatherer.md | 2 +- doc/classes/RTCIceTransport.md | 68 ++++- doc/classes/RTCPeerConnection.md | 70 +++-- doc/classes/RTCRtpReceiver.md | 4 +- doc/classes/StunOverTurnProtocol.md | 24 +- doc/classes/StunProtocol.md | 48 ++-- doc/classes/TurnProtocol.md | 20 ++ doc/functions/createStunOverTurnClient.md | 4 +- doc/functions/deserializeVideoOrientation.md | 17 ++ doc/functions/rtpHeaderExtensionsParser.md | 4 +- doc/functions/useVideoOrientation.md | 13 + doc/globals.md | 11 + doc/interfaces/Extensions.md | 11 + doc/interfaces/IceConnection.md | 235 ++++++++++++++++ doc/interfaces/IceOptions.md | 8 +- doc/interfaces/PeerConfig.md | 6 + doc/interfaces/Protocol.md | 18 ++ doc/interfaces/TurnClientOptions.md | 2 +- doc/interfaces/videoOrientationPayload.md | 60 +++++ doc/type-aliases/IceState.md | 9 + doc/variables/CONSENT_FAILURES.md | 9 + doc/variables/CONSENT_INTERVAL.md | 9 + doc/variables/ICE_COMPLETED.md | 9 + doc/variables/ICE_FAILED.md | 9 + doc/variables/RTP_EXTENSION_URI.md | 4 + doc/variables/defaultOptions.md | 9 + package-lock.json | 8 +- packages/dtls/package.json | 2 +- packages/ice/doc/classes/Candidate.md | 10 +- packages/ice/doc/classes/CandidatePair.md | 66 +++-- packages/ice/doc/classes/Connection.md | 254 +++++++++++++----- packages/ice/doc/classes/Message.md | 26 ++ .../ice/doc/classes/StunOverTurnProtocol.md | 24 +- packages/ice/doc/classes/StunProtocol.md | 48 ++-- packages/ice/doc/classes/TurnProtocol.md | 20 ++ .../doc/functions/createStunOverTurnClient.md | 2 - packages/ice/doc/globals.md | 7 + packages/ice/doc/interfaces/IceConnection.md | 235 ++++++++++++++++ packages/ice/doc/interfaces/IceOptions.md | 6 + packages/ice/doc/interfaces/Protocol.md | 18 ++ packages/ice/doc/type-aliases/IceState.md | 9 + .../ice/doc/variables/CONSENT_FAILURES.md | 9 + .../ice/doc/variables/CONSENT_INTERVAL.md | 9 + packages/ice/doc/variables/ICE_COMPLETED.md | 9 + packages/ice/doc/variables/ICE_FAILED.md | 9 + packages/ice/doc/variables/defaultOptions.md | 9 + packages/ice/package.json | 2 +- .../functions/deserializeVideoOrientation.md | 17 ++ .../functions/rtpHeaderExtensionsParser.md | 4 +- packages/rtp/doc/globals.md | 6 + packages/rtp/doc/interfaces/Extensions.md | 11 + .../doc/interfaces/videoOrientationPayload.md | 60 +++++ .../rtp/doc/variables/RTP_EXTENSION_URI.md | 4 + packages/rtp/package.json | 2 +- packages/webrtc/package.json | 2 +- 64 files changed, 1714 insertions(+), 299 deletions(-) create mode 100644 doc/functions/deserializeVideoOrientation.md create mode 100644 doc/functions/useVideoOrientation.md create mode 100644 doc/interfaces/Extensions.md create mode 100644 doc/interfaces/IceConnection.md create mode 100644 doc/interfaces/videoOrientationPayload.md create mode 100644 doc/type-aliases/IceState.md create mode 100644 doc/variables/CONSENT_FAILURES.md create mode 100644 doc/variables/CONSENT_INTERVAL.md create mode 100644 doc/variables/ICE_COMPLETED.md create mode 100644 doc/variables/ICE_FAILED.md create mode 100644 doc/variables/defaultOptions.md create mode 100644 packages/ice/doc/interfaces/IceConnection.md create mode 100644 packages/ice/doc/type-aliases/IceState.md create mode 100644 packages/ice/doc/variables/CONSENT_FAILURES.md create mode 100644 packages/ice/doc/variables/CONSENT_INTERVAL.md create mode 100644 packages/ice/doc/variables/ICE_COMPLETED.md create mode 100644 packages/ice/doc/variables/ICE_FAILED.md create mode 100644 packages/ice/doc/variables/defaultOptions.md create mode 100644 packages/rtp/doc/functions/deserializeVideoOrientation.md create mode 100644 packages/rtp/doc/interfaces/Extensions.md create mode 100644 packages/rtp/doc/interfaces/videoOrientationPayload.md diff --git a/README.md b/README.md index 254892a5..1b85b668 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,7 @@ see console & chrome://webrtc-internals/ - [x] Trickle ICE - [x] ICE-Lite Client Side - [ ] ICE-Lite Server Side + - [x] ICE restart - [x] DTLS - [x] DTLS-SRTP - [x] Curve25519 @@ -89,6 +90,7 @@ see console & chrome://webrtc-internals/ - [x] SRTP - [x] SRTCP - [x] SDP + - [x] reuse inactive m-line - [x] PeerConnection - [x] Simulcast - [x] recv @@ -122,10 +124,6 @@ see console & chrome://webrtc-internals/ ## Road Map Towards 2.0 - [ ] API compatible with browser RTCPeerConnection -- [ ] ICE - - [ ] ICE restart -- [ ] SDP - - [ ] reuse inactive m-line - [ ] Simulcast - [ ] send - [ ] support more cipher suites diff --git a/doc/classes/Candidate.md b/doc/classes/Candidate.md index a7c8f793..9a57203a 100644 --- a/doc/classes/Candidate.md +++ b/doc/classes/Candidate.md @@ -10,7 +10,7 @@ ### new Candidate() -> **new Candidate**(`foundation`, `component`, `transport`, `priority`, `host`, `port`, `type`, `relatedAddress`?, `relatedPort`?, `tcptype`?, `generation`?): [`Candidate`](Candidate.md) +> **new Candidate**(`foundation`, `component`, `transport`, `priority`, `host`, `port`, `type`, `relatedAddress`?, `relatedPort`?, `tcptype`?, `generation`?, `ufrag`?): [`Candidate`](Candidate.md) #### Parameters @@ -36,6 +36,8 @@ • **generation?**: `number` +• **ufrag?**: `string` + #### Returns [`Candidate`](Candidate.md) @@ -106,6 +108,12 @@ > **type**: `string` +*** + +### ufrag? + +> `optional` **ufrag**: `string` + ## Methods ### canPairWith() diff --git a/doc/classes/CandidatePair.md b/doc/classes/CandidatePair.md index f85a1b66..587cf08f 100644 --- a/doc/classes/CandidatePair.md +++ b/doc/classes/CandidatePair.md @@ -10,7 +10,7 @@ ### new CandidatePair() -> **new CandidatePair**(`protocol`, `remoteCandidate`): [`CandidatePair`](CandidatePair.md) +> **new CandidatePair**(`protocol`, `remoteCandidate`, `iceControlling`): [`CandidatePair`](CandidatePair.md) #### Parameters @@ -18,6 +18,8 @@ • **remoteCandidate**: [`Candidate`](Candidate.md) +• **iceControlling**: `boolean` + #### Returns [`CandidatePair`](CandidatePair.md) @@ -26,27 +28,19 @@ ### handle? -> `optional` **handle**: `object` - -#### cancel() - -> **cancel**: () => `void` +> `optional` **handle**: `Cancelable`\<`void`\> -##### Returns - -`void` - -#### done() +*** -> **done**: () => `boolean` +### iceControlling -##### Returns +> **iceControlling**: `boolean` -`boolean` +*** -#### promise +### id -> **promise**: `PCancelable`\<`any`\> = `pCancel` +> `readonly` **id**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` *** @@ -84,6 +78,28 @@ *** +### json + +> `get` **json**(): `object` + +#### Returns + +`object` + +##### localCandidate + +> **localCandidate**: `string` + +##### protocol + +> **protocol**: `string` + +##### remoteCandidate + +> **remoteCandidate**: `string` + +*** + ### localCandidate > `get` **localCandidate**(): [`Candidate`](Candidate.md) @@ -94,6 +110,16 @@ *** +### priority + +> `get` **priority**(): `number` + +#### Returns + +`number` + +*** + ### remoteAddr > `get` **remoteAddr**(): readonly [`string`, `number`] @@ -122,13 +148,17 @@ readonly [`string`, `number`] `object` +##### localCandidate + +> **localCandidate**: `string` + ##### protocol > **protocol**: `string` -##### remoteAddr +##### remoteCandidate -> **remoteAddr**: readonly [`string`, `number`] +> **remoteCandidate**: `string` *** diff --git a/doc/classes/Connection.md b/doc/classes/Connection.md index 12b72168..4f774d0b 100644 --- a/doc/classes/Connection.md +++ b/doc/classes/Connection.md @@ -6,15 +6,19 @@ # Class: Connection +## Implements + +- [`IceConnection`](../interfaces/IceConnection.md) + ## Constructors ### new Connection() -> **new Connection**(`iceControlling`, `options`?): [`Connection`](Connection.md) +> **new Connection**(`_iceControlling`, `options`?): [`Connection`](Connection.md) #### Parameters -• **iceControlling**: `boolean` +• **\_iceControlling**: `boolean` • **options?**: `Partial`\<[`IceOptions`](../interfaces/IceOptions.md)\> @@ -24,27 +28,23 @@ ## Properties -### \_localCandidatesEnd - -> **\_localCandidatesEnd**: `boolean` = `false` +### checkList -*** +> **checkList**: [`CandidatePair`](CandidatePair.md)[] = `[]` -### \_tieBreaker +#### Implementation of -> **\_tieBreaker**: `bigint` +[`IceConnection`](../interfaces/IceConnection.md).[`checkList`](../interfaces/IceConnection.md#checklist) *** -### checkList - -> **checkList**: [`CandidatePair`](CandidatePair.md)[] = `[]` +### generation -*** +> **generation**: `number` = `-1` -### iceControlling +#### Implementation of -> **iceControlling**: `boolean` +[`IceConnection`](../interfaces/IceConnection.md).[`generation`](../interfaces/IceConnection.md#generation) *** @@ -52,17 +52,39 @@ > **localCandidates**: [`Candidate`](Candidate.md)[] = `[]` +#### Implementation of + +[`IceConnection`](../interfaces/IceConnection.md).[`localCandidates`](../interfaces/IceConnection.md#localcandidates) + +*** + +### localCandidatesEnd + +> **localCandidatesEnd**: `boolean` = `false` + +#### Implementation of + +[`IceConnection`](../interfaces/IceConnection.md).[`localCandidatesEnd`](../interfaces/IceConnection.md#localcandidatesend) + *** ### localPassword > **localPassword**: `string` +#### Implementation of + +[`IceConnection`](../interfaces/IceConnection.md).[`localPassword`](../interfaces/IceConnection.md#localpassword) + *** -### localUserName +### localUsername + +> **localUsername**: `string` -> **localUserName**: `string` +#### Implementation of + +[`IceConnection`](../interfaces/IceConnection.md).[`localUsername`](../interfaces/IceConnection.md#localusername) *** @@ -70,17 +92,39 @@ > `optional` **lookup**: `MdnsLookup` +#### Implementation of + +[`IceConnection`](../interfaces/IceConnection.md).[`lookup`](../interfaces/IceConnection.md#lookup) + *** ### nominated? > `optional` **nominated**: [`CandidatePair`](CandidatePair.md) +#### Implementation of + +[`IceConnection`](../interfaces/IceConnection.md).[`nominated`](../interfaces/IceConnection.md#nominated) + *** ### onData -> `readonly` **onData**: [`Event`](Event.md)\<[`Buffer`, `number`]\> +> `readonly` **onData**: [`Event`](Event.md)\<[`Buffer`]\> + +#### Implementation of + +[`IceConnection`](../interfaces/IceConnection.md).[`onData`](../interfaces/IceConnection.md#ondata) + +*** + +### onIceCandidate + +> `readonly` **onIceCandidate**: [`Event`](Event.md)\<[[`Candidate`](Candidate.md)]\> + +#### Implementation of + +[`IceConnection`](../interfaces/IceConnection.md).[`onIceCandidate`](../interfaces/IceConnection.md#onicecandidate) *** @@ -88,47 +132,69 @@ > **options**: [`IceOptions`](../interfaces/IceOptions.md) +#### Implementation of + +[`IceConnection`](../interfaces/IceConnection.md).[`options`](../interfaces/IceConnection.md#options) + *** ### remoteCandidatesEnd > **remoteCandidatesEnd**: `boolean` = `false` +#### Implementation of + +[`IceConnection`](../interfaces/IceConnection.md).[`remoteCandidatesEnd`](../interfaces/IceConnection.md#remotecandidatesend) + *** ### remoteIsLite > **remoteIsLite**: `boolean` = `false` +#### Implementation of + +[`IceConnection`](../interfaces/IceConnection.md).[`remoteIsLite`](../interfaces/IceConnection.md#remoteislite) + *** ### remotePassword > **remotePassword**: `string` = `""` +#### Implementation of + +[`IceConnection`](../interfaces/IceConnection.md).[`remotePassword`](../interfaces/IceConnection.md#remotepassword) + *** ### remoteUsername > **remoteUsername**: `string` = `""` -*** - -### restarted +#### Implementation of -> **restarted**: `boolean` = `false` +[`IceConnection`](../interfaces/IceConnection.md).[`remoteUsername`](../interfaces/IceConnection.md#remoteusername) *** ### state -> **state**: `IceState` = `"new"` +> **state**: [`IceState`](../type-aliases/IceState.md) = `"new"` + +#### Implementation of + +[`IceConnection`](../interfaces/IceConnection.md).[`state`](../interfaces/IceConnection.md#state) *** ### stateChanged -> `readonly` **stateChanged**: [`Event`](Event.md)\<[`IceState`]\> +> `readonly` **stateChanged**: [`Event`](Event.md)\<[[`IceState`](../type-aliases/IceState.md)]\> + +#### Implementation of + +[`IceConnection`](../interfaces/IceConnection.md).[`stateChanged`](../interfaces/IceConnection.md#statechanged) *** @@ -136,26 +202,52 @@ > `optional` **stunServer**: readonly [`string`, `number`] +#### Implementation of + +[`IceConnection`](../interfaces/IceConnection.md).[`stunServer`](../interfaces/IceConnection.md#stunserver) + *** ### turnServer? > `optional` **turnServer**: readonly [`string`, `number`] -*** - -### useIpv4 +#### Implementation of -> **useIpv4**: `boolean` +[`IceConnection`](../interfaces/IceConnection.md).[`turnServer`](../interfaces/IceConnection.md#turnserver) *** -### useIpv6 +### userHistory + +> **userHistory**: `object` = `{}` -> **useIpv6**: `boolean` +#### Index Signature + + \[`username`: `string`\]: `string` ## Accessors +### iceControlling + +> `get` **iceControlling**(): `boolean` + +> `set` **iceControlling**(`value`): `void` + +#### Parameters + +• **value**: `boolean` + +#### Returns + +`boolean` + +#### Implementation of + +[`IceConnection`](../interfaces/IceConnection.md).[`iceControlling`](../interfaces/IceConnection.md#icecontrolling) + +*** + ### remoteCandidates > `get` **remoteCandidates**(): [`Candidate`](Candidate.md)[] @@ -184,6 +276,10 @@ `Promise`\<`void`\> +#### Implementation of + +[`IceConnection`](../interfaces/IceConnection.md).[`addRemoteCandidate`](../interfaces/IceConnection.md#addremotecandidate) + *** ### checkIncoming() @@ -206,7 +302,7 @@ ### checkStart() -> **checkStart**(`pair`): `PCancelable`\<`unknown`\> +> **checkStart**(`pair`): `object` #### Parameters @@ -214,7 +310,35 @@ #### Returns -`PCancelable`\<`unknown`\> +`object` + +##### awaitable + +> **awaitable**: `Promise`\<`void`\> = `p` + +##### reject() + +> **reject**: (`reason`?) => `void` + +###### Parameters + +• **reason?**: `any` + +###### Returns + +`void` + +##### resolve() + +> **resolve**: (`value`) => `void` + +###### Parameters + +• **value**: `void` \| `PromiseLike`\<`void`\> + +###### Returns + +`void` *** @@ -226,6 +350,10 @@ `Promise`\<`void`\> +#### Implementation of + +[`IceConnection`](../interfaces/IceConnection.md).[`close`](../interfaces/IceConnection.md#close) + *** ### connect() @@ -236,36 +364,24 @@ `Promise`\<`void`\> -*** - -### dataReceived() - -> **dataReceived**(`data`, `component`): `void` - -#### Parameters - -• **data**: `Buffer` - -• **component**: `number` - -#### Returns +#### Implementation of -`void` +[`IceConnection`](../interfaces/IceConnection.md).[`connect`](../interfaces/IceConnection.md#connect) *** ### gatherCandidates() -> **gatherCandidates**(`cb`?): `Promise`\<`void`\> - -#### Parameters - -• **cb?** +> **gatherCandidates**(): `Promise`\<`void`\> #### Returns `Promise`\<`void`\> +#### Implementation of + +[`IceConnection`](../interfaces/IceConnection.md).[`gatherCandidates`](../interfaces/IceConnection.md#gathercandidates) + *** ### getDefaultCandidate() @@ -276,35 +392,37 @@ [`Candidate`](Candidate.md) -*** - -### requestReceived() - -> **requestReceived**(`message`, `addr`, `protocol`, `rawData`): `void` +#### Implementation of -#### Parameters - -• **message**: [`Message`](Message.md) +[`IceConnection`](../interfaces/IceConnection.md).[`getDefaultCandidate`](../interfaces/IceConnection.md#getdefaultcandidate) -• **addr**: readonly [`string`, `number`] +*** -• **protocol**: [`Protocol`](../interfaces/Protocol.md) +### resetNominatedPair() -• **rawData**: `Buffer` +> **resetNominatedPair**(): `void` #### Returns `void` +#### Implementation of + +[`IceConnection`](../interfaces/IceConnection.md).[`resetNominatedPair`](../interfaces/IceConnection.md#resetnominatedpair) + *** -### resetNominatedPair() +### restart() -> **resetNominatedPair**(): `void` +> **restart**(): `Promise`\<`void`\> #### Returns -`void` +`Promise`\<`void`\> + +#### Implementation of + +[`IceConnection`](../interfaces/IceConnection.md).[`restart`](../interfaces/IceConnection.md#restart) *** @@ -320,6 +438,10 @@ `Promise`\<`void`\> +#### Implementation of + +[`IceConnection`](../interfaces/IceConnection.md).[`send`](../interfaces/IceConnection.md#send) + *** ### setRemoteParams() @@ -339,3 +461,7 @@ #### Returns `void` + +#### Implementation of + +[`IceConnection`](../interfaces/IceConnection.md).[`setRemoteParams`](../interfaces/IceConnection.md#setremoteparams) diff --git a/doc/classes/IceCandidate.md b/doc/classes/IceCandidate.md index 3847f175..16fb498f 100644 --- a/doc/classes/IceCandidate.md +++ b/doc/classes/IceCandidate.md @@ -10,7 +10,7 @@ ### new IceCandidate() -> **new IceCandidate**(`component`, `foundation`, `ip`, `port`, `priority`, `protocol`, `type`): [`IceCandidate`](IceCandidate.md) +> **new IceCandidate**(`component`, `foundation`, `ip`, `port`, `priority`, `protocol`, `type`, `generation`?, `ufrag`?): [`IceCandidate`](IceCandidate.md) #### Parameters @@ -28,6 +28,10 @@ • **type**: `string` +• **generation?**: `number` + +• **ufrag?**: `string` + #### Returns [`IceCandidate`](IceCandidate.md) @@ -46,6 +50,12 @@ *** +### generation? + +> `optional` **generation**: `number` + +*** + ### ip > **ip**: `string` @@ -104,6 +114,12 @@ > **type**: `string` +*** + +### ufrag? + +> `optional` **ufrag**: `string` + ## Methods ### toJSON() diff --git a/doc/classes/MediaStreamTrack.md b/doc/classes/MediaStreamTrack.md index da15661a..2af58f35 100644 --- a/doc/classes/MediaStreamTrack.md +++ b/doc/classes/MediaStreamTrack.md @@ -82,7 +82,7 @@ todo impl ### onReceiveRtp -> `readonly` **onReceiveRtp**: [`Event`](Event.md)\<[[`RtpPacket`](RtpPacket.md)]\> +> `readonly` **onReceiveRtp**: [`Event`](Event.md)\<[[`RtpPacket`](RtpPacket.md), `Extensions?`]\> *** diff --git a/doc/classes/Message.md b/doc/classes/Message.md index e45c6151..1fb3cfd2 100644 --- a/doc/classes/Message.md +++ b/doc/classes/Message.md @@ -88,6 +88,28 @@ *** +### json + +> `get` **json**(): `object` + +#### Returns + +`object` + +##### attributes + +> **attributes**: `AttributePair`[] + +##### messageClass + +> **messageClass**: `string` + +##### messageMethod + +> **messageMethod**: `string` + +*** + ### transactionIdHex > `get` **transactionIdHex**(): `string` @@ -210,6 +232,10 @@ `object` +##### attributes + +> **attributes**: `AttributePair`[] + ##### messageClass > **messageClass**: `string` diff --git a/doc/classes/RTCDtlsTransport.md b/doc/classes/RTCDtlsTransport.md index a6dfe0fb..e291fe83 100644 --- a/doc/classes/RTCDtlsTransport.md +++ b/doc/classes/RTCDtlsTransport.md @@ -10,7 +10,7 @@ ### new RTCDtlsTransport() -> **new RTCDtlsTransport**(`config`, `iceTransport`, `router`, `certificates`, `srtpProfiles`): [`RTCDtlsTransport`](RTCDtlsTransport.md) +> **new RTCDtlsTransport**(`config`, `iceTransport`, `router`, `localCertificate`?, `srtpProfiles`?): [`RTCDtlsTransport`](RTCDtlsTransport.md) #### Parameters @@ -20,9 +20,9 @@ • **router**: `RtpRouter` -• **certificates**: [`RTCCertificate`](RTCCertificate.md)[] +• **localCertificate?**: [`RTCCertificate`](RTCCertificate.md) -• **srtpProfiles**: (`1` \| `7`)[] = `[]` +• **srtpProfiles?**: (`1` \| `7`)[] = `[]` #### Returns @@ -30,12 +30,6 @@ ## Properties -### certificates - -> `readonly` **certificates**: [`RTCCertificate`](RTCCertificate.md)[] - -*** - ### config > `readonly` **config**: [`PeerConfig`](../interfaces/PeerConfig.md) @@ -80,12 +74,6 @@ *** -### localCertificatePromise? - -> `optional` **localCertificatePromise**: `Promise`\<[`RTCCertificate`](RTCCertificate.md)\> - -*** - ### onStateChange > `readonly` **onStateChange**: [`Event`](Event.md)\<[`"closed"` \| `"new"` \| `"connected"` \| `"connecting"` \| `"failed"`]\> @@ -132,6 +120,18 @@ > **transportSequenceNumber**: `number` = `0` +*** + +### localCertificate? + +> `static` `optional` **localCertificate**: [`RTCCertificate`](RTCCertificate.md) + +*** + +### localCertificatePromise? + +> `static` `optional` **localCertificatePromise**: `Promise`\<[`RTCCertificate`](RTCCertificate.md)\> + ## Accessors ### localParameters @@ -202,16 +202,6 @@ *** -### setupCertificate() - -> **setupCertificate**(): `Promise`\<[`RTCCertificate`](RTCCertificate.md)\> - -#### Returns - -`Promise`\<[`RTCCertificate`](RTCCertificate.md)\> - -*** - ### start() > **start**(): `Promise`\<`void`\> @@ -249,3 +239,13 @@ #### Returns `void` + +*** + +### SetupCertificate() + +> `static` **SetupCertificate**(): `Promise`\<[`RTCCertificate`](RTCCertificate.md)\> + +#### Returns + +`Promise`\<[`RTCCertificate`](RTCCertificate.md)\> diff --git a/doc/classes/RTCIceCandidate.md b/doc/classes/RTCIceCandidate.md index af68dd7c..ef0de083 100644 --- a/doc/classes/RTCIceCandidate.md +++ b/doc/classes/RTCIceCandidate.md @@ -38,6 +38,12 @@ > `optional` **sdpMid**: `string` +*** + +### usernameFragment? + +> `optional` **usernameFragment**: `string` + ## Methods ### toJSON() @@ -60,6 +66,10 @@ > **sdpMid**: `undefined` \| `string` +##### usernameFragment + +> **usernameFragment**: `undefined` \| `string` + *** ### isThis() diff --git a/doc/classes/RTCIceGatherer.md b/doc/classes/RTCIceGatherer.md index 4049df34..6d4d897a 100644 --- a/doc/classes/RTCIceGatherer.md +++ b/doc/classes/RTCIceGatherer.md @@ -24,7 +24,7 @@ ### connection -> `readonly` **connection**: [`Connection`](Connection.md) +> `readonly` **connection**: [`IceConnection`](../interfaces/IceConnection.md) *** diff --git a/doc/classes/RTCIceTransport.md b/doc/classes/RTCIceTransport.md index f75c50be..210857c5 100644 --- a/doc/classes/RTCIceTransport.md +++ b/doc/classes/RTCIceTransport.md @@ -10,11 +10,11 @@ ### new RTCIceTransport() -> **new RTCIceTransport**(`gather`): [`RTCIceTransport`](RTCIceTransport.md) +> **new RTCIceTransport**(`iceGather`): [`RTCIceTransport`](RTCIceTransport.md) #### Parameters -• **gather**: [`RTCIceGatherer`](RTCIceGatherer.md) +• **iceGather**: [`RTCIceGatherer`](RTCIceGatherer.md) #### Returns @@ -24,7 +24,7 @@ ### connection -> **connection**: [`Connection`](Connection.md) +> **connection**: [`IceConnection`](../interfaces/IceConnection.md) *** @@ -34,6 +34,18 @@ *** +### onIceCandidate + +> `readonly` **onIceCandidate**: [`Event`](Event.md)\<[`undefined` \| [`IceCandidate`](IceCandidate.md)]\> + +*** + +### onNegotiationNeeded + +> `readonly` **onNegotiationNeeded**: [`Event`](Event.md)\<[]\> + +*** + ### onStateChange > `readonly` **onStateChange**: [`Event`](Event.md)\<[`"disconnected"` \| `"closed"` \| `"completed"` \| `"new"` \| `"connected"` \| `"failed"` \| `"checking"`]\> @@ -46,13 +58,33 @@ ## Accessors -### iceGather +### gatheringState + +> `get` **gatheringState**(): `"complete"` \| `"new"` \| `"gathering"` + +#### Returns + +`"complete"` \| `"new"` \| `"gathering"` + +*** + +### localCandidates -> `get` **iceGather**(): [`RTCIceGatherer`](RTCIceGatherer.md) +> `get` **localCandidates**(): [`IceCandidate`](IceCandidate.md)[] #### Returns -[`RTCIceGatherer`](RTCIceGatherer.md) +[`IceCandidate`](IceCandidate.md)[] + +*** + +### localParameters + +> `get` **localParameters**(): [`RTCIceParameters`](RTCIceParameters.md) + +#### Returns + +[`RTCIceParameters`](RTCIceParameters.md) *** @@ -80,14 +112,36 @@ *** +### gather() + +> **gather**(): `Promise`\<`void`\> + +#### Returns + +`Promise`\<`void`\> + +*** + +### restart() + +> **restart**(): `void` + +#### Returns + +`void` + +*** + ### setRemoteParams() -> **setRemoteParams**(`remoteParameters`): `void` +> **setRemoteParams**(`remoteParameters`, `renomination`): `void` #### Parameters • **remoteParameters**: [`RTCIceParameters`](RTCIceParameters.md) +• **renomination**: `boolean` = `false` + #### Returns `void` diff --git a/doc/classes/RTCPeerConnection.md b/doc/classes/RTCPeerConnection.md index e20db8fe..a44fda08 100644 --- a/doc/classes/RTCPeerConnection.md +++ b/doc/classes/RTCPeerConnection.md @@ -30,12 +30,6 @@ ## Properties -### candidatesSent - -> **candidatesSent**: `Set`\<`string`\> - -*** - ### cname > `readonly` **cname**: `string` @@ -84,6 +78,12 @@ *** +### needRestart + +> **needRestart**: `boolean` = `false` + +*** + ### negotiationneeded > **negotiationneeded**: `boolean` = `false` @@ -186,12 +186,6 @@ *** -### transportEstablished - -> **transportEstablished**: `boolean` = `false` - -*** - ### captureRejectionSymbol > `readonly` `static` **captureRejectionSymbol**: *typeof* [`captureRejectionSymbol`](RTCDataChannel.md#capturerejectionsymbol) @@ -262,6 +256,16 @@ regular `'error'` listener is installed. *** +### iceGeneration + +> `get` **iceGeneration**(): `number` + +#### Returns + +`number` + +*** + ### iceTransports > `get` **iceTransports**(): [`RTCIceTransport`](RTCIceTransport.md)[] @@ -290,16 +294,6 @@ regular `'error'` listener is installed. `undefined` \| [`RTCSessionDescription`](RTCSessionDescription.md) -*** - -### remoteIsBundled - -> `get` **remoteIsBundled**(): `undefined` \| [`GroupDescription`](GroupDescription.md) - -#### Returns - -`undefined` \| [`GroupDescription`](GroupDescription.md) - ## Methods ### \[captureRejectionSymbol\]()? @@ -466,7 +460,13 @@ todo impl ### createOffer() -> **createOffer**(): `Promise`\<[`RTCSessionDescription`](RTCSessionDescription.md)\> +> **createOffer**(`__namedParameters`): `Promise`\<[`RTCSessionDescription`](RTCSessionDescription.md)\> + +#### Parameters + +• **\_\_namedParameters** = `{}` + +• **\_\_namedParameters.iceRestart?**: `boolean` #### Returns @@ -1122,6 +1122,30 @@ v0.1.26 *** +### restartIce() + +> **restartIce**(): `void` + +#### Returns + +`void` + +*** + +### setConfiguration() + +> **setConfiguration**(`config`): `void` + +#### Parameters + +• **config**: `Partial`\<[`PeerConfig`](../interfaces/PeerConfig.md)\> + +#### Returns + +`void` + +*** + ### setLocalDescription() > **setLocalDescription**(`sessionDescription`): `Promise`\<[`SessionDescription`](SessionDescription.md)\> diff --git a/doc/classes/RTCRtpReceiver.md b/doc/classes/RTCRtpReceiver.md index c726cdb3..c3895dff 100644 --- a/doc/classes/RTCRtpReceiver.md +++ b/doc/classes/RTCRtpReceiver.md @@ -263,7 +263,7 @@ todo impl • **rid**: `string` -• **extensions**: `Extensions` +• **extensions**: [`Extensions`](../interfaces/Extensions.md) #### Returns @@ -279,7 +279,7 @@ todo impl • **packet**: [`RtpPacket`](RtpPacket.md) -• **extensions**: `Extensions` +• **extensions**: [`Extensions`](../interfaces/Extensions.md) #### Returns diff --git a/doc/classes/StunOverTurnProtocol.md b/doc/classes/StunOverTurnProtocol.md index a8a50a8e..217d4c4d 100644 --- a/doc/classes/StunOverTurnProtocol.md +++ b/doc/classes/StunOverTurnProtocol.md @@ -14,14 +14,12 @@ ### new StunOverTurnProtocol() -> **new StunOverTurnProtocol**(`turn`, `ice`): [`StunOverTurnProtocol`](StunOverTurnProtocol.md) +> **new StunOverTurnProtocol**(`turn`): [`StunOverTurnProtocol`](StunOverTurnProtocol.md) #### Parameters • **turn**: [`TurnProtocol`](TurnProtocol.md) -• **ice**: [`Connection`](Connection.md) - #### Returns [`StunOverTurnProtocol`](StunOverTurnProtocol.md) @@ -38,6 +36,26 @@ *** +### onDataReceived + +> **onDataReceived**: [`Event`](Event.md)\<[`Buffer`]\> + +#### Implementation of + +[`Protocol`](../interfaces/Protocol.md).[`onDataReceived`](../interfaces/Protocol.md#ondatareceived) + +*** + +### onRequestReceived + +> **onRequestReceived**: [`Event`](Event.md)\<[[`Message`](Message.md), readonly [`string`, `number`], `Buffer`]\> + +#### Implementation of + +[`Protocol`](../interfaces/Protocol.md).[`onRequestReceived`](../interfaces/Protocol.md#onrequestreceived) + +*** + ### turn > **turn**: [`TurnProtocol`](TurnProtocol.md) diff --git a/doc/classes/StunProtocol.md b/doc/classes/StunProtocol.md index 2024f188..8f847576 100644 --- a/doc/classes/StunProtocol.md +++ b/doc/classes/StunProtocol.md @@ -14,11 +14,7 @@ ### new StunProtocol() -> **new StunProtocol**(`receiver`?): [`StunProtocol`](StunProtocol.md) - -#### Parameters - -• **receiver?**: [`Connection`](Connection.md) +> **new StunProtocol**(): [`StunProtocol`](StunProtocol.md) #### Returns @@ -26,25 +22,43 @@ ## Properties -### localAddress? +### localCandidate? + +> `optional` **localCandidate**: [`Candidate`](Candidate.md) -> `optional` **localAddress**: `string` +#### Implementation of + +[`Protocol`](../interfaces/Protocol.md).[`localCandidate`](../interfaces/Protocol.md#localcandidate) *** -### localCandidate? +### localIp? -> `optional` **localCandidate**: [`Candidate`](Candidate.md) +> `optional` **localIp**: `string` #### Implementation of -[`Protocol`](../interfaces/Protocol.md).[`localCandidate`](../interfaces/Protocol.md#localcandidate) +[`Protocol`](../interfaces/Protocol.md).[`localIp`](../interfaces/Protocol.md#localip) *** -### receiver? +### onDataReceived + +> `readonly` **onDataReceived**: [`Event`](Event.md)\<[`Buffer`]\> + +#### Implementation of -> `optional` **receiver**: [`Connection`](Connection.md) +[`Protocol`](../interfaces/Protocol.md).[`onDataReceived`](../interfaces/Protocol.md#ondatareceived) + +*** + +### onRequestReceived + +> `readonly` **onRequestReceived**: [`Event`](Event.md)\<[[`Message`](Message.md), readonly [`string`, `number`], `Buffer`]\> + +#### Implementation of + +[`Protocol`](../interfaces/Protocol.md).[`onRequestReceived`](../interfaces/Protocol.md#onrequestreceived) *** @@ -114,16 +128,6 @@ *** -### connectionLost() - -> **connectionLost**(): `void` - -#### Returns - -`void` - -*** - ### connectionMade() > **connectionMade**(`useIpv4`, `portRange`?, `interfaceAddresses`?): `Promise`\<`void`\> diff --git a/doc/classes/TurnProtocol.md b/doc/classes/TurnProtocol.md index f1a3fc13..61aa9384 100644 --- a/doc/classes/TurnProtocol.md +++ b/doc/classes/TurnProtocol.md @@ -80,6 +80,26 @@ sec *** +### onDataReceived + +> **onDataReceived**: [`Event`](Event.md)\<[`Buffer`]\> + +#### Implementation of + +[`Protocol`](../interfaces/Protocol.md).[`onDataReceived`](../interfaces/Protocol.md#ondatareceived) + +*** + +### onRequestReceived + +> **onRequestReceived**: [`Event`](Event.md)\<[[`Message`](Message.md), readonly [`string`, `number`], `Buffer`]\> + +#### Implementation of + +[`Protocol`](../interfaces/Protocol.md).[`onRequestReceived`](../interfaces/Protocol.md#onrequestreceived) + +*** + ### options > **options**: `object` = `{}` diff --git a/doc/functions/createStunOverTurnClient.md b/doc/functions/createStunOverTurnClient.md index c66944fd..da77f1c6 100644 --- a/doc/functions/createStunOverTurnClient.md +++ b/doc/functions/createStunOverTurnClient.md @@ -14,8 +14,6 @@ • **\_\_namedParameters.address**: readonly [`string`, `number`] -• **\_\_namedParameters.ice**: [`Connection`](../classes/Connection.md) - • **\_\_namedParameters.password**: `string` • **\_\_namedParameters.username**: `string` @@ -30,7 +28,7 @@ • **\_\_namedParameters.ssl?**: `boolean` -• **\_\_namedParameters.transport?**: `"tcp"` \| `"udp"` +• **\_\_namedParameters.transport?**: `"udp"` \| `"tcp"` ## Returns diff --git a/doc/functions/deserializeVideoOrientation.md b/doc/functions/deserializeVideoOrientation.md new file mode 100644 index 00000000..89f6c886 --- /dev/null +++ b/doc/functions/deserializeVideoOrientation.md @@ -0,0 +1,17 @@ +[**werift**](../README.md) • **Docs** + +*** + +[werift](../globals.md) / deserializeVideoOrientation + +# Function: deserializeVideoOrientation() + +> **deserializeVideoOrientation**(`payload`): [`videoOrientationPayload`](../interfaces/videoOrientationPayload.md) + +## Parameters + +• **payload**: `Buffer` + +## Returns + +[`videoOrientationPayload`](../interfaces/videoOrientationPayload.md) diff --git a/doc/functions/rtpHeaderExtensionsParser.md b/doc/functions/rtpHeaderExtensionsParser.md index 82b3d757..9f7fb308 100644 --- a/doc/functions/rtpHeaderExtensionsParser.md +++ b/doc/functions/rtpHeaderExtensionsParser.md @@ -6,7 +6,7 @@ # Function: rtpHeaderExtensionsParser() -> **rtpHeaderExtensionsParser**(`extensions`, `extIdUriMap`): `object` +> **rtpHeaderExtensionsParser**(`extensions`, `extIdUriMap`): [`Extensions`](../interfaces/Extensions.md) ## Parameters @@ -16,4 +16,4 @@ ## Returns -`object` +[`Extensions`](../interfaces/Extensions.md) diff --git a/doc/functions/useVideoOrientation.md b/doc/functions/useVideoOrientation.md new file mode 100644 index 00000000..28aca3b4 --- /dev/null +++ b/doc/functions/useVideoOrientation.md @@ -0,0 +1,13 @@ +[**werift**](../README.md) • **Docs** + +*** + +[werift](../globals.md) / useVideoOrientation + +# Function: useVideoOrientation() + +> **useVideoOrientation**(): [`RTCRtpHeaderExtensionParameters`](../classes/RTCRtpHeaderExtensionParameters.md) + +## Returns + +[`RTCRtpHeaderExtensionParameters`](../classes/RTCRtpHeaderExtensionParameters.md) diff --git a/doc/globals.md b/doc/globals.md index fb178afb..74865601 100644 --- a/doc/globals.md +++ b/doc/globals.md @@ -101,6 +101,8 @@ ## Interfaces +- [Extensions](interfaces/Extensions.md) +- [IceConnection](interfaces/IceConnection.md) - [IceOptions](interfaces/IceOptions.md) - [MessageEvent](interfaces/MessageEvent.md) - [PeerConfig](interfaces/PeerConfig.md) @@ -116,6 +118,7 @@ - [Transport](interfaces/Transport.md) - [TurnClientConfig](interfaces/TurnClientConfig.md) - [TurnClientOptions](interfaces/TurnClientOptions.md) +- [videoOrientationPayload](interfaces/videoOrientationPayload.md) ## Type Aliases @@ -134,6 +137,7 @@ - [Extension](type-aliases/Extension.md) - [HashAlgorithms](type-aliases/HashAlgorithms.md) - [IceGathererState](type-aliases/IceGathererState.md) +- [IceState](type-aliases/IceState.md) - [InterfaceAddresses](type-aliases/InterfaceAddresses.md) - [Kind](type-aliases/Kind.md) - [NamedCurveAlgorithms](type-aliases/NamedCurveAlgorithms.md) @@ -153,6 +157,8 @@ ## Variables - [AttributeKeys](variables/AttributeKeys.md) +- [CONSENT\_FAILURES](variables/CONSENT_FAILURES.md) +- [CONSENT\_INTERVAL](variables/CONSENT_INTERVAL.md) - [COOKIE](variables/COOKIE.md) - [CipherSuite](variables/CipherSuite.md) - [CipherSuiteList](variables/CipherSuiteList.md) @@ -165,6 +171,8 @@ - [FINGERPRINT\_XOR](variables/FINGERPRINT_XOR.md) - [HEADER\_LENGTH](variables/HEADER_LENGTH.md) - [HashAlgorithm](variables/HashAlgorithm.md) +- [ICE\_COMPLETED](variables/ICE_COMPLETED.md) +- [ICE\_FAILED](variables/ICE_FAILED.md) - [INTEGRITY\_LENGTH](variables/INTEGRITY_LENGTH.md) - [IPV4\_PROTOCOL](variables/IPV4_PROTOCOL.md) - [IPV6\_PROTOCOL](variables/IPV6_PROTOCOL.md) @@ -185,6 +193,7 @@ - [SignatureAlgorithm](variables/SignatureAlgorithm.md) - [SignatureScheme](variables/SignatureScheme.md) - [certificateTypes](variables/certificateTypes.md) +- [defaultOptions](variables/defaultOptions.md) - [defaultPeerConfig](variables/defaultPeerConfig.md) - [depacketizerCodecs](variables/depacketizerCodecs.md) - [signatures](variables/signatures.md) @@ -225,6 +234,7 @@ - [deserializeAudioLevelIndication](functions/deserializeAudioLevelIndication.md) - [deserializeString](functions/deserializeString.md) - [deserializeUint16BE](functions/deserializeUint16BE.md) +- [deserializeVideoOrientation](functions/deserializeVideoOrientation.md) - [dumpBuffer](functions/dumpBuffer.md) - [enumerate](functions/enumerate.md) - [findCodecByMimeType](functions/findCodecByMimeType.md) @@ -290,6 +300,7 @@ - [useSdesRTPStreamId](functions/useSdesRTPStreamId.md) - [useTWCC](functions/useTWCC.md) - [useTransportWideCC](functions/useTransportWideCC.md) +- [useVideoOrientation](functions/useVideoOrientation.md) - [validateAddress](functions/validateAddress.md) - [validateRemoteCandidate](functions/validateRemoteCandidate.md) - [wrapRtx](functions/wrapRtx.md) diff --git a/doc/interfaces/Extensions.md b/doc/interfaces/Extensions.md new file mode 100644 index 00000000..ed3cb1f3 --- /dev/null +++ b/doc/interfaces/Extensions.md @@ -0,0 +1,11 @@ +[**werift**](../README.md) • **Docs** + +*** + +[werift](../globals.md) / Extensions + +# Interface: Extensions + +## Indexable + + \[`uri`: `string`\]: `any` diff --git a/doc/interfaces/IceConnection.md b/doc/interfaces/IceConnection.md new file mode 100644 index 00000000..ab452b48 --- /dev/null +++ b/doc/interfaces/IceConnection.md @@ -0,0 +1,235 @@ +[**werift**](../README.md) • **Docs** + +*** + +[werift](../globals.md) / IceConnection + +# Interface: IceConnection + +## Properties + +### checkList + +> **checkList**: [`CandidatePair`](../classes/CandidatePair.md)[] + +*** + +### generation + +> **generation**: `number` + +*** + +### iceControlling + +> **iceControlling**: `boolean` + +*** + +### localCandidates + +> **localCandidates**: [`Candidate`](../classes/Candidate.md)[] + +*** + +### localCandidatesEnd + +> **localCandidatesEnd**: `boolean` + +*** + +### localPassword + +> **localPassword**: `string` + +*** + +### localUsername + +> **localUsername**: `string` + +*** + +### lookup? + +> `optional` **lookup**: `MdnsLookup` + +*** + +### nominated? + +> `optional` **nominated**: [`CandidatePair`](../classes/CandidatePair.md) + +*** + +### onData + +> `readonly` **onData**: [`Event`](../classes/Event.md)\<[`Buffer`]\> + +*** + +### onIceCandidate + +> `readonly` **onIceCandidate**: [`Event`](../classes/Event.md)\<[[`Candidate`](../classes/Candidate.md)]\> + +*** + +### options + +> **options**: [`IceOptions`](IceOptions.md) + +*** + +### remoteCandidatesEnd + +> **remoteCandidatesEnd**: `boolean` + +*** + +### remoteIsLite + +> **remoteIsLite**: `boolean` + +*** + +### remotePassword + +> **remotePassword**: `string` + +*** + +### remoteUsername + +> **remoteUsername**: `string` + +*** + +### state + +> **state**: [`IceState`](../type-aliases/IceState.md) + +*** + +### stateChanged + +> `readonly` **stateChanged**: [`Event`](../classes/Event.md)\<[[`IceState`](../type-aliases/IceState.md)]\> + +*** + +### stunServer? + +> `optional` **stunServer**: readonly [`string`, `number`] + +*** + +### turnServer? + +> `optional` **turnServer**: readonly [`string`, `number`] + +## Methods + +### addRemoteCandidate() + +> **addRemoteCandidate**(`remoteCandidate`): `Promise`\<`void`\> + +#### Parameters + +• **remoteCandidate**: `undefined` \| [`Candidate`](../classes/Candidate.md) + +#### Returns + +`Promise`\<`void`\> + +*** + +### close() + +> **close**(): `Promise`\<`void`\> + +#### Returns + +`Promise`\<`void`\> + +*** + +### connect() + +> **connect**(): `Promise`\<`void`\> + +#### Returns + +`Promise`\<`void`\> + +*** + +### gatherCandidates() + +> **gatherCandidates**(): `Promise`\<`void`\> + +#### Returns + +`Promise`\<`void`\> + +*** + +### getDefaultCandidate() + +> **getDefaultCandidate**(): `undefined` \| [`Candidate`](../classes/Candidate.md) + +#### Returns + +`undefined` \| [`Candidate`](../classes/Candidate.md) + +*** + +### resetNominatedPair() + +> **resetNominatedPair**(): `void` + +#### Returns + +`void` + +*** + +### restart() + +> **restart**(): `void` + +#### Returns + +`void` + +*** + +### send() + +> **send**(`data`): `Promise`\<`void`\> + +#### Parameters + +• **data**: `Buffer` + +#### Returns + +`Promise`\<`void`\> + +*** + +### setRemoteParams() + +> **setRemoteParams**(`params`): `void` + +#### Parameters + +• **params** + +• **params.iceLite**: `boolean` + +• **params.password**: `string` + +• **params.usernameFragment**: `string` + +#### Returns + +`void` diff --git a/doc/interfaces/IceOptions.md b/doc/interfaces/IceOptions.md index c0d5a8ad..0eef0996 100644 --- a/doc/interfaces/IceOptions.md +++ b/doc/interfaces/IceOptions.md @@ -58,6 +58,12 @@ *** +### localPasswordPrefix? + +> `optional` **localPasswordPrefix**: `string` + +*** + ### portRange? > `optional` **portRange**: [`number`, `number`] @@ -84,7 +90,7 @@ ### turnTransport? -> `optional` **turnTransport**: `"tcp"` \| `"udp"` +> `optional` **turnTransport**: `"udp"` \| `"tcp"` *** diff --git a/doc/interfaces/PeerConfig.md b/doc/interfaces/PeerConfig.md index 9721a401..c538c92b 100644 --- a/doc/interfaces/PeerConfig.md +++ b/doc/interfaces/PeerConfig.md @@ -131,6 +131,12 @@ Return `true` if a STUN response should be sent, false if it should be skipped. *** +### icePasswordPrefix + +> **icePasswordPrefix**: `undefined` \| `string` + +*** + ### icePortRange > **icePortRange**: `undefined` \| [`number`, `number`] diff --git a/doc/interfaces/Protocol.md b/doc/interfaces/Protocol.md index cd252152..72597a09 100644 --- a/doc/interfaces/Protocol.md +++ b/doc/interfaces/Protocol.md @@ -38,6 +38,24 @@ *** +### localIp? + +> `optional` **localIp**: `string` + +*** + +### onDataReceived + +> **onDataReceived**: [`Event`](../classes/Event.md)\<[`Buffer`]\> + +*** + +### onRequestReceived + +> **onRequestReceived**: [`Event`](../classes/Event.md)\<[[`Message`](../classes/Message.md), readonly [`string`, `number`], `Buffer`]\> + +*** + ### request() > **request**: (`message`, `addr`, `integrityKey`?, `retransmissions`?) => `Promise`\<[[`Message`](../classes/Message.md), readonly [`string`, `number`]]\> diff --git a/doc/interfaces/TurnClientOptions.md b/doc/interfaces/TurnClientOptions.md index 2d9bac28..3c805e6a 100644 --- a/doc/interfaces/TurnClientOptions.md +++ b/doc/interfaces/TurnClientOptions.md @@ -34,4 +34,4 @@ ### transport? -> `optional` **transport**: `"tcp"` \| `"udp"` +> `optional` **transport**: `"udp"` \| `"tcp"` diff --git a/doc/interfaces/videoOrientationPayload.md b/doc/interfaces/videoOrientationPayload.md new file mode 100644 index 00000000..1bdf298b --- /dev/null +++ b/doc/interfaces/videoOrientationPayload.md @@ -0,0 +1,60 @@ +[**werift**](../README.md) • **Docs** + +*** + +[werift](../globals.md) / videoOrientationPayload + +# Interface: videoOrientationPayload + +## Properties + +### c + +> **c**: `number` + +Camera: indicates the direction of the camera used for this video stream. It can be used by the MTSI client in +receiver to e.g. display the received video differently depending on the source camera. +0: Front-facing camera, facing the user. If camera direction is unknown by the sending MTSI client in the terminal +then this is the default value used. +1: Back-facing camera, facing away from the user. + +*** + +### f + +> **f**: `number` + +F = Flip: indicates a horizontal (left-right flip) mirror operation on the video as sent on the link. +0: No flip operation. If the sending MTSI client in terminal does not know if a horizontal mirror operation is +necessary, then this is the default value used. +1: Horizontal flip operation + +*** + +### r0 + +> **r0**: `number` + +*** + +### r1 + +> **r1**: `number` + +R1, R0 = Rotation: indicates the rotation of the video as transmitted on the link. The receiver should rotate the video to +compensate that rotation. E.g. a 90° Counter Clockwise rotation should be compensated by the receiver with a 90° +Clockwise rotation prior to displaying. + + +----+----+-----------------------------------------------+------------------------------+ +| R1 | R0 | Rotation of the video as sent on the link | Rotation on the receiver | +| | | | before display | ++----+----+-----------------------------------------------+------------------------------+ +| 0 | 0 | 0° rotation | None | ++----+----+-----------------------------------------------+------------------------------+ +| 0 | 1 | 90° Counter Clockwise (CCW) rotation or 270° | 90° Clockwise (CW) rotation | +| | | Clockwise (CW) rotation | | ++----+----+-----------------------------------------------+------------------------------+ +| 1 | 0 | 180° CCW rotation or 180° CW rotation | 180° CW rotation | ++----+----+-----------------------------------------------+------------------------------+ +| 1 | 1 | 270° CCW rotation or 90° CW rotation | 90° CCW rotation | ++----+----+-----------------------------------------------+------------------------------+ diff --git a/doc/type-aliases/IceState.md b/doc/type-aliases/IceState.md new file mode 100644 index 00000000..705a69fa --- /dev/null +++ b/doc/type-aliases/IceState.md @@ -0,0 +1,9 @@ +[**werift**](../README.md) • **Docs** + +*** + +[werift](../globals.md) / IceState + +# Type Alias: IceState + +> **IceState**: `"disconnected"` \| `"closed"` \| `"completed"` \| `"new"` \| `"connected"` diff --git a/doc/variables/CONSENT_FAILURES.md b/doc/variables/CONSENT_FAILURES.md new file mode 100644 index 00000000..1348e319 --- /dev/null +++ b/doc/variables/CONSENT_FAILURES.md @@ -0,0 +1,9 @@ +[**werift**](../README.md) • **Docs** + +*** + +[werift](../globals.md) / CONSENT\_FAILURES + +# Variable: CONSENT\_FAILURES + +> `const` **CONSENT\_FAILURES**: `6` = `6` diff --git a/doc/variables/CONSENT_INTERVAL.md b/doc/variables/CONSENT_INTERVAL.md new file mode 100644 index 00000000..9964033b --- /dev/null +++ b/doc/variables/CONSENT_INTERVAL.md @@ -0,0 +1,9 @@ +[**werift**](../README.md) • **Docs** + +*** + +[werift](../globals.md) / CONSENT\_INTERVAL + +# Variable: CONSENT\_INTERVAL + +> `const` **CONSENT\_INTERVAL**: `5` = `5` diff --git a/doc/variables/ICE_COMPLETED.md b/doc/variables/ICE_COMPLETED.md new file mode 100644 index 00000000..c6409baf --- /dev/null +++ b/doc/variables/ICE_COMPLETED.md @@ -0,0 +1,9 @@ +[**werift**](../README.md) • **Docs** + +*** + +[werift](../globals.md) / ICE\_COMPLETED + +# Variable: ICE\_COMPLETED + +> `const` **ICE\_COMPLETED**: `1` diff --git a/doc/variables/ICE_FAILED.md b/doc/variables/ICE_FAILED.md new file mode 100644 index 00000000..90311b7a --- /dev/null +++ b/doc/variables/ICE_FAILED.md @@ -0,0 +1,9 @@ +[**werift**](../README.md) • **Docs** + +*** + +[werift](../globals.md) / ICE\_FAILED + +# Variable: ICE\_FAILED + +> `const` **ICE\_FAILED**: `2` diff --git a/doc/variables/RTP_EXTENSION_URI.md b/doc/variables/RTP_EXTENSION_URI.md index c9f3a4ad..31ef26a0 100644 --- a/doc/variables/RTP_EXTENSION_URI.md +++ b/doc/variables/RTP_EXTENSION_URI.md @@ -37,3 +37,7 @@ ### transportWideCC > `readonly` **transportWideCC**: `"http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01"` = `"http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01"` + +### videoOrientation + +> `readonly` **videoOrientation**: `"urn:3gpp:video-orientation"` = `"urn:3gpp:video-orientation"` diff --git a/doc/variables/defaultOptions.md b/doc/variables/defaultOptions.md new file mode 100644 index 00000000..9c3cb9dc --- /dev/null +++ b/doc/variables/defaultOptions.md @@ -0,0 +1,9 @@ +[**werift**](../README.md) • **Docs** + +*** + +[werift](../globals.md) / defaultOptions + +# Variable: defaultOptions + +> `const` **defaultOptions**: [`IceOptions`](../interfaces/IceOptions.md) diff --git a/package-lock.json b/package-lock.json index b5810bc6..6e5eff72 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4273,7 +4273,7 @@ }, "packages/dtls": { "name": "werift-dtls", - "version": "0.5.4", + "version": "0.5.5", "license": "MIT", "dependencies": { "@fidm/x509": "^1.2.1", @@ -4294,7 +4294,7 @@ }, "packages/ice": { "name": "werift-ice", - "version": "0.1.1", + "version": "0.2.0", "license": "MIT", "dependencies": { "@shinyoshiaki/jspack": "^0.0.6", @@ -4326,7 +4326,7 @@ }, "packages/rtp": { "name": "werift-rtp", - "version": "0.8.2", + "version": "0.8.3", "license": "MIT", "dependencies": { "@minhducsun2002/leb128": "^1.0.0", @@ -4423,7 +4423,7 @@ }, "packages/webrtc": { "name": "werift", - "version": "0.20.1", + "version": "0.21.0", "license": "MIT", "dependencies": { "@fidm/x509": "^1.2.1", diff --git a/packages/dtls/package.json b/packages/dtls/package.json index 48696f41..9f41a347 100644 --- a/packages/dtls/package.json +++ b/packages/dtls/package.json @@ -1,6 +1,6 @@ { "name": "werift-dtls", - "version": "0.5.4", + "version": "0.5.5", "description": "DTLS protocol implementation for Node.js written in TypeScript.", "homepage": "https://github.com/shinyoshiaki/werift-dtls", "repository": { diff --git a/packages/ice/doc/classes/Candidate.md b/packages/ice/doc/classes/Candidate.md index 0f41f0cb..d7282936 100644 --- a/packages/ice/doc/classes/Candidate.md +++ b/packages/ice/doc/classes/Candidate.md @@ -10,7 +10,7 @@ ### new Candidate() -> **new Candidate**(`foundation`, `component`, `transport`, `priority`, `host`, `port`, `type`, `relatedAddress`?, `relatedPort`?, `tcptype`?, `generation`?): [`Candidate`](Candidate.md) +> **new Candidate**(`foundation`, `component`, `transport`, `priority`, `host`, `port`, `type`, `relatedAddress`?, `relatedPort`?, `tcptype`?, `generation`?, `ufrag`?): [`Candidate`](Candidate.md) #### Parameters @@ -36,6 +36,8 @@ • **generation?**: `number` +• **ufrag?**: `string` + #### Returns [`Candidate`](Candidate.md) @@ -106,6 +108,12 @@ > **type**: `string` +*** + +### ufrag? + +> `optional` **ufrag**: `string` + ## Methods ### canPairWith() diff --git a/packages/ice/doc/classes/CandidatePair.md b/packages/ice/doc/classes/CandidatePair.md index fa05b2fb..382e0aa7 100644 --- a/packages/ice/doc/classes/CandidatePair.md +++ b/packages/ice/doc/classes/CandidatePair.md @@ -10,7 +10,7 @@ ### new CandidatePair() -> **new CandidatePair**(`protocol`, `remoteCandidate`): [`CandidatePair`](CandidatePair.md) +> **new CandidatePair**(`protocol`, `remoteCandidate`, `iceControlling`): [`CandidatePair`](CandidatePair.md) #### Parameters @@ -18,6 +18,8 @@ • **remoteCandidate**: [`Candidate`](Candidate.md) +• **iceControlling**: `boolean` + #### Returns [`CandidatePair`](CandidatePair.md) @@ -26,27 +28,19 @@ ### handle? -> `optional` **handle**: `object` - -#### cancel() - -> **cancel**: () => `void` +> `optional` **handle**: `Cancelable`\<`void`\> -##### Returns - -`void` - -#### done() +*** -> **done**: () => `boolean` +### iceControlling -##### Returns +> **iceControlling**: `boolean` -`boolean` +*** -#### promise +### id -> **promise**: `PCancelable`\<`any`\> = `pCancel` +> `readonly` **id**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` *** @@ -84,6 +78,28 @@ *** +### json + +> `get` **json**(): `object` + +#### Returns + +`object` + +##### localCandidate + +> **localCandidate**: `string` + +##### protocol + +> **protocol**: `string` + +##### remoteCandidate + +> **remoteCandidate**: `string` + +*** + ### localCandidate > `get` **localCandidate**(): [`Candidate`](Candidate.md) @@ -94,6 +110,16 @@ *** +### priority + +> `get` **priority**(): `number` + +#### Returns + +`number` + +*** + ### remoteAddr > `get` **remoteAddr**(): readonly [`string`, `number`] @@ -122,13 +148,17 @@ readonly [`string`, `number`] `object` +##### localCandidate + +> **localCandidate**: `string` + ##### protocol > **protocol**: `string` -##### remoteAddr +##### remoteCandidate -> **remoteAddr**: readonly [`string`, `number`] +> **remoteCandidate**: `string` *** diff --git a/packages/ice/doc/classes/Connection.md b/packages/ice/doc/classes/Connection.md index 41189e84..95e51ad1 100644 --- a/packages/ice/doc/classes/Connection.md +++ b/packages/ice/doc/classes/Connection.md @@ -6,15 +6,19 @@ # Class: Connection +## Implements + +- [`IceConnection`](../interfaces/IceConnection.md) + ## Constructors ### new Connection() -> **new Connection**(`iceControlling`, `options`?): [`Connection`](Connection.md) +> **new Connection**(`_iceControlling`, `options`?): [`Connection`](Connection.md) #### Parameters -• **iceControlling**: `boolean` +• **\_iceControlling**: `boolean` • **options?**: `Partial`\<[`IceOptions`](../interfaces/IceOptions.md)\> @@ -24,27 +28,23 @@ ## Properties -### \_localCandidatesEnd - -> **\_localCandidatesEnd**: `boolean` = `false` +### checkList -*** +> **checkList**: [`CandidatePair`](CandidatePair.md)[] = `[]` -### \_tieBreaker +#### Implementation of -> **\_tieBreaker**: `bigint` +[`IceConnection`](../interfaces/IceConnection.md).[`checkList`](../interfaces/IceConnection.md#checklist) *** -### checkList - -> **checkList**: [`CandidatePair`](CandidatePair.md)[] = `[]` +### generation -*** +> **generation**: `number` = `-1` -### iceControlling +#### Implementation of -> **iceControlling**: `boolean` +[`IceConnection`](../interfaces/IceConnection.md).[`generation`](../interfaces/IceConnection.md#generation) *** @@ -52,17 +52,39 @@ > **localCandidates**: [`Candidate`](Candidate.md)[] = `[]` +#### Implementation of + +[`IceConnection`](../interfaces/IceConnection.md).[`localCandidates`](../interfaces/IceConnection.md#localcandidates) + +*** + +### localCandidatesEnd + +> **localCandidatesEnd**: `boolean` = `false` + +#### Implementation of + +[`IceConnection`](../interfaces/IceConnection.md).[`localCandidatesEnd`](../interfaces/IceConnection.md#localcandidatesend) + *** ### localPassword > **localPassword**: `string` +#### Implementation of + +[`IceConnection`](../interfaces/IceConnection.md).[`localPassword`](../interfaces/IceConnection.md#localpassword) + *** -### localUserName +### localUsername + +> **localUsername**: `string` -> **localUserName**: `string` +#### Implementation of + +[`IceConnection`](../interfaces/IceConnection.md).[`localUsername`](../interfaces/IceConnection.md#localusername) *** @@ -70,17 +92,39 @@ > `optional` **lookup**: `MdnsLookup` +#### Implementation of + +[`IceConnection`](../interfaces/IceConnection.md).[`lookup`](../interfaces/IceConnection.md#lookup) + *** ### nominated? > `optional` **nominated**: [`CandidatePair`](CandidatePair.md) +#### Implementation of + +[`IceConnection`](../interfaces/IceConnection.md).[`nominated`](../interfaces/IceConnection.md#nominated) + *** ### onData -> `readonly` **onData**: `Event`\<[`Buffer`, `number`]\> +> `readonly` **onData**: `Event`\<[`Buffer`]\> + +#### Implementation of + +[`IceConnection`](../interfaces/IceConnection.md).[`onData`](../interfaces/IceConnection.md#ondata) + +*** + +### onIceCandidate + +> `readonly` **onIceCandidate**: `Event`\<[[`Candidate`](Candidate.md)]\> + +#### Implementation of + +[`IceConnection`](../interfaces/IceConnection.md).[`onIceCandidate`](../interfaces/IceConnection.md#onicecandidate) *** @@ -88,47 +132,69 @@ > **options**: [`IceOptions`](../interfaces/IceOptions.md) +#### Implementation of + +[`IceConnection`](../interfaces/IceConnection.md).[`options`](../interfaces/IceConnection.md#options) + *** ### remoteCandidatesEnd > **remoteCandidatesEnd**: `boolean` = `false` +#### Implementation of + +[`IceConnection`](../interfaces/IceConnection.md).[`remoteCandidatesEnd`](../interfaces/IceConnection.md#remotecandidatesend) + *** ### remoteIsLite > **remoteIsLite**: `boolean` = `false` +#### Implementation of + +[`IceConnection`](../interfaces/IceConnection.md).[`remoteIsLite`](../interfaces/IceConnection.md#remoteislite) + *** ### remotePassword > **remotePassword**: `string` = `""` +#### Implementation of + +[`IceConnection`](../interfaces/IceConnection.md).[`remotePassword`](../interfaces/IceConnection.md#remotepassword) + *** ### remoteUsername > **remoteUsername**: `string` = `""` -*** - -### restarted +#### Implementation of -> **restarted**: `boolean` = `false` +[`IceConnection`](../interfaces/IceConnection.md).[`remoteUsername`](../interfaces/IceConnection.md#remoteusername) *** ### state -> **state**: `IceState` = `"new"` +> **state**: [`IceState`](../type-aliases/IceState.md) = `"new"` + +#### Implementation of + +[`IceConnection`](../interfaces/IceConnection.md).[`state`](../interfaces/IceConnection.md#state) *** ### stateChanged -> `readonly` **stateChanged**: `Event`\<[`IceState`]\> +> `readonly` **stateChanged**: `Event`\<[[`IceState`](../type-aliases/IceState.md)]\> + +#### Implementation of + +[`IceConnection`](../interfaces/IceConnection.md).[`stateChanged`](../interfaces/IceConnection.md#statechanged) *** @@ -136,26 +202,52 @@ > `optional` **stunServer**: readonly [`string`, `number`] +#### Implementation of + +[`IceConnection`](../interfaces/IceConnection.md).[`stunServer`](../interfaces/IceConnection.md#stunserver) + *** ### turnServer? > `optional` **turnServer**: readonly [`string`, `number`] -*** - -### useIpv4 +#### Implementation of -> **useIpv4**: `boolean` +[`IceConnection`](../interfaces/IceConnection.md).[`turnServer`](../interfaces/IceConnection.md#turnserver) *** -### useIpv6 +### userHistory + +> **userHistory**: `object` = `{}` -> **useIpv6**: `boolean` +#### Index Signature + + \[`username`: `string`\]: `string` ## Accessors +### iceControlling + +> `get` **iceControlling**(): `boolean` + +> `set` **iceControlling**(`value`): `void` + +#### Parameters + +• **value**: `boolean` + +#### Returns + +`boolean` + +#### Implementation of + +[`IceConnection`](../interfaces/IceConnection.md).[`iceControlling`](../interfaces/IceConnection.md#icecontrolling) + +*** + ### remoteCandidates > `get` **remoteCandidates**(): [`Candidate`](Candidate.md)[] @@ -184,6 +276,10 @@ `Promise`\<`void`\> +#### Implementation of + +[`IceConnection`](../interfaces/IceConnection.md).[`addRemoteCandidate`](../interfaces/IceConnection.md#addremotecandidate) + *** ### checkIncoming() @@ -206,7 +302,7 @@ ### checkStart() -> **checkStart**(`pair`): `PCancelable`\<`unknown`\> +> **checkStart**(`pair`): `object` #### Parameters @@ -214,7 +310,35 @@ #### Returns -`PCancelable`\<`unknown`\> +`object` + +##### awaitable + +> **awaitable**: `Promise`\<`void`\> = `p` + +##### reject() + +> **reject**: (`reason`?) => `void` + +###### Parameters + +• **reason?**: `any` + +###### Returns + +`void` + +##### resolve() + +> **resolve**: (`value`) => `void` + +###### Parameters + +• **value**: `void` \| `PromiseLike`\<`void`\> + +###### Returns + +`void` *** @@ -226,6 +350,10 @@ `Promise`\<`void`\> +#### Implementation of + +[`IceConnection`](../interfaces/IceConnection.md).[`close`](../interfaces/IceConnection.md#close) + *** ### connect() @@ -236,36 +364,24 @@ `Promise`\<`void`\> -*** - -### dataReceived() - -> **dataReceived**(`data`, `component`): `void` - -#### Parameters - -• **data**: `Buffer` - -• **component**: `number` - -#### Returns +#### Implementation of -`void` +[`IceConnection`](../interfaces/IceConnection.md).[`connect`](../interfaces/IceConnection.md#connect) *** ### gatherCandidates() -> **gatherCandidates**(`cb`?): `Promise`\<`void`\> - -#### Parameters - -• **cb?** +> **gatherCandidates**(): `Promise`\<`void`\> #### Returns `Promise`\<`void`\> +#### Implementation of + +[`IceConnection`](../interfaces/IceConnection.md).[`gatherCandidates`](../interfaces/IceConnection.md#gathercandidates) + *** ### getDefaultCandidate() @@ -276,35 +392,37 @@ [`Candidate`](Candidate.md) -*** - -### requestReceived() - -> **requestReceived**(`message`, `addr`, `protocol`, `rawData`): `void` +#### Implementation of -#### Parameters - -• **message**: [`Message`](Message.md) +[`IceConnection`](../interfaces/IceConnection.md).[`getDefaultCandidate`](../interfaces/IceConnection.md#getdefaultcandidate) -• **addr**: readonly [`string`, `number`] +*** -• **protocol**: [`Protocol`](../interfaces/Protocol.md) +### resetNominatedPair() -• **rawData**: `Buffer` +> **resetNominatedPair**(): `void` #### Returns `void` +#### Implementation of + +[`IceConnection`](../interfaces/IceConnection.md).[`resetNominatedPair`](../interfaces/IceConnection.md#resetnominatedpair) + *** -### resetNominatedPair() +### restart() -> **resetNominatedPair**(): `void` +> **restart**(): `Promise`\<`void`\> #### Returns -`void` +`Promise`\<`void`\> + +#### Implementation of + +[`IceConnection`](../interfaces/IceConnection.md).[`restart`](../interfaces/IceConnection.md#restart) *** @@ -320,6 +438,10 @@ `Promise`\<`void`\> +#### Implementation of + +[`IceConnection`](../interfaces/IceConnection.md).[`send`](../interfaces/IceConnection.md#send) + *** ### setRemoteParams() @@ -339,3 +461,7 @@ #### Returns `void` + +#### Implementation of + +[`IceConnection`](../interfaces/IceConnection.md).[`setRemoteParams`](../interfaces/IceConnection.md#setremoteparams) diff --git a/packages/ice/doc/classes/Message.md b/packages/ice/doc/classes/Message.md index 0355ef93..7cea16cb 100644 --- a/packages/ice/doc/classes/Message.md +++ b/packages/ice/doc/classes/Message.md @@ -88,6 +88,28 @@ *** +### json + +> `get` **json**(): `object` + +#### Returns + +`object` + +##### attributes + +> **attributes**: `AttributePair`[] + +##### messageClass + +> **messageClass**: `string` + +##### messageMethod + +> **messageMethod**: `string` + +*** + ### transactionIdHex > `get` **transactionIdHex**(): `string` @@ -210,6 +232,10 @@ `object` +##### attributes + +> **attributes**: `AttributePair`[] + ##### messageClass > **messageClass**: `string` diff --git a/packages/ice/doc/classes/StunOverTurnProtocol.md b/packages/ice/doc/classes/StunOverTurnProtocol.md index 6e90920b..30228ec8 100644 --- a/packages/ice/doc/classes/StunOverTurnProtocol.md +++ b/packages/ice/doc/classes/StunOverTurnProtocol.md @@ -14,14 +14,12 @@ ### new StunOverTurnProtocol() -> **new StunOverTurnProtocol**(`turn`, `ice`): [`StunOverTurnProtocol`](StunOverTurnProtocol.md) +> **new StunOverTurnProtocol**(`turn`): [`StunOverTurnProtocol`](StunOverTurnProtocol.md) #### Parameters • **turn**: [`TurnProtocol`](TurnProtocol.md) -• **ice**: [`Connection`](Connection.md) - #### Returns [`StunOverTurnProtocol`](StunOverTurnProtocol.md) @@ -38,6 +36,26 @@ *** +### onDataReceived + +> **onDataReceived**: `Event`\<[`Buffer`]\> + +#### Implementation of + +[`Protocol`](../interfaces/Protocol.md).[`onDataReceived`](../interfaces/Protocol.md#ondatareceived) + +*** + +### onRequestReceived + +> **onRequestReceived**: `Event`\<[[`Message`](Message.md), readonly [`string`, `number`], `Buffer`]\> + +#### Implementation of + +[`Protocol`](../interfaces/Protocol.md).[`onRequestReceived`](../interfaces/Protocol.md#onrequestreceived) + +*** + ### turn > **turn**: [`TurnProtocol`](TurnProtocol.md) diff --git a/packages/ice/doc/classes/StunProtocol.md b/packages/ice/doc/classes/StunProtocol.md index a022ba23..ddd8b25b 100644 --- a/packages/ice/doc/classes/StunProtocol.md +++ b/packages/ice/doc/classes/StunProtocol.md @@ -14,11 +14,7 @@ ### new StunProtocol() -> **new StunProtocol**(`receiver`?): [`StunProtocol`](StunProtocol.md) - -#### Parameters - -• **receiver?**: [`Connection`](Connection.md) +> **new StunProtocol**(): [`StunProtocol`](StunProtocol.md) #### Returns @@ -26,25 +22,43 @@ ## Properties -### localAddress? +### localCandidate? + +> `optional` **localCandidate**: [`Candidate`](Candidate.md) -> `optional` **localAddress**: `string` +#### Implementation of + +[`Protocol`](../interfaces/Protocol.md).[`localCandidate`](../interfaces/Protocol.md#localcandidate) *** -### localCandidate? +### localIp? -> `optional` **localCandidate**: [`Candidate`](Candidate.md) +> `optional` **localIp**: `string` #### Implementation of -[`Protocol`](../interfaces/Protocol.md).[`localCandidate`](../interfaces/Protocol.md#localcandidate) +[`Protocol`](../interfaces/Protocol.md).[`localIp`](../interfaces/Protocol.md#localip) *** -### receiver? +### onDataReceived + +> `readonly` **onDataReceived**: `Event`\<[`Buffer`]\> + +#### Implementation of -> `optional` **receiver**: [`Connection`](Connection.md) +[`Protocol`](../interfaces/Protocol.md).[`onDataReceived`](../interfaces/Protocol.md#ondatareceived) + +*** + +### onRequestReceived + +> `readonly` **onRequestReceived**: `Event`\<[[`Message`](Message.md), readonly [`string`, `number`], `Buffer`]\> + +#### Implementation of + +[`Protocol`](../interfaces/Protocol.md).[`onRequestReceived`](../interfaces/Protocol.md#onrequestreceived) *** @@ -114,16 +128,6 @@ *** -### connectionLost() - -> **connectionLost**(): `void` - -#### Returns - -`void` - -*** - ### connectionMade() > **connectionMade**(`useIpv4`, `portRange`?, `interfaceAddresses`?): `Promise`\<`void`\> diff --git a/packages/ice/doc/classes/TurnProtocol.md b/packages/ice/doc/classes/TurnProtocol.md index 59a43463..435ee43a 100644 --- a/packages/ice/doc/classes/TurnProtocol.md +++ b/packages/ice/doc/classes/TurnProtocol.md @@ -80,6 +80,26 @@ sec *** +### onDataReceived + +> **onDataReceived**: `Event`\<[`Buffer`]\> + +#### Implementation of + +[`Protocol`](../interfaces/Protocol.md).[`onDataReceived`](../interfaces/Protocol.md#ondatareceived) + +*** + +### onRequestReceived + +> **onRequestReceived**: `Event`\<[[`Message`](Message.md), readonly [`string`, `number`], `Buffer`]\> + +#### Implementation of + +[`Protocol`](../interfaces/Protocol.md).[`onRequestReceived`](../interfaces/Protocol.md#onrequestreceived) + +*** + ### options > **options**: `object` = `{}` diff --git a/packages/ice/doc/functions/createStunOverTurnClient.md b/packages/ice/doc/functions/createStunOverTurnClient.md index 42dcf86d..932441ea 100644 --- a/packages/ice/doc/functions/createStunOverTurnClient.md +++ b/packages/ice/doc/functions/createStunOverTurnClient.md @@ -14,8 +14,6 @@ • **\_\_namedParameters.address**: readonly [`string`, `number`] -• **\_\_namedParameters.ice**: [`Connection`](../classes/Connection.md) - • **\_\_namedParameters.password**: `string` • **\_\_namedParameters.username**: `string` diff --git a/packages/ice/doc/globals.md b/packages/ice/doc/globals.md index c5ad23d0..762cd983 100644 --- a/packages/ice/doc/globals.md +++ b/packages/ice/doc/globals.md @@ -24,6 +24,7 @@ ## Interfaces +- [IceConnection](interfaces/IceConnection.md) - [IceOptions](interfaces/IceOptions.md) - [Protocol](interfaces/Protocol.md) - [Transport](interfaces/Transport.md) @@ -33,19 +34,25 @@ ## Type Aliases - [Address](type-aliases/Address.md) +- [IceState](type-aliases/IceState.md) ## Variables - [AttributeKeys](variables/AttributeKeys.md) +- [CONSENT\_FAILURES](variables/CONSENT_FAILURES.md) +- [CONSENT\_INTERVAL](variables/CONSENT_INTERVAL.md) - [COOKIE](variables/COOKIE.md) - [FINGERPRINT\_LENGTH](variables/FINGERPRINT_LENGTH.md) - [FINGERPRINT\_XOR](variables/FINGERPRINT_XOR.md) - [HEADER\_LENGTH](variables/HEADER_LENGTH.md) +- [ICE\_COMPLETED](variables/ICE_COMPLETED.md) +- [ICE\_FAILED](variables/ICE_FAILED.md) - [INTEGRITY\_LENGTH](variables/INTEGRITY_LENGTH.md) - [IPV4\_PROTOCOL](variables/IPV4_PROTOCOL.md) - [IPV6\_PROTOCOL](variables/IPV6_PROTOCOL.md) - [RETRY\_MAX](variables/RETRY_MAX.md) - [RETRY\_RTO](variables/RETRY_RTO.md) +- [defaultOptions](variables/defaultOptions.md) ## Functions diff --git a/packages/ice/doc/interfaces/IceConnection.md b/packages/ice/doc/interfaces/IceConnection.md new file mode 100644 index 00000000..97ad4865 --- /dev/null +++ b/packages/ice/doc/interfaces/IceConnection.md @@ -0,0 +1,235 @@ +[**werift-ice**](../README.md) • **Docs** + +*** + +[werift-ice](../globals.md) / IceConnection + +# Interface: IceConnection + +## Properties + +### checkList + +> **checkList**: [`CandidatePair`](../classes/CandidatePair.md)[] + +*** + +### generation + +> **generation**: `number` + +*** + +### iceControlling + +> **iceControlling**: `boolean` + +*** + +### localCandidates + +> **localCandidates**: [`Candidate`](../classes/Candidate.md)[] + +*** + +### localCandidatesEnd + +> **localCandidatesEnd**: `boolean` + +*** + +### localPassword + +> **localPassword**: `string` + +*** + +### localUsername + +> **localUsername**: `string` + +*** + +### lookup? + +> `optional` **lookup**: `MdnsLookup` + +*** + +### nominated? + +> `optional` **nominated**: [`CandidatePair`](../classes/CandidatePair.md) + +*** + +### onData + +> `readonly` **onData**: `Event`\<[`Buffer`]\> + +*** + +### onIceCandidate + +> `readonly` **onIceCandidate**: `Event`\<[[`Candidate`](../classes/Candidate.md)]\> + +*** + +### options + +> **options**: [`IceOptions`](IceOptions.md) + +*** + +### remoteCandidatesEnd + +> **remoteCandidatesEnd**: `boolean` + +*** + +### remoteIsLite + +> **remoteIsLite**: `boolean` + +*** + +### remotePassword + +> **remotePassword**: `string` + +*** + +### remoteUsername + +> **remoteUsername**: `string` + +*** + +### state + +> **state**: [`IceState`](../type-aliases/IceState.md) + +*** + +### stateChanged + +> `readonly` **stateChanged**: `Event`\<[[`IceState`](../type-aliases/IceState.md)]\> + +*** + +### stunServer? + +> `optional` **stunServer**: readonly [`string`, `number`] + +*** + +### turnServer? + +> `optional` **turnServer**: readonly [`string`, `number`] + +## Methods + +### addRemoteCandidate() + +> **addRemoteCandidate**(`remoteCandidate`): `Promise`\<`void`\> + +#### Parameters + +• **remoteCandidate**: `undefined` \| [`Candidate`](../classes/Candidate.md) + +#### Returns + +`Promise`\<`void`\> + +*** + +### close() + +> **close**(): `Promise`\<`void`\> + +#### Returns + +`Promise`\<`void`\> + +*** + +### connect() + +> **connect**(): `Promise`\<`void`\> + +#### Returns + +`Promise`\<`void`\> + +*** + +### gatherCandidates() + +> **gatherCandidates**(): `Promise`\<`void`\> + +#### Returns + +`Promise`\<`void`\> + +*** + +### getDefaultCandidate() + +> **getDefaultCandidate**(): `undefined` \| [`Candidate`](../classes/Candidate.md) + +#### Returns + +`undefined` \| [`Candidate`](../classes/Candidate.md) + +*** + +### resetNominatedPair() + +> **resetNominatedPair**(): `void` + +#### Returns + +`void` + +*** + +### restart() + +> **restart**(): `void` + +#### Returns + +`void` + +*** + +### send() + +> **send**(`data`): `Promise`\<`void`\> + +#### Parameters + +• **data**: `Buffer` + +#### Returns + +`Promise`\<`void`\> + +*** + +### setRemoteParams() + +> **setRemoteParams**(`params`): `void` + +#### Parameters + +• **params** + +• **params.iceLite**: `boolean` + +• **params.password**: `string` + +• **params.usernameFragment**: `string` + +#### Returns + +`void` diff --git a/packages/ice/doc/interfaces/IceOptions.md b/packages/ice/doc/interfaces/IceOptions.md index 1545c7c3..bda9420d 100644 --- a/packages/ice/doc/interfaces/IceOptions.md +++ b/packages/ice/doc/interfaces/IceOptions.md @@ -58,6 +58,12 @@ *** +### localPasswordPrefix? + +> `optional` **localPasswordPrefix**: `string` + +*** + ### portRange? > `optional` **portRange**: [`number`, `number`] diff --git a/packages/ice/doc/interfaces/Protocol.md b/packages/ice/doc/interfaces/Protocol.md index 7bef6be0..3767d33b 100644 --- a/packages/ice/doc/interfaces/Protocol.md +++ b/packages/ice/doc/interfaces/Protocol.md @@ -38,6 +38,24 @@ *** +### localIp? + +> `optional` **localIp**: `string` + +*** + +### onDataReceived + +> **onDataReceived**: `Event`\<[`Buffer`]\> + +*** + +### onRequestReceived + +> **onRequestReceived**: `Event`\<[[`Message`](../classes/Message.md), readonly [`string`, `number`], `Buffer`]\> + +*** + ### request() > **request**: (`message`, `addr`, `integrityKey`?, `retransmissions`?) => `Promise`\<[[`Message`](../classes/Message.md), readonly [`string`, `number`]]\> diff --git a/packages/ice/doc/type-aliases/IceState.md b/packages/ice/doc/type-aliases/IceState.md new file mode 100644 index 00000000..f71b5015 --- /dev/null +++ b/packages/ice/doc/type-aliases/IceState.md @@ -0,0 +1,9 @@ +[**werift-ice**](../README.md) • **Docs** + +*** + +[werift-ice](../globals.md) / IceState + +# Type Alias: IceState + +> **IceState**: `"disconnected"` \| `"closed"` \| `"completed"` \| `"new"` \| `"connected"` diff --git a/packages/ice/doc/variables/CONSENT_FAILURES.md b/packages/ice/doc/variables/CONSENT_FAILURES.md new file mode 100644 index 00000000..51b5b08c --- /dev/null +++ b/packages/ice/doc/variables/CONSENT_FAILURES.md @@ -0,0 +1,9 @@ +[**werift-ice**](../README.md) • **Docs** + +*** + +[werift-ice](../globals.md) / CONSENT\_FAILURES + +# Variable: CONSENT\_FAILURES + +> `const` **CONSENT\_FAILURES**: `6` = `6` diff --git a/packages/ice/doc/variables/CONSENT_INTERVAL.md b/packages/ice/doc/variables/CONSENT_INTERVAL.md new file mode 100644 index 00000000..dda96d38 --- /dev/null +++ b/packages/ice/doc/variables/CONSENT_INTERVAL.md @@ -0,0 +1,9 @@ +[**werift-ice**](../README.md) • **Docs** + +*** + +[werift-ice](../globals.md) / CONSENT\_INTERVAL + +# Variable: CONSENT\_INTERVAL + +> `const` **CONSENT\_INTERVAL**: `5` = `5` diff --git a/packages/ice/doc/variables/ICE_COMPLETED.md b/packages/ice/doc/variables/ICE_COMPLETED.md new file mode 100644 index 00000000..3ed22145 --- /dev/null +++ b/packages/ice/doc/variables/ICE_COMPLETED.md @@ -0,0 +1,9 @@ +[**werift-ice**](../README.md) • **Docs** + +*** + +[werift-ice](../globals.md) / ICE\_COMPLETED + +# Variable: ICE\_COMPLETED + +> `const` **ICE\_COMPLETED**: `1` diff --git a/packages/ice/doc/variables/ICE_FAILED.md b/packages/ice/doc/variables/ICE_FAILED.md new file mode 100644 index 00000000..92f284da --- /dev/null +++ b/packages/ice/doc/variables/ICE_FAILED.md @@ -0,0 +1,9 @@ +[**werift-ice**](../README.md) • **Docs** + +*** + +[werift-ice](../globals.md) / ICE\_FAILED + +# Variable: ICE\_FAILED + +> `const` **ICE\_FAILED**: `2` diff --git a/packages/ice/doc/variables/defaultOptions.md b/packages/ice/doc/variables/defaultOptions.md new file mode 100644 index 00000000..c8eb8844 --- /dev/null +++ b/packages/ice/doc/variables/defaultOptions.md @@ -0,0 +1,9 @@ +[**werift-ice**](../README.md) • **Docs** + +*** + +[werift-ice](../globals.md) / defaultOptions + +# Variable: defaultOptions + +> `const` **defaultOptions**: [`IceOptions`](../interfaces/IceOptions.md) diff --git a/packages/ice/package.json b/packages/ice/package.json index 11368d9a..4c1c7749 100644 --- a/packages/ice/package.json +++ b/packages/ice/package.json @@ -1,6 +1,6 @@ { "name": "werift-ice", - "version": "0.1.1", + "version": "0.2.0", "description": "ICE(Interactive Connectivity Establishment) Implementation for TypeScript (Node.js)", "homepage": "https://github.com/shinyoshiaki/werift-webrtc/tree/master/packages/ice#readme", "bugs": { diff --git a/packages/rtp/doc/functions/deserializeVideoOrientation.md b/packages/rtp/doc/functions/deserializeVideoOrientation.md new file mode 100644 index 00000000..e4037147 --- /dev/null +++ b/packages/rtp/doc/functions/deserializeVideoOrientation.md @@ -0,0 +1,17 @@ +[**werift-rtp**](../README.md) • **Docs** + +*** + +[werift-rtp](../globals.md) / deserializeVideoOrientation + +# Function: deserializeVideoOrientation() + +> **deserializeVideoOrientation**(`payload`): [`videoOrientationPayload`](../interfaces/videoOrientationPayload.md) + +## Parameters + +• **payload**: `Buffer` + +## Returns + +[`videoOrientationPayload`](../interfaces/videoOrientationPayload.md) diff --git a/packages/rtp/doc/functions/rtpHeaderExtensionsParser.md b/packages/rtp/doc/functions/rtpHeaderExtensionsParser.md index a21088a8..13072e93 100644 --- a/packages/rtp/doc/functions/rtpHeaderExtensionsParser.md +++ b/packages/rtp/doc/functions/rtpHeaderExtensionsParser.md @@ -6,7 +6,7 @@ # Function: rtpHeaderExtensionsParser() -> **rtpHeaderExtensionsParser**(`extensions`, `extIdUriMap`): `object` +> **rtpHeaderExtensionsParser**(`extensions`, `extIdUriMap`): [`Extensions`](../interfaces/Extensions.md) ## Parameters @@ -16,4 +16,4 @@ ## Returns -`object` +[`Extensions`](../interfaces/Extensions.md) diff --git a/packages/rtp/doc/globals.md b/packages/rtp/doc/globals.md index 8d0838d4..bf34a81d 100644 --- a/packages/rtp/doc/globals.md +++ b/packages/rtp/doc/globals.md @@ -55,6 +55,11 @@ - [Vp9RtpPayload](classes/Vp9RtpPayload.md) - [WeriftError](classes/WeriftError.md) +## Interfaces + +- [Extensions](interfaces/Extensions.md) +- [videoOrientationPayload](interfaces/videoOrientationPayload.md) + ## Type Aliases - [AudioLevelIndicationPayload](type-aliases/AudioLevelIndicationPayload.md) @@ -89,6 +94,7 @@ - [deserializeAudioLevelIndication](functions/deserializeAudioLevelIndication.md) - [deserializeString](functions/deserializeString.md) - [deserializeUint16BE](functions/deserializeUint16BE.md) +- [deserializeVideoOrientation](functions/deserializeVideoOrientation.md) - [dumpBuffer](functions/dumpBuffer.md) - [enumerate](functions/enumerate.md) - [findPort](functions/findPort.md) diff --git a/packages/rtp/doc/interfaces/Extensions.md b/packages/rtp/doc/interfaces/Extensions.md new file mode 100644 index 00000000..308ccbc9 --- /dev/null +++ b/packages/rtp/doc/interfaces/Extensions.md @@ -0,0 +1,11 @@ +[**werift-rtp**](../README.md) • **Docs** + +*** + +[werift-rtp](../globals.md) / Extensions + +# Interface: Extensions + +## Indexable + + \[`uri`: `string`\]: `any` diff --git a/packages/rtp/doc/interfaces/videoOrientationPayload.md b/packages/rtp/doc/interfaces/videoOrientationPayload.md new file mode 100644 index 00000000..1857a05b --- /dev/null +++ b/packages/rtp/doc/interfaces/videoOrientationPayload.md @@ -0,0 +1,60 @@ +[**werift-rtp**](../README.md) • **Docs** + +*** + +[werift-rtp](../globals.md) / videoOrientationPayload + +# Interface: videoOrientationPayload + +## Properties + +### c + +> **c**: `number` + +Camera: indicates the direction of the camera used for this video stream. It can be used by the MTSI client in +receiver to e.g. display the received video differently depending on the source camera. +0: Front-facing camera, facing the user. If camera direction is unknown by the sending MTSI client in the terminal +then this is the default value used. +1: Back-facing camera, facing away from the user. + +*** + +### f + +> **f**: `number` + +F = Flip: indicates a horizontal (left-right flip) mirror operation on the video as sent on the link. +0: No flip operation. If the sending MTSI client in terminal does not know if a horizontal mirror operation is +necessary, then this is the default value used. +1: Horizontal flip operation + +*** + +### r0 + +> **r0**: `number` + +*** + +### r1 + +> **r1**: `number` + +R1, R0 = Rotation: indicates the rotation of the video as transmitted on the link. The receiver should rotate the video to +compensate that rotation. E.g. a 90° Counter Clockwise rotation should be compensated by the receiver with a 90° +Clockwise rotation prior to displaying. + + +----+----+-----------------------------------------------+------------------------------+ +| R1 | R0 | Rotation of the video as sent on the link | Rotation on the receiver | +| | | | before display | ++----+----+-----------------------------------------------+------------------------------+ +| 0 | 0 | 0° rotation | None | ++----+----+-----------------------------------------------+------------------------------+ +| 0 | 1 | 90° Counter Clockwise (CCW) rotation or 270° | 90° Clockwise (CW) rotation | +| | | Clockwise (CW) rotation | | ++----+----+-----------------------------------------------+------------------------------+ +| 1 | 0 | 180° CCW rotation or 180° CW rotation | 180° CW rotation | ++----+----+-----------------------------------------------+------------------------------+ +| 1 | 1 | 270° CCW rotation or 90° CW rotation | 90° CCW rotation | ++----+----+-----------------------------------------------+------------------------------+ diff --git a/packages/rtp/doc/variables/RTP_EXTENSION_URI.md b/packages/rtp/doc/variables/RTP_EXTENSION_URI.md index 4e138fe9..8cba900f 100644 --- a/packages/rtp/doc/variables/RTP_EXTENSION_URI.md +++ b/packages/rtp/doc/variables/RTP_EXTENSION_URI.md @@ -37,3 +37,7 @@ ### transportWideCC > `readonly` **transportWideCC**: `"http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01"` = `"http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01"` + +### videoOrientation + +> `readonly` **videoOrientation**: `"urn:3gpp:video-orientation"` = `"urn:3gpp:video-orientation"` diff --git a/packages/rtp/package.json b/packages/rtp/package.json index 42a0bd52..2efc0aef 100644 --- a/packages/rtp/package.json +++ b/packages/rtp/package.json @@ -1,6 +1,6 @@ { "name": "werift-rtp", - "version": "0.8.2", + "version": "0.8.3", "description": "RTP,RTCP,SRTP,SRTCP implementation for TypeScript.", "homepage": "https://github.com/shinyoshiaki/werift-webrtc", "repository": { diff --git a/packages/webrtc/package.json b/packages/webrtc/package.json index e495a50f..34490e69 100644 --- a/packages/webrtc/package.json +++ b/packages/webrtc/package.json @@ -1,6 +1,6 @@ { "name": "werift", - "version": "0.20.1", + "version": "0.21.0", "description": "WebRTC Implementation for TypeScript (Node.js)", "keywords": [ "WebRTC",