From 356a3e7098f2da5bd31e699b158585698afa73fb Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Fri, 30 Aug 2019 09:45:56 -0300 Subject: [PATCH] [FIX] Remove unsupported video format from Android (#1166) --- app/containers/FileModal.js | 5 ++--- app/containers/message/Video.js | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/containers/FileModal.js b/app/containers/FileModal.js index 3d5b087f..a305f623 100644 --- a/app/containers/FileModal.js +++ b/app/containers/FileModal.js @@ -11,7 +11,6 @@ import { Video } from 'expo-av'; import sharedStyles from '../views/Styles'; import { COLOR_WHITE } from '../constants/colors'; import { formatAttachmentUrl } from '../lib/utils'; -import log from '../utils/log'; const styles = StyleSheet.create({ safeArea: { @@ -85,7 +84,7 @@ const ModalContent = React.memo(({ ); } if (attachment && attachment.video_url) { - const [loading, setLoading] = useState(0); + const [loading, setLoading] = useState(true); const uri = formatAttachmentUrl(attachment.video_url, user.id, user.token, baseUrl); return ( <> @@ -101,7 +100,7 @@ const ModalContent = React.memo(({ useNativeControls onReadyForDisplay={() => setLoading(false)} onLoadStart={() => setLoading(true)} - onError={log} + onError={console.log} /> { loading ? : null } diff --git a/app/containers/message/Video.js b/app/containers/message/Video.js index d6710779..95d164ea 100644 --- a/app/containers/message/Video.js +++ b/app/containers/message/Video.js @@ -10,7 +10,7 @@ import { isIOS } from '../../utils/deviceInfo'; import { CustomIcon } from '../../lib/Icons'; import { formatAttachmentUrl } from '../../lib/utils'; -const SUPPORTED_TYPES = ['video/quicktime', 'video/mp4', ...(isIOS ? [] : ['video/webm', 'video/3gp', 'video/mkv'])]; +const SUPPORTED_TYPES = ['video/quicktime', 'video/mp4', ...(isIOS ? [] : ['video/3gp', 'video/mkv'])]; const isTypeSupported = type => SUPPORTED_TYPES.indexOf(type) !== -1; const styles = StyleSheet.create({