Customer HTTP Header
To test this feature and view the example code, please see the Apple (FPS) SDK 5 Example Code Quick Start guide.
The CONNECT Player SDK supports customer HTTP header for the streaming. It’s utilized by the Apple’s AVURLAsset initialization options: https://developer.apple.com/documentation/avfoundation/avurlasset-initialization-options
The client application handles the initialization of the OTVAVURLAsset and put the corresponding options.
Configuring the player for customer HTTP headers
Configuration of the player is described in the Apple (FPS) SDK 5 Integration Guide.
For the options of customer HTTP headers, configure the OTVAVURLAsset as follows:
// Initialize the AVURLAsset with the options
// Select which option needed for the HTTP request
let asset = OTVAVURLAsset(url: assetURL, options: assetOptions)
// Create an AVPlayerItem for playback
let playerItem = OTVAVPlayerItem(asset: asset)
// initialise the player by passing in the playerItem.
otvPlayer = OTVAVPlayer(playerItem: (playerItem))
You need to decide which option/options to use. Refer the Apple’s documentation above for public options.
Connect Player verified the following options:
AVURLAssetHTTPCookiesKey - > add cookie in http header
AVURLAssetHTTPUserAgentKey(iOS 16+) -> overwrite user agent in http header
AVURLAssetHTTPHeaderFieldsKey -> Add customer header, not public API, may be deprecated, still usable, risk of publish to App store