Loading ios/RCTVideo.m +6 −2 Changes for ios/RCTVideo.m: 6 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -347,8 +347,12 @@ static int const RCTVideoUnset = -1; } - (NSURL*) urlFilePath:(NSString*) filepath { NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); if ([filepath containsString:@"file://"]) { return [NSURL URLWithString:filepath]; } // code to support local caching NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString* relativeFilePath = [filepath lastPathComponent]; // the file may be multiple levels below the documents directory NSArray* fileComponents = [filepath componentsSeparatedByString:@"Documents/"]; Loading Loading @@ -384,7 +388,7 @@ static int const RCTVideoUnset = -1; NSArray *cookies = [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookies]; [assetOptions setObject:cookies forKey:AVURLAssetHTTPCookiesKey]; asset = [AVURLAsset URLAssetWithURL:[NSURL URLWithString:uri] options:assetOptions]; } else if (isAsset) { // assets on iOS have to be in the Documents folder } else if (isAsset) { // assets on iOS can be in the Bundle or Documents folder asset = [AVURLAsset URLAssetWithURL:[self urlFilePath:uri] options:nil]; } else { // file passed in through JS, or an asset in the Xcode project asset = [AVURLAsset URLAssetWithURL:[[NSURL alloc] initFileURLWithPath:[[NSBundle mainBundle] pathForResource:uri ofType:type]] options:nil]; Loading Loading
ios/RCTVideo.m +6 −2 Changes for ios/RCTVideo.m: 6 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -347,8 +347,12 @@ static int const RCTVideoUnset = -1; } - (NSURL*) urlFilePath:(NSString*) filepath { NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); if ([filepath containsString:@"file://"]) { return [NSURL URLWithString:filepath]; } // code to support local caching NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString* relativeFilePath = [filepath lastPathComponent]; // the file may be multiple levels below the documents directory NSArray* fileComponents = [filepath componentsSeparatedByString:@"Documents/"]; Loading Loading @@ -384,7 +388,7 @@ static int const RCTVideoUnset = -1; NSArray *cookies = [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookies]; [assetOptions setObject:cookies forKey:AVURLAssetHTTPCookiesKey]; asset = [AVURLAsset URLAssetWithURL:[NSURL URLWithString:uri] options:assetOptions]; } else if (isAsset) { // assets on iOS have to be in the Documents folder } else if (isAsset) { // assets on iOS can be in the Bundle or Documents folder asset = [AVURLAsset URLAssetWithURL:[self urlFilePath:uri] options:nil]; } else { // file passed in through JS, or an asset in the Xcode project asset = [AVURLAsset URLAssetWithURL:[[NSURL alloc] initFileURLWithPath:[[NSBundle mainBundle] pathForResource:uri ofType:type]] options:nil]; Loading