mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-29 03:34:31 +00:00
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
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:
parent
a42c290c52
commit
86cee505b1
@ -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('/')
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user