Controls if peer-to-peer upload is disabled for the stream.
If true, the stream only downloads segments without uploading to peers.
Controls whether peer-to-peer functionality is disabled for the stream.
Defines the duration of the time window, in seconds, during which segments are pre-loaded to ensure smooth playback. This window helps prioritize the fetching of media segments that are imminent to playback.
Defines the time window, in seconds, for HTTP segment downloads. This property specifies the duration over which media segments are pre-fetched using HTTP requests.
For a better P2P ratio, it is recommended to set this httpDownloadTimeWindow to be lower than p2pDownloadTimeWindow.
NOTE: This setting only takes effect if there is at least one peer connection and the connected peer does not have the requested segments available to share via P2P.
Time in milliseconds to delay the HTTP fallback for the very first segments.
This gives the tracker time to discover peers when playback just started.
A higher value gives a better chance to download the initial segments via P2P, thus improving the overall P2P ratio.
However, setting this value too high can increase the playback startup time or even stall the playback if peers are not immediately available.
If 0, HTTP fallback happens immediately.
Defines the time window, in seconds, dedicated to pre-fetching media segments via Peer-to-Peer (P2P) downloads. This duration determines how much content is downloaded in advance using P2P connections to ensure smooth playback and reduce reliance on HTTP downloads.
For a better P2P ratio, it is recommended to set this time window to be greater than httpDownloadTimeWindow to maximize P2P usage.
Maximum number of simultaneous HTTP downloads allowed.
Maximum number of simultaneous P2P downloads allowed.
Maximum message size for WebRTC communications, in bytes.
Timeout for not receiving bytes from P2P, in milliseconds.
Timeout for destroying the P2P loader if inactive, in milliseconds.
Timeout for not receiving bytes from HTTP downloads, in milliseconds.
Number of retries allowed after an HTTP error.
Number of retries allowed after a P2P error.
List of URLs to the WebTorrent trackers used for announcing and discovering peers (i.e. WebRTC signaling).
WARNING: In the Safari browser, only the first tracker will be used. Safari has issues with multiple trackers, leading to problems with sending SDP messages for WebRTC signaling.
Configuration for the RTC layer, used in WebRTC communication. This configuration specifies the STUN/TURN servers used by WebRTC to establish connections through NATs and firewalls.
Prefix to use for the WebTorrent client version in tracker communications. If undefined, the default version prefix is used, which is calculated based on the package version.
OptionalswarmOptional unique identifier for the swarm, used to isolate peer pools by media stream. If undefined, the URL of the manifest is used as the swarm ID.
OptionalvalidateOptional function to validate a P2P segment before fully integrating it into the playback buffer.
URL of the segment to validate.
Optional byte range of the segment.
Downloaded segment data.
A promise that resolves with a boolean indicating if the segment is valid.
OptionalvalidateOptional function to validate a HTTP segment before fully integrating it into the playback buffer.
URL of the segment to validate.
Optional byte range of the segment.
Downloaded segment data.
A promise that resolves with a boolean indicating if the segment is valid.
OptionalhttpOptional function to customize the setup of HTTP requests for segment downloads.
URL of the segment.
The range of bytes requested for the segment.
An abort signal to cancel the request if needed.
Additional byte range for partial requests, if required.
A promise that resolves with the configured request, or undefined if no customization should be made.
Configuration options for the Core functionality, including network and processing parameters.