feat: 视频与控制程序合并

This commit is contained in:
2026-04-04 23:25:52 +08:00
parent 1a41905d4c
commit b0dcf7b571
17 changed files with 1674 additions and 554 deletions

View File

@@ -23,3 +23,13 @@ export function fetchVideoStatus() {
export function buildVideoFrameUrl(frameKey: number) {
return `${API_BASE}/api/video/frame/?frame=${frameKey}&t=${Date.now()}`
}
export function buildControlWebSocketUrl() {
const url = new URL(API_BASE, window.location.origin)
const basePath = url.pathname.replace(/\/$/, '')
url.protocol = url.protocol === 'https:' ? 'wss:' : 'ws:'
url.pathname = `${basePath}/ws/control/`
url.search = ''
url.hash = ''
return url.toString()
}