diff options
Diffstat (limited to 'ext/js/media/media-loader.js')
-rw-r--r-- | ext/js/media/media-loader.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/js/media/media-loader.js b/ext/js/media/media-loader.js index 7dafc2a3..8c7e356c 100644 --- a/ext/js/media/media-loader.js +++ b/ext/js/media/media-loader.js @@ -16,7 +16,7 @@ */ /* global - * MediaUtil + * StringUtil */ class MediaLoader { @@ -86,7 +86,8 @@ class MediaLoader { const token = this._token; const data = (await yomichan.api.getMedia([{path, dictionary}]))[0]; if (token === this._token && data !== null) { - const blob = MediaUtil.createBlobFromBase64Content(data.content, data.mediaType); + const buffer = StringUtil.base64ToArrayBuffer(data.content); + const blob = new Blob([buffer], {type: data.mediaType}); const url = URL.createObjectURL(blob); cachedData.data = data; cachedData.url = url; |