mirror of
https://github.com/vector-im/element-call.git
synced 2026-07-06 18:19:20 +00:00
Add onPipMediaOrientationUpdate to controls api.
This commit is contained in:
@@ -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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user