mirror of
https://github.com/vector-im/element-call.git
synced 2026-08-29 21:15:19 +00:00
Always wait for local transport
This commit is contained in:
@@ -7,7 +7,7 @@ Please see LICENSE in the repository root for full details.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { type LivekitTransportConfig } from "matrix-js-sdk/lib/matrixrtc";
|
import { type LivekitTransportConfig } from "matrix-js-sdk/lib/matrixrtc";
|
||||||
import { combineLatest, map, of, switchMap } from "rxjs";
|
import { combineLatest, map, of, skipWhile, switchMap } from "rxjs";
|
||||||
import { type Logger } from "matrix-js-sdk/lib/logger";
|
import { type Logger } from "matrix-js-sdk/lib/logger";
|
||||||
import { type RemoteParticipant } from "livekit-client";
|
import { type RemoteParticipant } from "livekit-client";
|
||||||
import { type CallMembershipIdentityParts } from "matrix-js-sdk/lib/matrixrtc/EncryptionManager";
|
import { type CallMembershipIdentityParts } from "matrix-js-sdk/lib/matrixrtc/EncryptionManager";
|
||||||
@@ -131,6 +131,12 @@ export function createConnectionManager$({
|
|||||||
// Combine local and remote transports into one transport array
|
// Combine local and remote transports into one transport array
|
||||||
// and set the forceOldJwtEndpoint property on the local transport
|
// and set the forceOldJwtEndpoint property on the local transport
|
||||||
map(([remoteTransports, localTransport]) => {
|
map(([remoteTransports, localTransport]) => {
|
||||||
|
if (!localTransport) {
|
||||||
|
// Dont return any transports as long as there is no local transport.
|
||||||
|
// Otherwise we might end up with two connections since the local transport will already connect to the SFU.
|
||||||
|
// The local transport needs to connect with dedicated logic to also setup delayed event delegation.
|
||||||
|
return new Epoch([]);
|
||||||
|
}
|
||||||
let localTransportAsArray: LocalTransportWithSFUConfig[] = [];
|
let localTransportAsArray: LocalTransportWithSFUConfig[] = [];
|
||||||
if (localTransport) {
|
if (localTransport) {
|
||||||
localTransportAsArray = [localTransport];
|
localTransportAsArray = [localTransport];
|
||||||
|
|||||||
Reference in New Issue
Block a user