mirror of
https://github.com/vector-im/element-call.git
synced 2026-06-27 17:52:56 +00:00
fix error with no media
This commit is contained in:
@@ -1195,9 +1195,11 @@ export function createCallViewModel$(
|
|||||||
.pipe(
|
.pipe(
|
||||||
switchMap((media) => {
|
switchMap((media) => {
|
||||||
let layout;
|
let layout;
|
||||||
switch (media[0].type) {
|
const pipMedia = media[0];
|
||||||
|
if (pipMedia === undefined) return of(undefined);
|
||||||
|
switch (pipMedia.type) {
|
||||||
case "user":
|
case "user":
|
||||||
layout = media[0].videoOrientation$;
|
layout = pipMedia.videoOrientation$;
|
||||||
break;
|
break;
|
||||||
case "ringing":
|
case "ringing":
|
||||||
layout = of("landscape" as const);
|
layout = of("landscape" as const);
|
||||||
@@ -1211,6 +1213,7 @@ export function createCallViewModel$(
|
|||||||
scope.bind(),
|
scope.bind(),
|
||||||
)
|
)
|
||||||
.subscribe((orientation) => {
|
.subscribe((orientation) => {
|
||||||
|
if (orientation === undefined) return;
|
||||||
logger.info("controls api pip orientation updated:", orientation);
|
logger.info("controls api pip orientation updated:", orientation);
|
||||||
window.controls.onPipMediaOrientationUpdate?.(orientation);
|
window.controls.onPipMediaOrientationUpdate?.(orientation);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user