SFrame library
Create a new SFrame client context.
This method will create client which communicates with web worker in which the SFrame context will be executed.
senderId
Number Numeric id for this sender.config
Object Congiguration parameters [Optional].config.skipVp8PayloadHeader
Boolean Sends the vp8 payload header in clear (Note: it will be applied to all video frames as encoded chunks does not contain codec info yet).
Returns Promise<Client> Promise that resolves to the client object when the web worker is initialized.
Extends EventTarget
The SFrame client object which acts as a proxy for web worker context.
Set the sender encryption key.
key
(ArrayBuffer | Uint8Array | CryptoKey) 32 bytes encryption key. If the value is a CryptoKey the algorithm must be "HKDF".
Returns Promise<void> Promise which will be resolved when the key is set on the web worker.
Ratchert the sender encryption key.
Returns Promise<void> Promise which will be resolved when the key is ratcheted on the web worker.
Set the sender signing key.
key
(ArrayBuffer | Uint8Array | CryptoKey) Private key used for singing. If the value is a CryptoKey the algorithm must be "ECDSA".
Returns Promise<void> Promise which will be resolved when the signing key is set on the web worker.
Add receiver for a remote sender.
receiverkKeyId
Number The remote senderId.
Returns Promise<void> Promise which will be resolved when the receiver is added on the web worker.
Set the receiver encryption key associated to a remote sender.
receiverkKeyId
Number The remote senderId.key
(ArrayBuffer | Uint8Array | CryptoKey) 32 bytes encryption key. If the value is a CryptoKey the algorithm must be "HKDF".
Returns Promise<void> Promise which will be resolved when the key is set on the web worker.
Set the receiver signing key associated to a remote sender.
receiverkKeyId
Number The remote senderId.key
(ArrayBuffer | Uint8Array | CryptoKey) Private key used for singing. If the value is a CryptoKey the algorithm must be "ECDSA".
Returns Promise<void> Promise which will be resolved when the signing key is set on the web worker.
Remove receiver for a remote sender.
receiverkKeyId
Number The remote senderId.
Returns Promise<void> Promise which will be resolved when the receiver is removed on the web worker.
Encrypt frames for a RTCRtpSender.
id
String An unique identifier associated to this sender (for example transceiver.mid).sender
RTCRtpSender The sender object, associated track must be not null.
Decrypt frames fpr a RTCPRtpReceiver.
id
String An unique identifier associated to this sender (for example transceiver.mid), it will be used for the authentication and signing events.receiver
RTCRtpReceiver The receiver object.
Close client and terminate web worker.