feat: 视频与控制程序合并
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user