@meshstream/p2p-web 1.0.4 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/player.d.ts CHANGED
@@ -81,6 +81,8 @@ export interface HlsP2pClientLike {
81
81
  statistics(): P2pStats;
82
82
  diagnostics(): Partial<P2pDiagnostics>;
83
83
  setP2pEnabled(enabled: boolean): void;
84
+ /** Replays the current HLS state when P2P is attached after CDN startup. */
85
+ activateExistingHls?(): void;
84
86
  dispose(): void;
85
87
  }
86
88
  export interface HlsLike {
@@ -121,10 +123,13 @@ export declare class MeshStreamHlsPlayer {
121
123
  private mode;
122
124
  private p2pEnabledOverride?;
123
125
  private readonly eventListeners;
126
+ private readonly p2pListenerBindings;
124
127
  /** Emits zero/CDN counters when bootstrap or P2P setup falls back to CDN. */
125
128
  private fallbackStatsTimer?;
126
129
  /** Counts CDN fragment traffic when bootstrap is still pending. */
127
130
  private readonly cdnStats;
131
+ /** CDN counters collected before a late P2P upgrade. */
132
+ private p2pStatsCdnBaseline;
128
133
  private cdnStatsHls?;
129
134
  private readonly cdnFragLoadingHandler;
130
135
  private readonly cdnFragLoadedHandler;
@@ -133,6 +138,7 @@ export declare class MeshStreamHlsPlayer {
133
138
  private readonly lifecycle;
134
139
  private startPromise?;
135
140
  private startResult?;
141
+ private bootstrapUpgradeTask?;
136
142
  constructor(options: MeshStreamHlsPlayerOptions);
137
143
  get p2pClient(): HlsP2pClientLike | undefined;
138
144
  get playbackMode(): MeshStreamPlaybackMode;
@@ -164,6 +170,13 @@ export declare class MeshStreamHlsPlayer {
164
170
  private createServiceWorkerP2pEngine;
165
171
  private resolveServiceWorkerSwarmId;
166
172
  private startCdnFallback;
173
+ private scheduleHlsP2pUpgrade;
174
+ /**
175
+ * Adds P2P to the HLS instance that is already playing from the CDN.
176
+ * The media element, source URL and buffered ranges are deliberately kept
177
+ * intact; a late control-plane response must never restart playback.
178
+ */
179
+ private upgradeExistingHlsSession;
167
180
  private bindCdnStats;
168
181
  private unbindCdnStats;
169
182
  private attachHls;
package/dist/version.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  /** SDK release identifier attached to all Web usage reports. */
2
- export declare const MESHSTREAM_WEB_SDK_VERSION = "1.0.4";
2
+ export declare const MESHSTREAM_WEB_SDK_VERSION = "1.0.5";
3
3
  /** Returns the version of the Web MeshStream SDK loaded by this page. */
4
4
  export declare function getSdkVersion(): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meshstream/p2p-web",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/Mesh-Stream/meshstream-p2p-web-sdk"