Skip to content
Class

UrlSource

A source backed by a URL. This is useful for reading data from the network. Requests will be made using an optimized reading and prefetching pattern to minimize request count and latency.

Extends: PathedSource

Constructor

ts
constructor(
	url: string | URL | Request,
	options: UrlSourceOptions = {},
): UrlSource;

Creates a new UrlSource backed by the resource at the specified URL.

When passing a Request instance, note that the signal and headers.Range options will be overridden by Mediabunny. If you want to cancel ongoing requests, use Input.dispose.

See UrlSourceOptions.

Released under the Mozilla Public License 2.0.