mirror of
https://github.com/zoriya/react-native-video.git
synced 2026-06-02 11:06:11 +00:00
add cookies (#345)
This commit is contained in:
committed by
Matt Apperson
parent
6b62119ce0
commit
18ad1cd580
+6
-1
@@ -294,7 +294,12 @@ static NSString *const playbackRate = @"rate";
|
||||
[NSURL URLWithString:uri] :
|
||||
[[NSURL alloc] initFileURLWithPath:[[NSBundle mainBundle] pathForResource:uri ofType:type]];
|
||||
|
||||
if (isAsset) {
|
||||
if (isNetwork) {
|
||||
NSArray *cookies = [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookies];
|
||||
AVURLAsset *asset = [AVURLAsset URLAssetWithURL:url options:@{AVURLAssetHTTPCookiesKey : cookies}];
|
||||
return [AVPlayerItem playerItemWithAsset:asset];
|
||||
}
|
||||
else if (isAsset) {
|
||||
AVURLAsset *asset = [AVURLAsset URLAssetWithURL:url options:nil];
|
||||
return [AVPlayerItem playerItemWithAsset:asset];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user