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.
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.
Optional
swarmId?: stringOptional 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.
Optional
validateP2PSegment?: (Optional function to validate a P2P segment before fully integrating it into the playback buffer.
Optional
validateHTTPSegment?: (Optional function to validate a HTTP segment before fully integrating it into the playback buffer.
Optional
httpRequestSetup?: (Optional function to customize the setup of HTTP requests for segment downloads.
Configuration options for the Core functionality, including network and processing parameters.