diff --git a/docs/v1.0/assets/highlight.css b/docs/v1.0/assets/highlight.css index ae684ee1..7f3d87ba 100644 --- a/docs/v1.0/assets/highlight.css +++ b/docs/v1.0/assets/highlight.css @@ -5,22 +5,22 @@ --dark-hl-1: #D4D4D4; --light-hl-2: #A31515; --dark-hl-2: #CE9178; - --light-hl-3: #AF00DB; - --dark-hl-3: #C586C0; - --light-hl-4: #001080; - --dark-hl-4: #9CDCFE; - --light-hl-5: #0000FF; - --dark-hl-5: #569CD6; - --light-hl-6: #0070C1; - --dark-hl-6: #4FC1FF; - --light-hl-7: #800000; - --dark-hl-7: #808080; + --light-hl-3: #008000; + --dark-hl-3: #6A9955; + --light-hl-4: #AF00DB; + --dark-hl-4: #C586C0; + --light-hl-5: #001080; + --dark-hl-5: #9CDCFE; + --light-hl-6: #0000FF; + --dark-hl-6: #569CD6; + --light-hl-7: #0070C1; + --dark-hl-7: #4FC1FF; --light-hl-8: #800000; - --dark-hl-8: #569CD6; - --light-hl-9: #E50000; - --dark-hl-9: #9CDCFE; - --light-hl-10: #008000; - --dark-hl-10: #6A9955; + --dark-hl-8: #808080; + --light-hl-9: #800000; + --dark-hl-9: #569CD6; + --light-hl-10: #E50000; + --dark-hl-10: #9CDCFE; --light-hl-11: #000000FF; --dark-hl-11: #D4D4D4; --light-hl-12: #0000FF; diff --git a/docs/v1.0/classes/p2p_media_loader_core.Core.html b/docs/v1.0/classes/p2p_media_loader_core.Core.html index bf64b2d1..a017e6f3 100644 --- a/docs/v1.0/classes/p2p_media_loader_core.Core.html +++ b/docs/v1.0/classes/p2p_media_loader_core.Core.html @@ -157,7 +157,7 @@ --md-sys-color-surface-container-highest: #e9e1d9 }
Constructs a new Core instance with optional initial configuration.
Optional
config: Partial<CoreConfig>Optional partial configuration to override default settings.
-// Create a Core instance with custom configuration for HTTP and P2P downloads.
const core = new Core({
simultaneousHttpDownloads: 5,
simultaneousP2PDownloads: 5,
httpErrorRetries: 5,
p2pErrorRetries: 5
});
+
// Create a Core instance with custom configuration for HTTP and P2P downloads.
const core = new Core({
simultaneousHttpDownloads: 5,
simultaneousP2PDownloads: 5,
httpErrorRetries: 5,
p2pErrorRetries: 5
});
-// Create a Core instance using the default configuration.
const core = new Core();
+Example
// Create a Core instance using the default configuration.
const core = new Core();
-
Static
Readonly
DEFAULT_Default configuration for common core settings.
-Static
Readonly
DEFAULT_Default configuration for stream settings.
-Retrieves the current configuration for the core instance, ensuring immutability.
+Static
Readonly
DEFAULT_Default configuration for common core settings.
+Static
Readonly
DEFAULT_Default configuration for stream settings.
+Retrieves the current configuration for the core instance, ensuring immutability.
A deep readonly version of the core configuration.
-Applies a set of dynamic configuration updates to the core, merging with the existing configuration.
+Applies a set of dynamic configuration updates to the core, merging with the existing configuration.
A set of configuration changes to apply.
-// Example of dynamically updating the download time windows and timeout settings.
const dynamicConfig = {
httpDownloadTimeWindowMs: 60, // Set HTTP download time window to 60 seconds
p2pDownloadTimeWindowMs: 60, // Set P2P download time window to 60 seconds
httpNotReceivingBytesTimeoutMs: 1500, // Set HTTP timeout to 1500 milliseconds
p2pNotReceivingBytesTimeoutMs: 1500 // Set P2P timeout to 1500 milliseconds
};
core.applyDynamicConfig(dynamicConfig);
+
// Example of dynamically updating the download time windows and timeout settings.
const dynamicConfig = {
httpDownloadTimeWindowMs: 60, // Set HTTP download time window to 60 seconds
p2pDownloadTimeWindowMs: 60, // Set P2P download time window to 60 seconds
httpNotReceivingBytesTimeoutMs: 1500, // Set HTTP timeout to 1500 milliseconds
p2pNotReceivingBytesTimeoutMs: 1500 // Set P2P timeout to 1500 milliseconds
};
core.applyDynamicConfig(dynamicConfig);
-Adds an event listener for the specified event type on the core event target.
+Adds an event listener for the specified event type on the core event target.
The name of the event to listen for.
The callback function to invoke when the event is fired.
-Removes an event listener for the specified event type on the core event target.
+Removes an event listener for the specified event type on the core event target.
The name of the event to listen for.
The callback function to be removed.
-Retrieves a specific stream by its runtime identifier, if it exists.
+Retrieves a specific stream by its runtime identifier, if it exists.
The runtime identifier of the stream to retrieve.
The stream with its segments, or undefined
if not found.
Ensures a stream exists in the map; adds it if it does not.
+Ensures a stream exists in the map; adds it if it does not.
The stream to potentially add to the map.
-Updates the segments associated with a specific stream.
The runtime identifier of the stream to update.
Optional
addSegments: Iterable<Segment>Optional segments to add to the stream.
Optional
removeSegmentIds: Iterable<string>Optional segment IDs to remove from the stream.
-Loads a segment given its runtime identifier and invokes the provided callbacks during the process. Initializes segment storage if it has not been initialized yet.
The runtime identifier of the segment to load.
The callbacks to be invoked during segment loading.
Updates the playback parameters while play head moves, specifically position and playback rate, for stream loaders.
+Sets the active level bitrate, used for adjusting quality levels in adaptive streaming. +
Identify if a segment is loadable by the P2P core based on the segment's stream type and configuration.
+Identify if a segment is loadable by the P2P core based on the segment's stream type and configuration.
Segment runtime identifier to check.
true
if the segment is loadable by the P2P core, otherwise false
.
Cleans up resources used by the Core instance, including destroying any active stream loaders +
Custom error class for errors that occur during core network requests.
-Constructs a new CoreRequestError.
The type of the error, either 'failed' or 'aborted'.
-Readonly
typeThe type of the error, either 'failed' or 'aborted'.
-Represents an error that can occur during the request process, with a timestamp for when the error occurred.
The specific type of request error.
-Constructs a new RequestError.
The specific error type.
Optional
message: stringOptional message describing the error.
-Readonly
timestampError timestamp.
-Readonly
typeThe specific error type.
-Represents a range of bytes, used for specifying a segment of data to download.
The starting byte index of the range.
The ending byte index of the range.
-Represents the configuration for the Core functionality that is common to all streams.
Optional
cachedTime after which a cached segment expires, in seconds. If set to undefined, the cacheSegmentExpiration is disabled for VOD streams, and a default value (20 minutes) is used for live streams.
-cachedSegmentExpiration: undefined
+
cachedSegmentExpiration: undefined
Maximum number of segments to store in the cache. Has to be less then httpDownloadTimeWindow and p2pDownloadTimeWindow. If set to 0, the cache is unlimited.
cachedSegmentsCount: 0
-Represents a defined Core configuration with specific settings for the main and secondary streams.
Configuration for the main stream.
Configuration for the secondary stream.
-Specifies the source of a download within a media streaming context.
"http" - Indicates that the segment was downloaded using the HTTP protocol.
"p2p"- Indicates that the segment was downloaded through a peer-to-peer network.
-Represents a dynamically modifiable configuration, allowing updates to selected CoreConfig properties at runtime.
Optional
mainOptional dynamic configuration for the main stream.
Optional
secondaryOptional dynamic configuration for the secondary stream.
-const dynamicConfig: DynamicCoreConfig = {
core: {
cachedSegmentsCount: 200,
},
mainStream: {
swarmId: "custom swarm ID for video stream",
p2pDownloadTimeWindow: 6000,
},
secondaryStream: {
swarmId: "custom swarm ID for audio stream",
p2pDownloadTimeWindow: 3000,
}
};
+
const dynamicConfig: DynamicCoreConfig = {
core: {
cachedSegmentsCount: 200,
},
mainStream: {
swarmId: "custom swarm ID for video stream",
p2pDownloadTimeWindow: 6000,
},
secondaryStream: {
swarmId: "custom swarm ID for audio stream",
p2pDownloadTimeWindow: 3000,
}
};
-Represents a set of properties that can be dynamically modified at runtime.
-Defines the types of errors specific to HTTP requests.
-Represents the details of a peer in a peer-to-peer network.
The unique identifier for a peer in the network.
-Defines the types of errors specific to peer-to-peer requests.
-Defines the types of errors that can occur during a request abortion process.
-Enumerates all possible request error types, including HTTP and peer-related errors.
-Represents the response from a segment request, including the data and measured bandwidth.
Segment data as an ArrayBuffer.
Measured bandwidth for the segment download, in bytes per second.
-Extends a Segment with a reference to its associated stream.
-Readonly
stream: StreamWithSegments<TStream>Configuration options for the Core functionality, including network and processing parameters.
Indicates whether Peer-to-Peer (P2P) functionality is disabled for the stream. If set to true, P2P functionality is disabled for the stream.
-isP2PDisabled: false
+
isP2PDisabled: false
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.
@@ -212,27 +212,27 @@{
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.
-trackerClientVersionPrefix: undefined
+
trackerClientVersionPrefix: undefined
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.
-swarmId: undefined
+
swarmId: undefined
Optional
validateOptional function to validate a P2P segment before fully integrating it into the playback buffer.
A promise that resolves with a boolean indicating if the segment is valid.
-validateP2PSegment: undefined
+Default
validateP2PSegment: undefined
URL of the segment to validate.
Optional
byteRange: ByteRangeOptional byte range of the segment.
Optional
httpOptional function to customize the setup of HTTP requests for segment downloads.
A promise that resolves with the configured request, or undefined if no customization should be made.
-httpRequestSetup: undefined
+Default
httpRequestSetup: undefined
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.
-Represents the types of streams available, either primary (main) or secondary.
-Represents a stream that includes multiple segments, each associated with the stream.
Readonly
segments: Map<string, SegmentWithStream<TStream>>Type for specifying dynamic configuration options that can be changed at runtime for the P2P engine's core.
Optional
core?: DynamicCoreConfigDynamic core config
-Represents the complete configuration for HlsJsP2PEngine.
Core config
-Configuration type for HLS instances that includes P2P settings, augmenting standard HLS configuration with P2P capabilities.
Optional
p2p?: PartialHlsJsP2PEngineConfig & { Extends a generic HLS type to include the P2P engine, integrating P2P capabilities directly into the HLS instance.
Readonly
p2pHlsJsP2PEngine instance
-Allows for partial configuration of HlsJsP2PEngine, useful for providing overrides or partial updates.
Optional
core?: Partial<CoreConfig>Partial core config
-Type for specifying dynamic configuration options that can be changed at runtime for the P2P engine's core.
Optional
core?: DynamicCoreConfigDynamic core config
-Allows for partial configuration settings for the Shaka P2P Engine.
Optional
core?: Partial<CoreConfig>Partial core config
-Represents the complete configuration for ShakaP2PEngine.
Core config
-
Core class for managing media streams loading via P2P.
-