@objcMembers @objc(BMPNetworkConfig) public class NetworkConfig : NSObject
The network config gives the ability to influence network requests. At the moment only changing DRM and HLS Playlist requests are supported. Processing responses or influencing the retry behaviour is not supported.
Type definition for the handler that needs to be called if a retry should happen.
public typealias RetryHandler = (_ retryDelay: TimeInterval, _ request: HttpRequest) -> Void
The delay in seconds before the retry should happen.
The request that should be done to retry the failed request. It can be the same as the failed request or a modified version of it.
Type definition for the handler that needs to be called if no retry should happen.
public typealias AbortHandler = () -> Void
Type definition for the handler that allows implementing a custom retry behaviour for failed HTTP requests.
The type of the failed request.
The number of the current retry attempt.
The response of the failed request. It contains a reference to the failed request.
Handler that needs to be called if a retry should happen.
Handler that needs to be called if no retry should happen.
Called before a HTTP request is made.
Only changing DRM and HLS Playlist requests are currently supported.
public weak var preprocessHttpRequestDelegate: PreprocessHttpRequestDelegate?
Called when an HLS playlist request has failed. Will override the default retry behaviour.
If a custom
retryHttpRequesthandler is set, no internal retry handling is done at all. The custom handler needs to take care of all retries. Some things to consider when implementing an own handler are:
- Make sure to have a maximum number of allowed retries to not retry unreasonable amount of times.
- There is an underlying
AVFoundationlimit of about 20 seconds for doing retries. If a failed request is not retried successfully within that time, there will be an error. Within that time frame, the amount of retries that can be done is unlimited.
public var retryHttpRequest: RetryHttpRequestHandler?