@@ -13,6 +13,7 @@ import { useSnackbar } from '@/composables/snackbar'
1313import { WebRTCManager } from '@/composables/webRTC'
1414import { getIpsInformationFromVehicle } from '@/libs/blueos'
1515import eventTracker from '@/libs/external-telemetry/event-tracking'
16+ import { MavCmd } from '@/libs/connection/m2r/messages/mavlink2rest-enum'
1617import { availableCockpitActions , registerActionCallback } from '@/libs/joystick/protocols/cockpit-actions'
1718import {
1819 LiveVideoProcessor ,
@@ -44,7 +45,7 @@ export const useVideoStore = defineStore('video', () => {
4445 const alertStore = useAlertStore ( )
4546 const { showDialog } = useInteractionDialog ( )
4647
47- const { globalAddress, rtcConfiguration, webRTCSignallingURI } = useMainVehicleStore ( )
48+ const { globalAddress, mainVehicle , rtcConfiguration, webRTCSignallingURI } = useMainVehicleStore ( )
4849 console . debug ( '[WebRTC] Using webrtc-adapter for' , adapter . browserDetails )
4950
5051 const streamsCorrespondency = useBlueOsStorage < VideoStreamCorrespondency [ ] > ( 'cockpit-streams-correspondency' , [ ] )
@@ -307,6 +308,10 @@ export const useVideoStore = defineStore('video', () => {
307308
308309 activeStreams . value [ streamName ] ! . mediaRecorder ! . stop ( )
309310
311+ mainVehicle . value ?. sendCommandLong ( MavCmd . MAV_CMD_VIDEO_STOP_CAPTURE , 0 , 0 ) . catch ( ( error ) => {
312+ console . warn ( 'Failed to send MAV_CMD_VIDEO_STOP_CAPTURE to vehicle:' , error )
313+ } )
314+
310315 alertStore . pushAlert ( new Alert ( AlertLevel . Success , `Stopped recording stream ${ streamName } .` ) )
311316 }
312317
@@ -604,6 +609,10 @@ export const useVideoStore = defineStore('video', () => {
604609 }
605610
606611 alertStore . pushAlert ( new Alert ( AlertLevel . Success , `Started recording stream ${ streamName } .` ) )
612+
613+ mainVehicle . value ?. sendCommandLong ( MavCmd . MAV_CMD_VIDEO_START_CAPTURE , 0 , 0 , 0 ) . catch ( ( error ) => {
614+ console . warn ( 'Failed to send MAV_CMD_VIDEO_START_CAPTURE to vehicle:' , error )
615+ } )
607616 }
608617
609618 // Used to discard a file from the video recovery database
0 commit comments