mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-11-20 03:25:52 +01:00
we can assume setConfiguration is available
This commit is contained in:
parent
d36b9be24f
commit
ac319bdafd
@ -120,13 +120,11 @@ export class PeerCall implements IDisposable {
|
||||
[this.options.turnServer.get()],
|
||||
0
|
||||
);
|
||||
// update turn servers when they change (see TurnServerSource) if possible
|
||||
if (typeof this.peerConnection["setConfiguration"] === "function") {
|
||||
this.disposables.track(this.options.turnServer.subscribe(turnServer => {
|
||||
this.logItem.log({l: "updating turn server", turnServer})
|
||||
this.peerConnection["setConfiguration"]({iceServers: [turnServer]});
|
||||
}));
|
||||
}
|
||||
// update turn servers when they change (see TurnServerSource)
|
||||
this.disposables.track(this.options.turnServer.subscribe(turnServer => {
|
||||
this.logItem.log({l: "updating turn server", turnServer})
|
||||
this.peerConnection.setConfiguration({iceServers: [turnServer]});
|
||||
}));
|
||||
const listen = <K extends keyof PeerConnectionEventMap>(type: K, listener: (this: PeerConnection, ev: PeerConnectionEventMap[K]) => any, options?: boolean | EventListenerOptions): void => {
|
||||
this.peerConnection.addEventListener(type, listener);
|
||||
const dispose = () => {
|
||||
|
@ -148,6 +148,7 @@ export interface PeerConnection {
|
||||
addEventListener<K extends keyof PeerConnectionEventMap>(type: K, listener: (this: PeerConnection, ev: PeerConnectionEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
||||
removeEventListener<K extends keyof PeerConnectionEventMap>(type: K, listener: (this: PeerConnection, ev: PeerConnectionEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
||||
getStats(selector?: Track | null): Promise<StatsReport>;
|
||||
setConfiguration(configuration?: RTCConfiguration): void;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user