Skip to content

Commit

Permalink
qfix: fix url for recording videos (#8174)
Browse files Browse the repository at this point in the history
  • Loading branch information
denis-tingaikin authored Mar 8, 2025
1 parent a42c290 commit 86cee50
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions plugins/recorder-resources/src/recording.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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('/')
}

0 comments on commit 86cee50

Please sign in to comment.