mirror of https://github.com/jitsi/jitsi-meet
parent
49bdd53bee
commit
b284f25fde
@ -1,33 +1,20 @@ |
||||
/** |
||||
* Force download of Blob in browser by faking an <a> tag. |
||||
* |
||||
* @param {string} blob - Base64 URL. |
||||
* @param {Blob} blob - Base64 URL. |
||||
* @param {string} fileName - The filename to appear in the download dialog. |
||||
* @returns {void} |
||||
*/ |
||||
export function downloadBlob(blob, fileName = 'recording.ogg') { |
||||
const base64Url = window.URL.createObjectURL(blob); |
||||
|
||||
// fake a anchor tag
|
||||
const a = document.createElement('a'); |
||||
|
||||
document.body.appendChild(a); |
||||
a.style = 'display: none'; |
||||
a.href = blob; |
||||
a.href = base64Url; |
||||
a.download = fileName; |
||||
document.body.appendChild(a); |
||||
a.click(); |
||||
} |
||||
|
||||
/** |
||||
* Obtains a timestamp of now. Used in filenames. |
||||
* |
||||
* @returns {string} |
||||
*/ |
||||
export function timestampString() { |
||||
const timeStampInMs = window.performance |
||||
&& window.performance.now |
||||
&& window.performance.timing |
||||
&& window.performance.timing.navigationStart |
||||
? window.performance.now() + window.performance.timing.navigationStart |
||||
: Date.now(); |
||||
|
||||
return timeStampInMs.toString(); |
||||
document.body.removeChild(a); |
||||
} |
||||
|
@ -1,4 +1,5 @@ |
||||
export * from './RecordingAdapter'; |
||||
export * from './flac'; |
||||
export * from './OggAdapter'; |
||||
export * from './RecordingAdapter'; |
||||
export * from './Utils'; |
||||
export * from './WavAdapter'; |
||||
export * from './flac'; |
||||
|
Loading…
Reference in new issue