diff --git a/photon-client/src/components/app/photon-camera-stream.vue b/photon-client/src/components/app/photon-camera-stream.vue index 2fa78fb9f..7e225e042 100644 --- a/photon-client/src/components/app/photon-camera-stream.vue +++ b/photon-client/src/components/app/photon-camera-stream.vue @@ -11,12 +11,13 @@ const props = defineProps<{ id: string; }>(); +const emptyStreamSrc = "//:0"; const streamSrc = computed(() => { const port = useCameraSettingsStore().currentCameraSettings.stream[props.streamType === "Raw" ? "inputPort" : "outputPort"]; if (!useStateStore().backendConnected || port === 0) { - return loadingImage; + return emptyStreamSrc; } return `http://${inject("backendHostname")}:${port}/stream.mjpg`; @@ -24,14 +25,27 @@ const streamSrc = computed(() => { const streamDesc = computed(() => `${props.streamType} Stream View`); const streamStyle = computed(() => { if (useStateStore().colorPickingMode) { - return { width: "100%", cursor: "crosshair" }; + return { cursor: "crosshair" }; } - return { width: "100%" }; + return {}; +}); + +const containerStyle = computed(() => { + const resolution = useCameraSettingsStore().currentVideoFormat.resolution; + const rotation = useCameraSettingsStore().currentPipelineSettings.inputImageRotationMode; + if (rotation === 1 || rotation === 3) { + return { + aspectRatio: `${resolution.height}/${resolution.width}` + }; + } + return { + aspectRatio: `${resolution.width}/${resolution.height}` + }; }); const overlayStyle = computed(() => { - if (useStateStore().colorPickingMode || streamSrc.value == loadingImage) { + if (useStateStore().colorPickingMode || streamSrc.value == emptyStreamSrc) { return { display: "none" }; } else { return {}; @@ -57,13 +71,23 @@ const handleFullscreenRequest = () => { const mjpgStream: any = ref(null); onBeforeUnmount(() => { if (!mjpgStream.value) return; - mjpgStream.value["src"] = "//:0"; + mjpgStream.value["src"] = emptyStreamSrc; });