minor
This commit is contained in:
parent
6d410e7540
commit
f8fefe1b4f
2 changed files with 4 additions and 2 deletions
|
@ -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:
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue