Unverified Commit 25885fc4 authored by Reinaldo Neto's avatar Reinaldo Neto Committed by GitHub
Browse files

[FIX] Download video/quicktime in iOS (#3581)

parent b75e192e
......@@ -123,7 +123,11 @@ class AttachmentView extends React.Component<IAttachmentViewProps, IAttachmentVi
this.setState({ loading: true });
try {
const extension = image_url ? `.${mime.extension(image_type) || 'jpg'}` : `.${mime.extension(video_type) || 'mp4'}`;
const extension = image_url
? `.${mime.extension(image_type) || 'jpg'}`
: `.${(video_type === 'video/quicktime' && 'mov') || mime.extension(video_type) || 'mp4'}`;
// The return of mime.extension('video/quicktime') is .qt,
// this format the iOS isn't recognize and can't save on gallery
const documentDir = `${RNFetchBlob.fs.dirs.DocumentDir}/`;
const path = `${documentDir + sha256(url!) + extension}`;
const file = await RNFetchBlob.config({ path }).fetch('GET', mediaAttachment);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment