first video!

Signed-off-by: Timo K <toger5@hotmail.de>
This commit is contained in:
Timo K
2025-08-27 16:56:57 +02:00
parent cb91f1ad4f
commit 7b88420f6a
3 changed files with 26 additions and 11 deletions

View File

@@ -60,9 +60,9 @@ if (fatalError !== null) {
Initializer.initBeforeReact() Initializer.initBeforeReact()
.then(() => { .then(() => {
root.render( root.render(
<StrictMode> // <StrictMode>
<App vm={new AppViewModel()} /> <App vm={new AppViewModel()} />,
</StrictMode>, // </StrictMode>,
); );
}) })
.catch((e) => { .catch((e) => {

View File

@@ -107,7 +107,6 @@ import {
import { ReactionsReader } from "../reactions/ReactionsReader"; import { ReactionsReader } from "../reactions/ReactionsReader";
import { useTypedEventEmitter } from "../useEvents.ts"; import { useTypedEventEmitter } from "../useEvents.ts";
import { muteAllAudio$ } from "../state/MuteAllAudioModel.ts"; import { muteAllAudio$ } from "../state/MuteAllAudioModel.ts";
import { useMatrixRTCSessionMemberships } from "../useMatrixRTCSessionMemberships.ts";
import { useMediaDevices } from "../MediaDevicesContext.ts"; import { useMediaDevices } from "../MediaDevicesContext.ts";
import { EarpieceOverlay } from "./EarpieceOverlay.tsx"; import { EarpieceOverlay } from "./EarpieceOverlay.tsx";
import { useAppBarHidden, useAppBarSecondaryButton } from "../AppBar.tsx"; import { useAppBarHidden, useAppBarSecondaryButton } from "../AppBar.tsx";
@@ -251,7 +250,6 @@ export const InCallView: FC<InCallViewProps> = ({
useExperimentalToDeviceTransportSetting, useExperimentalToDeviceTransportSetting,
); );
const encryptionSystem = useRoomEncryptionSystem(matrixRoom.roomId); const encryptionSystem = useRoomEncryptionSystem(matrixRoom.roomId);
const memberships = useMatrixRTCSessionMemberships(rtcSession);
const showToDeviceEncryption = useMemo( const showToDeviceEncryption = useMemo(
() => () =>

View File

@@ -42,6 +42,7 @@ import {
distinctUntilChanged, distinctUntilChanged,
endWith, endWith,
filter, filter,
from,
fromEvent, fromEvent,
ignoreElements, ignoreElements,
map, map,
@@ -367,6 +368,7 @@ class UserMedia {
public destroy(): void { public destroy(): void {
this.scope.end(); this.scope.end();
this.vm.destroy(); this.vm.destroy();
} }
} }
@@ -473,12 +475,17 @@ class Connection {
public async startPublishing(): Promise<void> { public async startPublishing(): Promise<void> {
this.stopped = false; this.stopped = false;
const { url, jwt } = await this.sfuConfig; const { url, jwt } = await this.sfuConfig;
if (!this.stopped)
// TODO-MULTI-SFU this should not create a track?
await this.livekitRoom.localParticipant.createTracks({
audio: { deviceId: "default" },
});
if (!this.stopped) await this.livekitRoom.connect(url, jwt); if (!this.stopped) await this.livekitRoom.connect(url, jwt);
if (!this.stopped) {
const tracks = await this.livekitRoom.localParticipant.createTracks({
audio: { deviceId: "default" },
video: true,
});
for (const track of tracks) {
await this.livekitRoom.localParticipant.publishTrack(track);
}
// await this.livekitRoom.localParticipant.enableCameraAndMicrophone();
}
} }
private stopped = false; private stopped = false;
@@ -1814,7 +1821,17 @@ export class CallViewModel extends ViewModel {
) { ) {
super(); super();
void this.localConnection.then((c) => void c.startPublishing()); void from(this.localConnection)
.pipe(this.scope.bind())
.subscribe(
(c) =>
void c
.startPublishing()
// eslint-disable-next-line no-console
.then(() => console.log("successfully started publishing"))
// eslint-disable-next-line no-console
.catch((e) => console.error("failed to start publishing", e)),
);
this.connectionInstructions$ this.connectionInstructions$
.pipe(this.scope.bind()) .pipe(this.scope.bind())
.subscribe(({ start, stop }) => { .subscribe(({ start, stop }) => {