Indicates whether Peer-to-Peer (P2P) functionality is disabled for the stream. If set to true, P2P 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.
https://developer.mozilla.org/en-US/docs/Web/API/RTCConfiguration
{
"rtcConfig": {
"iceServers": [
{ "urls": "stun:stun.l.google.com:19302" },
{ "urls": "stun:global.stun.twilio.com:3478" }
]
}
}
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
swarmOptional 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
validateOptional function to validate a P2P segment before fully integrating it into the playback buffer.
URL of the segment to validate.
Optional
byteRange: ByteRangeOptional byte range of the segment.
A promise that resolves with a boolean indicating if the segment is valid.
Optional
httpOptional 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.