fix: 前端时钟校准问题
This commit is contained in:
@@ -20,6 +20,19 @@ export function fetchVideoStatus() {
|
||||
return fetchJson<VideoStatus>('/api/video/status/')
|
||||
}
|
||||
|
||||
export async function fetchClockCalibrationSample() {
|
||||
const response = await fetch(`${API_BASE}/api/clock/calibrate/`, {
|
||||
cache: 'no-store',
|
||||
})
|
||||
if (!response.ok) {
|
||||
throw new Error(`clock calibration failed: ${response.status} ${response.statusText}`)
|
||||
}
|
||||
return response.json() as Promise<{
|
||||
server_received_unix_ms: number
|
||||
server_sent_unix_ms: number
|
||||
}>
|
||||
}
|
||||
|
||||
export function buildVideoFrameUrl(frameKey: number) {
|
||||
return `${API_BASE}/api/video/frame/?frame=${frameKey}&t=${Date.now()}`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user