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 fcbef0d commit 33c5b61Copy full SHA for 33c5b61
src/ios/IONAssetHandler.m
@@ -25,8 +25,14 @@ - (void)webView:(WKWebView *)webView startURLSchemeTask:(id <WKURLSchemeTask>)ur
25
}
26
27
28
-
29
- NSData * data = [[NSData alloc] initWithContentsOfFile:startPath];
+ NSError * fileError = nil;
+ NSData * data = nil;
30
+ if ([self isMediaExtension:url.pathExtension]) {
31
+ data = [NSData dataWithContentsOfFile:startPath options:NSDataReadingMappedIfSafe error:&fileError];
32
+ }
33
+ if (!data || fileError) {
34
+ data = [[NSData alloc] initWithContentsOfFile:startPath];
35
36
NSInteger statusCode = 200;
37
if (!data) {
38
statusCode = 404;
0 commit comments