Controls whether peer-to-peer uploading is disabled for the stream.
If true, the stream will only download segments and will not upload to other peers.
Controls whether all peer-to-peer functionality is disabled for the stream.
Defines the duration of the time window (in seconds) during which segments are preemptively loaded to ensure smooth playback. This window prioritizes the fetching of media segments that will be played imminently.
Defines the time window (in seconds) for HTTP segment downloads. This property specifies the duration over which media segments are preemptively fetched using HTTP requests.
To achieve a higher P2P ratio, it is recommended to set httpDownloadTimeWindow 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.
The delay (in milliseconds) before falling back to HTTP for the very first segments.
This allows the tracker time to discover peers when playback first begins.
A higher value provides a better opportunity to download initial segments via P2P, thereby improving the overall P2P ratio.
However, setting this value too high can increase playback startup time or stall playback if peers are not immediately available.
If set to 0, the HTTP fallback will occur immediately.
Defines the time window (in seconds) dedicated to preemptively fetching media segments via Peer-to-Peer (P2P) downloads. This duration determines how much content is downloaded in advance via P2P connections to ensure smooth playback and reduce reliance on HTTP downloads.
To achieve a higher P2P ratio, it is recommended to set this time window higher than httpDownloadTimeWindow to maximize P2P usage.
The maximum number of simultaneous HTTP downloads allowed.
The maximum number of simultaneous P2P downloads allowed.
The maximum message size for WebRTC communications, in bytes.
The timeout duration (in milliseconds) for not receiving bytes from a P2P connection.
The timeout duration (in milliseconds) before destroying the P2P loader if it remains inactive.
The timeout duration (in milliseconds) for not receiving bytes from an HTTP download.
The number of retries allowed following an HTTP error.
The number of retries allowed following a P2P error.
A 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 utilized. Safari has known issues with multiple trackers, which can lead to problems sending SDP messages during WebRTC signaling.
The configuration for the RTC layer, utilized during WebRTC communication. This configuration specifies the STUN/TURN servers used by WebRTC to establish connections through NATs and firewalls.
OptionalswarmAn optional unique identifier for the swarm, used to isolate peer pools by media stream. If left undefined, the manifest URL will be used as the swarm ID.
OptionalvalidateAn optional function to validate a P2P segment before fully integrating it into the playback buffer.
The URL of the segment to validate.
The optional byte range of the segment.
The downloaded segment data.
A promise that resolves to a boolean indicating whether the segment is valid.
OptionalvalidateAn optional function to validate an HTTP segment before fully integrating it into the playback buffer.
The URL of the segment to validate.
The optional byte range of the segment.
The downloaded segment data.
A promise that resolves to a boolean indicating whether the segment is valid.
OptionalhttpAn optional function to customize the setup of HTTP requests for segment downloads.
The URL of the segment.
The range of bytes requested for the segment.
An abort signal to cancel the request if needed (will be undefined if AbortController is not supported by the browser).
An additional byte range for partial requests, if required.
A promise that resolves to the configured request, or undefined if no customization is necessary.
The maximum number of active peer-to-peer connections for the stream. If this limit is reached, the client will stop accepting new incoming offers and cease requesting new peers from the tracker until the connection count drops.
The multiplier applied to p2pMaxPeers to determine the hard limit for accepting incoming connections.
To keep the P2P swarm healthy and well-mixed, incoming connection offers are accepted up to this hard limit,
and a background cleanup process will periodically prune the worst-performing peers if the total count exceeds p2pMaxPeers.
The interval (in milliseconds) at which the background churning process evaluates and prunes the worst-performing
peers if the total connection count exceeds p2pMaxPeers.
The duration (in milliseconds) of the grace period granted to new peers. During this time, newly connected peers are protected from being dropped by the churning logic, allowing them time to establish connections and prove their bandwidth.
The number of WebRTC offers to generate and send to the tracker per announce request. This controls how aggressively the client attempts to discover new peers.
The duration (in milliseconds) to keep a pending WebRTC offer alive while waiting for an answer from a remote peer.
The maximum duration (in milliseconds) to wait for ICE candidates to gather before sending an offer.
The maximum duration (in milliseconds) to wait for the actual RTCDataChannel to open after signaling has completed.
Configuration options for the Core functionality, including network and processing parameters.