广角变焦 视频实现

This commit is contained in:
mmc
2026-05-25 10:04:45 +08:00
parent 3ea0d713d2
commit e1c56ead20

View File

@@ -49,7 +49,7 @@ export default function DeviceOverviewPage({ devices, planedevices, devicesAll,
const [planeVideo, setPlaneVideo] = useState(null);
const [zoomedVideo, setZoomedVideo] = useState(null);
const [mowerView, setMowerView] = useState('front');
const [videoSource, setVideoSource] = useState('station'); // station / drone
const [videoSource, setVideoSource] = useState('drone'); // station / drone
const videoTypeRef = useRef('station');
const [selectedCamera, setSelectedCamera] = useState('outdoor'); // 机场默认室外
const [selectedLens, setSelectedLens] = useState('wide'); // 飞机默认广角
@@ -137,15 +137,16 @@ export default function DeviceOverviewPage({ devices, planedevices, devicesAll,
const loadDroneLens = async (lensType) => {
console.log(lensType, "lensType")
if (!selectedDevice?.gateway_sn || !selectedDevice?.device_sn) return;
const cameraIndex = selectedDevice.drone_camera_list
?.find(item => item.drone_camera_list == cameraPosition
)?.camera_index || "";
const cameraIndex = selectedDevice.drone_camera_list[1].camera_index || "";
console.log(cameraIndex, "cameraIndex")
if (!cameraIndex) return;
try {
const res = await changeCameraPlane({
drone_sn: selectedDevice.device_sn,
sn: selectedDevice.device_sn,
lensType,
cameraIndex,
qualityType: "adaptive",
videoExpire: 7200,
});
if (res.code === 200) {
setPlaneVideo(res.data);