Skip to content

Commit

Permalink
fix: Fixed downloadMedia for videos on Chromium (close #456)
Browse files Browse the repository at this point in the history
  • Loading branch information
edgardmessias committed Dec 22, 2020
1 parent 77d5146 commit 8834957
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/lib/wapi/functions/download-media.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,13 @@ export async function downloadMedia(messageId) {
blob = Store.BlobCache.get(msg.mediaData.filehash);
}

// Transform a VIDEO message to a DOCUMENT message
if (!blob && msg.mediaObject.type && msg.mediaObject.type === 'VIDEO') {
delete msg.mediaObject.type;
msg.type = 'document';
return downloadMedia(messageId);
}

if (!blob) {
throw {
error: true,
Expand Down

0 comments on commit 8834957

Please sign in to comment.