From 22c4eb2ab573e836789c4fbfe9c10da3d36d37e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Mon, 23 Feb 2026 10:40:35 -0300 Subject: [PATCH] stores: video: Send MAVLink message when starting or stopping recording MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick José Pereira --- src/stores/video.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/stores/video.ts b/src/stores/video.ts index 74a18f7527..778c801bf5 100644 --- a/src/stores/video.ts +++ b/src/stores/video.ts @@ -12,6 +12,7 @@ import { useBlueOsStorage } from '@/composables/settingsSyncer' import { useSnackbar } from '@/composables/snackbar' import { WebRTCManager } from '@/composables/webRTC' import { getIpsInformationFromVehicle } from '@/libs/blueos' +import { MavCmd } from '@/libs/connection/m2r/messages/mavlink2rest-enum' import eventTracker from '@/libs/external-telemetry/event-tracking' import { availableCockpitActions, registerActionCallback } from '@/libs/joystick/protocols/cockpit-actions' import { @@ -44,7 +45,7 @@ export const useVideoStore = defineStore('video', () => { const alertStore = useAlertStore() const { showDialog } = useInteractionDialog() - const { globalAddress, rtcConfiguration, webRTCSignallingURI } = useMainVehicleStore() + const { globalAddress, mainVehicle, rtcConfiguration, webRTCSignallingURI } = useMainVehicleStore() console.debug('[WebRTC] Using webrtc-adapter for', adapter.browserDetails) const streamsCorrespondency = useBlueOsStorage('cockpit-streams-correspondency', []) @@ -307,6 +308,10 @@ export const useVideoStore = defineStore('video', () => { activeStreams.value[streamName]!.mediaRecorder!.stop() + mainVehicle.value?.sendCommandLong(MavCmd.MAV_CMD_VIDEO_STOP_CAPTURE, 0, 0).catch((error) => { + console.warn('Failed to send MAV_CMD_VIDEO_STOP_CAPTURE to vehicle:', error) + }) + alertStore.pushAlert(new Alert(AlertLevel.Success, `Stopped recording stream ${streamName}.`)) } @@ -604,6 +609,10 @@ export const useVideoStore = defineStore('video', () => { } alertStore.pushAlert(new Alert(AlertLevel.Success, `Started recording stream ${streamName}.`)) + + mainVehicle.value?.sendCommandLong(MavCmd.MAV_CMD_VIDEO_START_CAPTURE, 0, 0, 0).catch((error) => { + console.warn('Failed to send MAV_CMD_VIDEO_START_CAPTURE to vehicle:', error) + }) } // Used to discard a file from the video recovery database