视频成功 原因 token原因
This commit is contained in:
@@ -42,6 +42,9 @@ import { RootState } from '@/src/store/index.ts';
|
||||
import { useWebRTCPlayer } from '../useWebRTCStream.tsx';
|
||||
import VideoPlayer from '../VideoPlayer.tsx';
|
||||
import DeviceController from './DeviceController';
|
||||
import { DatePicker } from 'antd';
|
||||
import dayjs from 'dayjs';
|
||||
const { RangePicker } = DatePicker;
|
||||
|
||||
const { Text } = Typography;
|
||||
|
||||
@@ -62,6 +65,13 @@ export default function DeviceStatusPage({
|
||||
const [connecting, setConnecting] = useState(false);
|
||||
const [wsStatus, setWsStatus] = useState('disconnected');
|
||||
const [wsDeviceInfo, setWsDeviceInfo] = useState({});
|
||||
const [selectedDrone, setSelectedDrone] = useState(null);
|
||||
const [taskList, setTaskList] = useState([]);
|
||||
|
||||
// 👇 加上这两个
|
||||
const [queryTimeRange, setQueryTimeRange] = useState([]); // 时间范围
|
||||
const [startTimestamp, setStartTimestamp] = useState(''); // 开始时间戳
|
||||
const [endTimestamp, setEndTimestamp] = useState(''); // 结束时间戳
|
||||
|
||||
const [isModalOpen, setIsModalOpen] = useState(false);
|
||||
const [modalContent, setModalContent] = useState({
|
||||
@@ -303,7 +313,7 @@ export default function DeviceStatusPage({
|
||||
<Button type={mowerView === 'back' ? 'primary' : 'default'} onClick={() => setMowerView('back')}>后视</Button>
|
||||
<Button type={mowerView === 'left' ? 'primary' : 'default'} onClick={() => setMowerView('left')}>左视</Button>
|
||||
<Button type={mowerView === 'right' ? 'primary' : 'default'} onClick={() => setMowerView('right')}>右视</Button>
|
||||
<Button type={mowerView === 'top' ? 'primary' : 'default'} onClick={() => setMowerView('top')}>顶视</Button>
|
||||
{/*<Button type={mowerView === 'top' ? 'primary' : 'default'} onClick={() => setMowerView('top')}>顶视</Button>*/}
|
||||
<Button type={mowerView === 'all' ? 'primary' : 'default'} onClick={() => setMowerView('all')}>全景</Button>
|
||||
</Space>
|
||||
)}
|
||||
@@ -311,10 +321,10 @@ export default function DeviceStatusPage({
|
||||
<div
|
||||
style={{
|
||||
height: 450,
|
||||
background: '#000',
|
||||
borderRadius: 8,
|
||||
overflow: 'hidden',
|
||||
display: 'flex',
|
||||
flexWrap: 'wrap', // 允许换行
|
||||
}}
|
||||
>
|
||||
{isUAV ? (
|
||||
@@ -325,11 +335,10 @@ export default function DeviceStatusPage({
|
||||
style={{
|
||||
position: 'relative',
|
||||
flex: 1,
|
||||
height: '100%',
|
||||
}}
|
||||
>
|
||||
<DroneLivePlayer streamData={s} />
|
||||
|
||||
|
||||
</div>
|
||||
))
|
||||
) : (
|
||||
@@ -338,22 +347,79 @@ export default function DeviceStatusPage({
|
||||
</div>
|
||||
)
|
||||
) : robotVideo ? (
|
||||
<VideoPlayer
|
||||
deviceId={serialNumber}
|
||||
idx={
|
||||
mowerView === 'front'
|
||||
? 1
|
||||
: mowerView === 'back'
|
||||
? 2
|
||||
: mowerView === 'left'
|
||||
? 3
|
||||
: 4
|
||||
}
|
||||
className="w-full h-full object-contain"
|
||||
video={robotVideo}
|
||||
error={error}
|
||||
ready={ready}
|
||||
/>
|
||||
// 全景模式 = 4 分屏
|
||||
mowerView === 'all' ? (
|
||||
<div style={{
|
||||
display: 'grid',
|
||||
gridTemplateColumns: '1fr 1fr',
|
||||
width: '100%',
|
||||
height: '100%'
|
||||
}}>
|
||||
{/* 前 */}
|
||||
<div style={{ position: 'relative', border: '1px solid #222' }}>
|
||||
<VideoPlayer
|
||||
deviceId={serialNumber}
|
||||
idx={1}
|
||||
className="w-full h-full object-contain"
|
||||
video={robotVideo}
|
||||
error={error}
|
||||
ready={ready}
|
||||
/>
|
||||
<div style={{ position: 'absolute', top: 4, left: 8, color: '#fff', fontSize: 12, background: '#0006', padding: '2px 6px', borderRadius: 4 }}>前视</div>
|
||||
</div>
|
||||
{/* 后 */}
|
||||
<div style={{ position: 'relative', border: '1px solid #222' }}>
|
||||
<VideoPlayer
|
||||
deviceId={serialNumber}
|
||||
idx={2}
|
||||
className="w-full h-full object-contain"
|
||||
video={robotVideo}
|
||||
error={error}
|
||||
ready={ready}
|
||||
/>
|
||||
<div style={{ position: 'absolute', top: 4, left: 8, color: '#fff', fontSize: 12, background: '#0006', padding: '2px 6px', borderRadius: 4 }}>后视</div>
|
||||
</div>
|
||||
{/* 左 */}
|
||||
<div style={{ position: 'relative', border: '1px solid #222' }}>
|
||||
<VideoPlayer
|
||||
deviceId={serialNumber}
|
||||
idx={3}
|
||||
className="w-full h-full object-contain"
|
||||
video={robotVideo}
|
||||
error={error}
|
||||
ready={ready}
|
||||
/>
|
||||
<div style={{ position: 'absolute', top: 4, left: 8, color: '#fff', fontSize: 12, background: '#0006', padding: '2px 6px', borderRadius: 4 }}>左视</div>
|
||||
</div>
|
||||
{/* 右 */}
|
||||
<div style={{ position: 'relative', border: '1px solid #222' }}>
|
||||
<VideoPlayer
|
||||
deviceId={serialNumber}
|
||||
idx={4}
|
||||
className="w-full h-full object-contain"
|
||||
video={robotVideo}
|
||||
error={error}
|
||||
ready={ready}
|
||||
/>
|
||||
<div style={{ position: 'absolute', top: 4, left: 8, color: '#fff', fontSize: 12, background: '#0006', padding: '2px 6px', borderRadius: 4 }}>右视</div>
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
// 单画面模式
|
||||
<VideoPlayer
|
||||
deviceId={serialNumber}
|
||||
idx={
|
||||
mowerView === 'front' ? 1
|
||||
: mowerView === 'back' ? 2
|
||||
: mowerView === 'left' ? 3
|
||||
: 4
|
||||
}
|
||||
className="w-full h-full object-contain"
|
||||
video={robotVideo}
|
||||
error={error}
|
||||
ready={ready}
|
||||
/>
|
||||
)
|
||||
) : (
|
||||
<div style={{ color: '#ccc', margin: 'auto' }}>
|
||||
视频加载中...
|
||||
|
||||
Reference in New Issue
Block a user