We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 173a313 commit cbd526dCopy full SHA for cbd526d
src/ios/IONAssetHandler.m
@@ -36,8 +36,14 @@ - (void)webView:(WKWebView *)webView startURLSchemeTask:(id <WKURLSchemeTask>)ur
36
}
37
38
39
-
40
- NSData * data = [[NSData alloc] initWithContentsOfFile:startPath];
+ NSError * fileError = nil;
+ NSData * data = nil;
41
+ if ([self isMediaExtension:url.pathExtension]) {
42
+ data = [NSData dataWithContentsOfFile:startPath options:NSDataReadingMappedIfSafe error:&fileError];
43
+ }
44
+ if (!data || fileError) {
45
+ data = [[NSData alloc] initWithContentsOfFile:startPath];
46
47
NSInteger statusCode = 200;
48
if (!data) {
49
statusCode = 404;
0 commit comments