aboutsummaryrefslogtreecommitdiff
path: root/ext/js/media
diff options
context:
space:
mode:
Diffstat (limited to 'ext/js/media')
-rw-r--r--ext/js/media/audio-downloader.js7
1 files changed, 2 insertions, 5 deletions
diff --git a/ext/js/media/audio-downloader.js b/ext/js/media/audio-downloader.js
index e3b507b4..4bc4cf1b 100644
--- a/ext/js/media/audio-downloader.js
+++ b/ext/js/media/audio-downloader.js
@@ -19,6 +19,7 @@
* JsonSchema
* NativeSimpleDOMParser
* SimpleDOMParser
+ * StringUtil
*/
class AudioDownloader {
@@ -257,7 +258,7 @@ class AudioDownloader {
throw new Error('Could not retrieve audio');
}
- const data = this._arrayBufferToBase64(arrayBuffer);
+ const data = StringUtil.arrayBufferToBase64(arrayBuffer);
const contentType = response.headers.get('Content-Type');
return {data, contentType};
}
@@ -288,10 +289,6 @@ class AudioDownloader {
return digest;
}
- _arrayBufferToBase64(arrayBuffer) {
- return btoa(String.fromCharCode(...new Uint8Array(arrayBuffer)));
- }
-
_createSimpleDOMParser(content) {
if (typeof NativeSimpleDOMParser !== 'undefined' && NativeSimpleDOMParser.isSupported()) {
return new NativeSimpleDOMParser(content);