MediaPlaylistInterceptor
public protocol MediaPlaylistInterceptor : AnyObject
MediaPlaylistInterceptor API (Experimental)
This API provides access to the HLS manifest through method callbacks.
Remark
The experimental APIs can make their way into THEOplayer
production APIs some day, but not guaranteed.
Experimental APIs can be broken between minor or even between patch releases too.
Relying on them in production systems can be dangerous.
Since
v9.9.0
-
Called to check, if certain playlist request types have to be intercepted.
Declaration
Swift
func shouldInterceptPlaylistRequest(type: HlsPlaylistType) -> Bool
Return Value
Return TRUE, if a certain playlist requests type has to be intercepted.
-
Called to check, if certain playlist response types have to be intercepted.
Declaration
Swift
func shouldInterceptPlaylistResponse(type: HlsPlaylistType) -> Bool
Return Value
Return TRUE, if a certain playlist response type has to be intercepted.
-
didInterceptPlaylistRequest(type:
Asynchronousrequest: ) Called when the certain playlist request is intercepted.
Declaration
Swift
func didInterceptPlaylistRequest(type: HlsPlaylistType, request: URLRequest) async throws -> URLRequest
Return Value
Manipulated request, if needed. If no manipulation is needed, just return the
urlRequest
. -
Called when the certain playlist response is intercepted.
Declaration
Swift
func didInterceptPlaylistResponse(type: HlsPlaylistType, url: URL, response: URLResponse, data: Data) async throws -> Data
Return Value
Response data. If no manipulation is needed, just return the
data
. -
Called when a certain URLRequest is failed.
Declaration
Swift
func failedToPerformURLRequest(request: URLRequest, response: URLResponse)