Omit 'signal', clarify docs for reading ranged resources (#387)

This commit is contained in:
Vanilagy
2026-06-01 22:00:39 +02:00
parent 5799cdf630
commit c6c768d93e
2 changed files with 11 additions and 4 deletions
+5 -1
View File
@@ -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