add cookies (#345)
This commit is contained in:
parent
6b62119ce0
commit
18ad1cd580
@ -294,7 +294,12 @@ static NSString *const playbackRate = @"rate";
|
|||||||
[NSURL URLWithString:uri] :
|
[NSURL URLWithString:uri] :
|
||||||
[[NSURL alloc] initFileURLWithPath:[[NSBundle mainBundle] pathForResource:uri ofType:type]];
|
[[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];
|
AVURLAsset *asset = [AVURLAsset URLAssetWithURL:url options:nil];
|
||||||
return [AVPlayerItem playerItemWithAsset:asset];
|
return [AVPlayerItem playerItemWithAsset:asset];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user