Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

Commit 2e958dd

Browse files
committed
Add configuration for WebTransport.
1 parent 99f85b0 commit 2e958dd

File tree

2 files changed

+21
-9
lines changed

2 files changed

+21
-9
lines changed

src/sdk/conference/client.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,24 @@ class ConferenceClientConfiguration { // eslint-disable-line no-unused-vars
8080
* }
8181
*/
8282
this.rtcConfiguration = undefined;
83+
84+
/**
85+
* @member {?WebTransportOptions} webTransportConfiguration
86+
* @instance
87+
* @memberof Owt.Conference.ConferenceClientConfiguration
88+
* @desc It will be used for creating WebTransport.
89+
* @see {@link https://w3c.github.io/webtransport/#dictdef-webtransportoptions|WebTransportOptions of WebTransport}.
90+
* @example
91+
* // Following object can be set to conferenceClientConfiguration.webTransportConfiguration.
92+
* {
93+
* serverCertificateFingerprints: [{
94+
* value:
95+
* '00:11:22:33:44:55:66:77:88:99:AA:BB:CC:DD:EE:FF:00:11:22:33:44:55:66:77:88:99:AA:BB:CC:DD:EE:FF', // eslint-disable-line
96+
* algorithm: 'sha-256',
97+
* }],
98+
* }
99+
*/
100+
this.webTransportConfiguration = undefined;
83101
}
84102
}
85103

@@ -401,7 +419,7 @@ export const ConferenceClient = function(config, signalingImpl) {
401419
if (QuicConnection && token.webTransportUrl) {
402420
quicTransportChannel = new QuicConnection(
403421
token.webTransportUrl, resp.webTransportToken,
404-
createSignalingForChannel());
422+
createSignalingForChannel(), config.webTransportConfiguration);
405423
}
406424
resolve(new ConferenceInfo(resp.room.id, Array.from(participants
407425
.values()), Array.from(remoteStreams.values()), me));

src/sdk/conference/quicconnection.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,13 @@ import {Base64} from '../base/base64.js';
2323
export class QuicConnection extends EventDispatcher {
2424
// `tokenString` is a base64 string of the token object. It's in the return
2525
// value of `ConferenceClient.join`.
26-
constructor(url, tokenString, signaling) {
26+
constructor(url, tokenString, signaling, webTransportOptions) {
2727
super();
2828
this._token = JSON.parse(Base64.decodeBase64(tokenString));
2929
this._signaling = signaling;
3030
this._ended = false;
3131
this._quicStreams = new Map(); // Key is publication or subscription ID.
32-
this._quicTransport = new QuicTransport(url, {
33-
serverCertificateFingerprints: [{
34-
value:
35-
'25:47:DA:10:A0:5B:BF:AE:61:A5:C0:53:BB:2E:9C:2C:80:B5:B9:6A:16:2C:97:0A:F2:A4:86:33:3F:02:FF:6A', // eslint-disable-line
36-
algorithm: 'sha-256',
37-
}],
38-
});
32+
this._quicTransport = new QuicTransport(url, webTransportOptions);
3933
this._subscribePromises = new Map(); // Key is subscription ID.
4034
this._transportId = this._token.transportId;
4135
this._init();

0 commit comments

Comments
 (0)