Merge branch 'livekit' into toger5/lib-ec-version

This commit is contained in:
Timo K
2025-12-11 13:17:26 +01:00
20 changed files with 1117 additions and 135 deletions

View File

@@ -327,12 +327,14 @@ export const createLocalMembership$ = ({
// - overwrite current publisher
scope.reconcile(localConnection$, async (connection) => {
if (connection !== null) {
publisher$.next(createPublisherFactory(connection));
const publisher = createPublisherFactory(connection);
publisher$.next(publisher);
// Clean-up callback
return Promise.resolve(async (): Promise<void> => {
await publisher.stopPublishing();
publisher.stopTracks();
});
}
return Promise.resolve(async (): Promise<void> => {
await publisher$?.value?.stopPublishing();
publisher$?.value?.stopTracks();
});
});
// Use reconcile here to not run concurrent createAndSetupTracks calls