Skip to content

Commit

Permalink
Always set headers for iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
jenshandersson committed May 19, 2020
1 parent c9096d1 commit 26f0218
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions ios/Video/RCTVideo.m
Original file line number Diff line number Diff line change
Expand Up @@ -497,13 +497,10 @@ - (void)playerItemForSource:(NSDictionary *)source withCallback:(void(^)(AVPlaye
NSMutableDictionary *assetOptions = [[NSMutableDictionary alloc] init];

if (isNetwork) {
/* Per #1091, this is not a public API.
* We need to either get approval from Apple to use this or use a different approach.
NSDictionary *headers = [source objectForKey:@"requestHeaders"];
if ([headers count] > 0) {
[assetOptions setObject:headers forKey:@"AVURLAssetHTTPHeaderFieldsKey"];
}
*/
NSDictionary *headers = [source objectForKey:@"requestHeaders"];
if ([headers count] > 0) {
[assetOptions setObject:headers forKey:@"AVURLAssetHTTPHeaderFieldsKey"];
}
NSArray *cookies = [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookies];
[assetOptions setObject:cookies forKey:AVURLAssetHTTPCookiesKey];

Expand Down

0 comments on commit 26f0218

Please sign in to comment.