Add onPipMediaOrientationUpdate to controls api.

This commit is contained in:
Timo K
2026-06-01 16:12:57 +02:00
parent 72b0d12d7c
commit a6fc710d8c
4 changed files with 38 additions and 5 deletions

View File

@@ -1191,6 +1191,31 @@ export function createCallViewModel$(
})),
);
spotlight$
.pipe(
switchMap((media) => {
let layout;
switch (media[0].type) {
case "user":
layout = media[0].videoOrientation$;
break;
case "ringing":
layout = of("landscape" as const);
break;
case "screen share":
layout = of("landscape" as const);
break;
}
return layout;
}),
tap((orientation) => {
logger.info("controls api pip orientation updated:", orientation);
window.controls.onPipMediaOrientationUpdate?.(orientation);
}),
scope.bind(),
)
.subscribe();
/**
* The media to be used to produce a layout.
*/