qfix: fix url for recording videos (#8174)
Some checks failed
CI / build (push) Has been cancelled
CI / uitest (push) Has been cancelled
CI / uitest-pg (push) Has been cancelled
CI / uitest-qms (push) Has been cancelled
CI / uitest-workspaces (push) Has been cancelled
CI / svelte-check (push) Has been cancelled
CI / formatting (push) Has been cancelled
CI / test (push) Has been cancelled
CI / docker-build (push) Has been cancelled
CI / dist-build (push) Has been cancelled

This commit is contained in:
Denis Tingaikin 2025-03-08 16:21:08 +03:00 committed by GitHub
parent a42c290c52
commit 86cee505b1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -50,9 +50,8 @@ export async function record (options: FileUploadOptions): Promise<void> {
}
async function uploadRecording (recordingName: string, onUploaded: FileUploadCallback): Promise<void> {
const u = new URL(getFileUrl(recordingName))
await onUploaded({
uuid: getFileUrl(u.toString()) as Ref<Blob>,
uuid: getBlobUrl(recordingName) as Ref<Blob>,
name: 'Recording-' + now(),
file: { ...new Blob(), type: 'video/x-mpegURL' },
path: undefined,
@ -65,3 +64,12 @@ function now (): string {
const date = new Date()
return date.toLocaleDateString() + ' ' + date.toLocaleTimeString()
}
function getBlobUrl (file: string): string {
const fileUrl = getFileUrl(file)
const u = new URL(fileUrl)
if (u.searchParams.has('file')) {
return u.toString()
}
return fileUrl.split('/').slice(0, -1).join('/')
}