This commit is contained in:
Thibault Deckers 2022-05-11 16:38:53 +09:00
parent 6d410e7540
commit f8fefe1b4f
2 changed files with 4 additions and 2 deletions

View file

@ -82,6 +82,8 @@ class MimeTypes {
static bool isVideo(String mimeType) => mimeType.startsWith('video'); static bool isVideo(String mimeType) => mimeType.startsWith('video');
static bool isVisual(String mimeType) => isImage(mimeType) || isVideo(mimeType);
static bool refersToSameType(String a, b) { static bool refersToSameType(String a, b) {
switch (a) { switch (a) {
case avi: case avi:

View file

@ -211,7 +211,7 @@ class PlatformMediaFileService implements MediaFileService {
// `await` here, so that `completeError` will be caught below // `await` here, so that `completeError` will be caught below
return await completer.future; return await completer.future;
} on PlatformException catch (e, stack) { } on PlatformException catch (e, stack) {
if (!MimeTypes.knownMediaTypes.contains(mimeType)) { if (!MimeTypes.knownMediaTypes.contains(mimeType) && MimeTypes.isVisual(mimeType)) {
await reportService.recordError(e, stack); await reportService.recordError(e, stack);
} }
} }
@ -285,7 +285,7 @@ class PlatformMediaFileService implements MediaFileService {
}); });
if (result != null) return result as Uint8List; if (result != null) return result as Uint8List;
} on PlatformException catch (e, stack) { } on PlatformException catch (e, stack) {
if (!MimeTypes.knownMediaTypes.contains(mimeType)) { if (!MimeTypes.knownMediaTypes.contains(mimeType) && MimeTypes.isVisual(mimeType)) {
await reportService.recordError(e, stack); await reportService.recordError(e, stack);
} }
} }