This interface can be returned by sendHttpRequest if a custom network request implementation should be provided. The default implementation of the player uses XMLHttpRequest.

interface RequestController<T> {
    cancel(): void;
    getResponse(): Promise<HttpResponse<T>>;
    setProgressListener(listener): void;
}

Type Parameters

Methods

  • Is called by the player if it wants to cancel the current request (e.g. on seek)

    Returns void

  • Returns a Promise that resolves with the actual HttpResponse in case of a 2xx Success HTTP status code. For all other HTTP status codes, the Promise should reject with the HttpResponse.

    Returns Promise<HttpResponse<T>>

  • Provides the data transfer progress to the player (if available).

    Parameters

    • listener: ((requestProgress) => void)
        • (requestProgress): void
        • Parameters

          Returns void

    Returns void