Always set headers for iOS (#2014)
This commit is contained in:
parent
f395bd1d3d
commit
9c31948dbf
@ -10,6 +10,7 @@
|
|||||||
- Added `currentPlaybackTime` (Android ExoPlayer, iOS) - when playing an HLS live stream with a `EXT-X-PROGRAM-DATE-TIME` tag configured, then this property will contain the epoch value in msec. (#1944)
|
- Added `currentPlaybackTime` (Android ExoPlayer, iOS) - when playing an HLS live stream with a `EXT-X-PROGRAM-DATE-TIME` tag configured, then this property will contain the epoch value in msec. (#1944)
|
||||||
- Added `trackId` (Android ExoPlayer) - Configure an identifier for the video stream to link the playback context to the events emitted. (#1944)
|
- Added `trackId` (Android ExoPlayer) - Configure an identifier for the video stream to link the playback context to the events emitted. (#1944)
|
||||||
- Reverted the JS fullscreening for Android. [#2013](https://github.com/react-native-community/react-native-video/pull/2013)
|
- Reverted the JS fullscreening for Android. [#2013](https://github.com/react-native-community/react-native-video/pull/2013)
|
||||||
|
- Set iOS request headers without needing to edit RCTVideo.m. [#2014](https://github.com/react-native-community/react-native-video/pull/2014)
|
||||||
|
|
||||||
### Version 5.1.0-alpha5
|
### Version 5.1.0-alpha5
|
||||||
|
|
||||||
|
@ -473,8 +473,6 @@ Platforms: iOS
|
|||||||
#### headers
|
#### headers
|
||||||
Pass headers to the HTTP client. Can be used for authorization. Headers must be a part of the source object.
|
Pass headers to the HTTP client. Can be used for authorization. Headers must be a part of the source object.
|
||||||
|
|
||||||
To enable this on iOS, you will need to manually edit RCTVideo.m and uncomment the header code in the playerItemForSource function. This is because the code used a private API and may cause your app to be rejected by the App Store. Use at your own risk.
|
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
```
|
```
|
||||||
source={{
|
source={{
|
||||||
|
@ -497,13 +497,10 @@ static int const RCTVideoUnset = -1;
|
|||||||
NSMutableDictionary *assetOptions = [[NSMutableDictionary alloc] init];
|
NSMutableDictionary *assetOptions = [[NSMutableDictionary alloc] init];
|
||||||
|
|
||||||
if (isNetwork) {
|
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"];
|
NSDictionary *headers = [source objectForKey:@"requestHeaders"];
|
||||||
if ([headers count] > 0) {
|
if ([headers count] > 0) {
|
||||||
[assetOptions setObject:headers forKey:@"AVURLAssetHTTPHeaderFieldsKey"];
|
[assetOptions setObject:headers forKey:@"AVURLAssetHTTPHeaderFieldsKey"];
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
NSArray *cookies = [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookies];
|
NSArray *cookies = [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookies];
|
||||||
[assetOptions setObject:cookies forKey:AVURLAssetHTTPCookiesKey];
|
[assetOptions setObject:cookies forKey:AVURLAssetHTTPCookiesKey];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user