Skip to content

fix(streaming): ICE trickle serialisation, kind propagation, DataChan…#164

Draft
imaTik0 wants to merge 1 commit intorefactor/layer-boundariesfrom
fix/streaming-protocol
Draft

fix(streaming): ICE trickle serialisation, kind propagation, DataChan…#164
imaTik0 wants to merge 1 commit intorefactor/layer-boundariesfrom
fix/streaming-protocol

Conversation

@imaTik0
Copy link
Copy Markdown
Member

@imaTik0 imaTik0 commented Apr 17, 2026

…nelCryptor

ICE trickle candidate serialisation (StreamApiNative):

  • Replace JSON.stringify(candidate) with serializeCandidate() which explicitly reads all 15 RTCIceCandidate fields; toJSON() only emits 4 fields causing bridge-side parse failures for candidates with extension fields

RTCRtpScriptTransform kind propagation (WebRtcClient):

  • Pass kind: track.kind to every encode/decode transform option so the worker selects the correct header-size table (audio=1B, video key=10B, delta=3B) instead of always defaulting to video; fixes silent audio encryption

DataChannelCryptor:

  • Use getEncryptionExternalKeyId() for the wire key ID and resolveKeyId() when passing to CryptoFacade; separates wire format from internal registry key
  • Extract GCM_TAG_LENGTH_BYTES = 16 named constant (was magic number)
  • Move Logger to class field (avoids per-call allocation)
  • Rename keyId → externalKeyId throughout for clarity
  • Add JSDoc on encrypt/decryptFromWireFormat

…nelCryptor

ICE trickle candidate serialisation (StreamApiNative):
- Replace JSON.stringify(candidate) with serializeCandidate() which explicitly
  reads all 15 RTCIceCandidate fields; toJSON() only emits 4 fields causing
  bridge-side parse failures for candidates with extension fields

RTCRtpScriptTransform kind propagation (WebRtcClient):
- Pass kind: track.kind to every encode/decode transform option so the worker
  selects the correct header-size table (audio=1B, video key=10B, delta=3B)
  instead of always defaulting to video; fixes silent audio encryption

DataChannelCryptor:
- Use getEncryptionExternalKeyId() for the wire key ID and resolveKeyId() when
  passing to CryptoFacade; separates wire format from internal registry key
- Extract GCM_TAG_LENGTH_BYTES = 16 named constant (was magic number)
- Move Logger to class field (avoids per-call allocation)
- Rename keyId → externalKeyId throughout for clarity
- Add JSDoc on encrypt/decryptFromWireFormat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant