diff --git a/src/steps/video-setup/preview.tsx b/src/steps/video-setup/preview.tsx index 8930cc58..d39ac4c4 100644 --- a/src/steps/video-setup/preview.tsx +++ b/src/steps/video-setup/preview.tsx @@ -1,6 +1,5 @@ import { useEffect, useRef } from "react"; import { Spinner, match, unreachable } from "@opencast/appkit"; -import { FiAlertTriangle } from "react-icons/fi"; import { useTranslation } from "react-i18next"; import { COLORS, dimensionsOf } from "../../util"; @@ -24,15 +23,18 @@ export const SourcePreview: React.FC = ({ inputs }) => { 1: () => [{ body: , dimensions: () => dimensionsOf(inputs[0].stream), + calculatedHeight: (inputs[0].allowed !== false && inputs[0].unexpectedEnd === false), }], 2: () => [ { body: , dimensions: () => dimensionsOf(inputs[0].stream), + calculatedHeight: (inputs[0].allowed !== false && inputs[0].unexpectedEnd === false), }, { body: , dimensions: () => dimensionsOf(inputs[1].stream), + calculatedHeight: (inputs[1].allowed !== false && inputs[1].unexpectedEnd === false), }, ], }, unreachable); @@ -79,7 +81,14 @@ const PreviewVideo: React.FC<{ input: Input }> = ({ input }) => { if (!stream) { let inner: JSX.Element; if (allowed === false || unexpectedEnd) { - inner = ; + inner =
+ {allowed === false && } + {/* TODO: differentiate between desktop and camera for better error */} + {unexpectedEnd && } +
; } else { inner = ; } @@ -91,17 +100,6 @@ const PreviewVideo: React.FC<{ input: Input }> = ({ input }) => { width: "100%", height: "100%", }}> - {allowed === false && } - {/* TODO: differentiate between desktop and camera for better error */} - {unexpectedEnd && } -
[number, number] | null; + /** + * If `true` (default), the calculated height is set as `height` of the div. + * If `false`, it is not set, which allows the div to grow in height. Used to + * display error messages. + */ + calculatedHeight?: boolean; }; // Manages one or two children with given aspect ratio. @@ -104,7 +110,7 @@ export const VideoBox: React.FC = ({
= ({ }} >
= ({ { children[0].body }