diff --git a/docs/guide/reading-media-files.md b/docs/guide/reading-media-files.md index 0907efa..ef2a7b6 100644 --- a/docs/guide/reading-media-files.md +++ b/docs/guide/reading-media-files.md @@ -643,7 +643,11 @@ const source = new UrlSource('https://example.com/bigbuckbunny.mp4', { }); ``` -All `requestInit` fields are respected except for `signal` and `headers.Range`, which are overridden by Mediabunny. The same applies to the `signal` and `headers.Range` values of a `Request` passed as the first constructor argument. To cancel ongoing requests, [dispose of the input](#disposing-inputs). +::: info +All `requestInit` fields are respected except for `signal` and `headers.Range`, which are overridden by Mediabunny. The same applies to the `signal` and `headers.Range` values of a `Request` passed as the first constructor argument. + +To cancel ongoing requests, [dispose of the input](#disposing-inputs). To load a specific range of the resource, create the `UrlSource` first and then call [`.slice()`](../api/Source#slice). +::: `getRetryDelay` can be used to control the retry logic used should a request fail. When a request fails, `getRetryDelay` should return the time to wait in seconds before the request will be retried. Returning `null` prevents further retries. ```ts diff --git a/src/source.ts b/src/source.ts index 434a0b1..eb5991d 100644 --- a/src/source.ts +++ b/src/source.ts @@ -675,10 +675,13 @@ export type UrlSourceOptions = { * The [`RequestInit`](https://developer.mozilla.org/en-US/docs/Web/API/RequestInit) used by the Fetch API. Can be * used to further control the requests, such as setting custom headers. * - * All fields will work except for `signal` and `headers.Range`; these will be overridden by Mediabunny. If you want - * to cancel ongoing requests, use {@link Input.dispose}. + * The `signal` field is not available, as Mediabunny controls request cancellation internally. If you want to + * cancel ongoing requests, use {@link Input.dispose}. + * + * The `headers.Range` field will also be overridden by Mediabunny. For loading a ranged remote resource, create the + * source, then call {@link Source.slice}. */ - requestInit?: RequestInit; + requestInit?: Omit; /** * A function that returns the delay (in seconds) before retrying a failed request. The function is called