stormcloud-video-player 0.8.73 → 0.8.75
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/README.md +10 -70
- package/dist/stormcloud-vp.min.js +1 -1
- package/lib/Player.d.cts +2 -1
- package/lib/StormcloudPlayer.cjs +988 -273
- package/lib/StormcloudPlayer.cjs.map +1 -1
- package/lib/StormcloudPlayer.d.cts +1 -0
- package/lib/index.cjs +999 -278
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +1 -0
- package/lib/index.d.ts +40 -3
- package/lib/index.js +992 -279
- package/lib/index.js.map +1 -1
- package/lib/player/AdBreakOrchestrator.cjs +767 -67
- package/lib/player/AdBreakOrchestrator.cjs.map +1 -1
- package/lib/player/AdBreakOrchestrator.d.cts +7 -9
- package/lib/player/AdConfigManager.cjs +315 -62
- package/lib/player/AdConfigManager.cjs.map +1 -1
- package/lib/player/AdConfigManager.d.cts +7 -12
- package/lib/player/AdTimingService.cjs +37 -1
- package/lib/player/AdTimingService.cjs.map +1 -1
- package/lib/player/AdTimingService.d.cts +8 -1
- package/lib/player/EdgePodRequest.d.cts +1 -0
- package/lib/player/FloorLadder.d.cts +1 -0
- package/lib/player/HlsEngine.d.cts +1 -0
- package/lib/player/OptimizedPodRequest.cjs +719 -0
- package/lib/player/OptimizedPodRequest.cjs.map +1 -0
- package/lib/player/OptimizedPodRequest.d.cts +101 -0
- package/lib/player/PlayerControls.d.cts +1 -0
- package/lib/player/Scte35CueManager.d.cts +1 -0
- package/lib/player/Scte35Parser.d.cts +1 -0
- package/lib/player/StormcloudVideoPlayer.cjs +988 -273
- package/lib/player/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/player/StormcloudVideoPlayer.d.cts +1 -0
- package/lib/player/playerTypes.d.cts +1 -0
- package/lib/players/HlsPlayer.cjs +988 -273
- package/lib/players/HlsPlayer.cjs.map +1 -1
- package/lib/players/HlsPlayer.d.cts +1 -0
- package/lib/players/index.cjs +988 -273
- package/lib/players/index.cjs.map +1 -1
- package/lib/props.d.cts +1 -0
- package/lib/sdk/hlsAdPlayer.cjs +316 -51
- package/lib/sdk/hlsAdPlayer.cjs.map +1 -1
- package/lib/sdk/hlsAdPlayer.d.cts +3 -1
- package/lib/sdk/pal.cjs +108 -83
- package/lib/sdk/pal.cjs.map +1 -1
- package/lib/sdk/pal.d.cts +1 -0
- package/lib/types.d.cts +9 -2
- package/lib/ui/StormcloudVideoPlayer.cjs +991 -278
- package/lib/ui/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/ui/StormcloudVideoPlayer.d.cts +1 -0
- package/lib/utils/ctvVastSignals.cjs +9 -7
- package/lib/utils/ctvVastSignals.cjs.map +1 -1
- package/lib/utils/tracking.cjs +17 -3
- package/lib/utils/tracking.cjs.map +1 -1
- package/lib/utils/tracking.d.cts +2 -1
- package/lib/utils/vastEnvironmentSignals.cjs +9 -7
- package/lib/utils/vastEnvironmentSignals.cjs.map +1 -1
- package/lib/utils/vastMacros.cjs +251 -10
- package/lib/utils/vastMacros.cjs.map +1 -1
- package/lib/utils/vastMacros.d.cts +13 -4
- package/package.json +5 -3
package/README.md
CHANGED
|
@@ -44,7 +44,6 @@ function MyVideoApp() {
|
|
|
44
44
|
hideLoadingIndicator={false} // Hide the built-in loading spinner
|
|
45
45
|
allowNativeHls={true} // Allow native HLS for better performance
|
|
46
46
|
licenseKey="your_license_key_here"
|
|
47
|
-
vastMode="adstorm" // AdStorm VAST endpoint resolution
|
|
48
47
|
isVmap={true}
|
|
49
48
|
vmapUrl="https://your-cdn.com/ads.vmap" // Optional VMAP manifest for scheduled breaks
|
|
50
49
|
style={{ width: "100%", aspectRatio: "16/9" }}
|
|
@@ -84,7 +83,6 @@ function MyVideoApp() {
|
|
|
84
83
|
showCustomControls={true}
|
|
85
84
|
hideLoadingIndicator={false}
|
|
86
85
|
licenseKey="your_license_key_here"
|
|
87
|
-
vastMode="adstorm" // Use AdStorm mode (or omit for default mode)
|
|
88
86
|
vmapUrl="https://your-cdn.com/ads.vmap" // Optional: VMAP manifest URL
|
|
89
87
|
onReady={(player) => {
|
|
90
88
|
console.log("Player is ready!", player);
|
|
@@ -125,7 +123,6 @@ const player = new StormcloudVideoPlayer({
|
|
|
125
123
|
lowLatencyMode: false, // Set to true for live streams
|
|
126
124
|
driftToleranceMs: 3000, // Drift tolerance for live streams
|
|
127
125
|
licenseKey: "your_license_key_here",
|
|
128
|
-
vastMode: "default", // "adstorm" | "default"
|
|
129
126
|
vmapUrl: "https://your-cdn.com/ads.vmap", // Optional VMAP manifest for scheduled ad breaks
|
|
130
127
|
onVolumeToggle: () => console.log("Volume toggled"),
|
|
131
128
|
onFullscreenToggle: () => console.log("Fullscreen toggled"),
|
|
@@ -280,7 +277,6 @@ interface StormcloudPlayerProps {
|
|
|
280
277
|
minSegmentsBeforePlay?: number; // Number of segments to buffer before starting playback (default: 2)
|
|
281
278
|
|
|
282
279
|
// Ad player configuration
|
|
283
|
-
vastMode?: 'adstorm' | 'default'; // VAST endpoint resolution: 'adstorm' (/vast/{licenseKey}) or 'default' (/ads/web or vastTagUrl) (default: 'default')
|
|
284
280
|
vastTagUrl?: string; // Custom VAST tag URL (default mode; when omitted, /ads/web supplies the tag URL)
|
|
285
281
|
isVmap?: boolean; // Enable VMAP manifest scheduling (requires vmapUrl)
|
|
286
282
|
vmapUrl?: string; // VMAP 1.0 manifest URL for pre/mid/post-roll ad breaks (requires isVmap: true)
|
|
@@ -373,7 +369,6 @@ interface StormcloudVideoPlayerConfig {
|
|
|
373
369
|
maxAdBreakExtensionMs?: number; // Max time an ad break may be extended past its SCTE-35 duration when ads are still playing/queued (default: 60000)
|
|
374
370
|
|
|
375
371
|
// Ad configuration
|
|
376
|
-
vastMode?: 'adstorm' | 'default'; // VAST endpoint resolution: 'adstorm' (/vast/{licenseKey}) or 'default' (/ads/web or vastTagUrl) (default: 'default')
|
|
377
372
|
vastTagUrl?: string; // Custom VAST tag URL (default mode; when omitted, /ads/web supplies the tag URL)
|
|
378
373
|
isVmap?: boolean; // Enable VMAP manifest scheduling (requires vmapUrl)
|
|
379
374
|
vmapUrl?: string; // VMAP 1.0 manifest URL (requires isVmap: true)
|
|
@@ -439,13 +434,9 @@ All controls use a consistent high-contrast design:
|
|
|
439
434
|
|
|
440
435
|
## 🎬 Ad Integration (HLS Streams Only)
|
|
441
436
|
|
|
442
|
-
### VAST
|
|
437
|
+
### VAST Tag Configuration
|
|
443
438
|
|
|
444
|
-
The player always uses the **HLS ad player** to fetch VAST XML and play ad media (HLS or progressive). The `
|
|
445
|
-
|
|
446
|
-
#### 1. **AdStorm Mode** (Recommended)
|
|
447
|
-
|
|
448
|
-
Uses the AdStorm `/vast/{licenseKey}` endpoint, which returns VAST XML directly:
|
|
439
|
+
The player always uses the **HLS ad player** to fetch VAST XML and play ad media (HLS or progressive). The VAST tag URL comes from a custom `vastTagUrl` or, if none is provided, from the Stormcloud `/ads/web` API:
|
|
449
440
|
|
|
450
441
|
```javascript
|
|
451
442
|
const player = new StormcloudVideoPlayer({
|
|
@@ -453,44 +444,6 @@ const player = new StormcloudVideoPlayer({
|
|
|
453
444
|
src: "https://your-stream.com/playlist.m3u8",
|
|
454
445
|
licenseKey: "your-license-key",
|
|
455
446
|
|
|
456
|
-
vastMode: 'adstorm',
|
|
457
|
-
|
|
458
|
-
debugAdTiming: true,
|
|
459
|
-
});
|
|
460
|
-
```
|
|
461
|
-
|
|
462
|
-
**What happens:**
|
|
463
|
-
- 🔗 VAST endpoint: `GET https://adstorm.co/api-adstorm-dev/adstorm/vast/{licenseKey}`
|
|
464
|
-
- License key is passed in the URL path (no authorization header needed)
|
|
465
|
-
- Returns VAST XML directly with HLS media files
|
|
466
|
-
- 📊 Direct tracking and analytics through AdStorm backend
|
|
467
|
-
- ⚠️ Gracefully handles "no ads available" scenarios (logs warnings, not errors)
|
|
468
|
-
|
|
469
|
-
**API Flow:**
|
|
470
|
-
1. Player calls `/vast/{licenseKey}` endpoint
|
|
471
|
-
2. Backend returns VAST XML with HLS media files
|
|
472
|
-
3. HLS ad player parses VAST XML and extracts MediaFile URLs
|
|
473
|
-
4. Ad segments are loaded and played
|
|
474
|
-
|
|
475
|
-
**Benefits:**
|
|
476
|
-
- ✅ Zero external ad SDK dependencies
|
|
477
|
-
- ✅ Full control over ad serving
|
|
478
|
-
- ✅ Native HLS playback (same format as content)
|
|
479
|
-
- ✅ Better performance and reliability on Smart TVs
|
|
480
|
-
- ✅ Custom targeting and selection
|
|
481
|
-
- ✅ Proper error handling (distinguishes parsing errors from "no ads available")
|
|
482
|
-
|
|
483
|
-
#### 2. **Default Mode**
|
|
484
|
-
|
|
485
|
-
Uses the AdStorm `/ads/web` API (or a custom `vastTagUrl`) to obtain a VAST tag URL, then plays ads through the same HLS ad player:
|
|
486
|
-
|
|
487
|
-
```javascript
|
|
488
|
-
const player = new StormcloudVideoPlayer({
|
|
489
|
-
videoElement: video,
|
|
490
|
-
src: "https://your-stream.com/playlist.m3u8",
|
|
491
|
-
licenseKey: "your-license-key",
|
|
492
|
-
|
|
493
|
-
vastMode: 'default', // or omit this property entirely
|
|
494
447
|
vastTagUrl: 'https://your-vast-server.com/vast.xml', // optional
|
|
495
448
|
|
|
496
449
|
debugAdTiming: true,
|
|
@@ -500,7 +453,7 @@ const player = new StormcloudVideoPlayer({
|
|
|
500
453
|
**What happens:**
|
|
501
454
|
- 🔗 VAST tag URL resolution:
|
|
502
455
|
1. If `vastTagUrl` is provided, uses that URL directly
|
|
503
|
-
2. Otherwise, calls `GET https://
|
|
456
|
+
2. Otherwise, calls `GET https://edge.stormcloudhub.com/api/v1/adstorm/ads/web`
|
|
504
457
|
- Requires `Authorization: Bearer {licenseKey}` header
|
|
505
458
|
- Returns JSON with a VAST tag URL in `response.ima["publisherdesk.ima"].payload`
|
|
506
459
|
- 📊 HLS ad player fetches VAST XML from the resolved tag URL and plays returned media files
|
|
@@ -515,7 +468,7 @@ const player = new StormcloudVideoPlayer({
|
|
|
515
468
|
- ✅ Industry-standard VAST tag URLs (e.g. Google Ad Manager)
|
|
516
469
|
- ✅ Backward compatible with existing AdStorm `/ads/web` integrations
|
|
517
470
|
- ✅ Supports both custom VAST URLs and AdStorm backend configuration
|
|
518
|
-
- ✅
|
|
471
|
+
- ✅ Native HLS playback (same format as content)
|
|
519
472
|
|
|
520
473
|
### Ad Pod Generation (Multiple Consecutive Ads)
|
|
521
474
|
|
|
@@ -577,7 +530,6 @@ const player = new StormcloudVideoPlayer({
|
|
|
577
530
|
src: "https://your-live-stream.com/playlist.m3u8",
|
|
578
531
|
licenseKey: "your-license-key",
|
|
579
532
|
|
|
580
|
-
vastMode: 'default',
|
|
581
533
|
debugAdTiming: true, // Enable to see adaptive calculations
|
|
582
534
|
});
|
|
583
535
|
```
|
|
@@ -649,7 +601,6 @@ const player = new StormcloudVideoPlayer({
|
|
|
649
601
|
src: "https://your-stream.com/video.m3u8",
|
|
650
602
|
licenseKey: "your-license-key",
|
|
651
603
|
|
|
652
|
-
vastMode: 'default',
|
|
653
604
|
isVmap: true,
|
|
654
605
|
vmapUrl: 'https://your-cdn.com/schedule.vmap', // VMAP 1.0 manifest
|
|
655
606
|
|
|
@@ -721,7 +672,7 @@ The VMAP parser recognizes all standard `timeOffset` values:
|
|
|
721
672
|
|
|
722
673
|
**Benefits:**
|
|
723
674
|
- ✅ Declarative ad scheduling — no custom code needed per break
|
|
724
|
-
- ✅ Works alongside `
|
|
675
|
+
- ✅ Works alongside `vastTagUrl` and the `/ads/web` configuration
|
|
725
676
|
- ✅ Supports pre-roll, mid-roll, percentage-based, and post-roll breaks
|
|
726
677
|
- ✅ Gracefully handles malformed XML and fetch failures (logged when `debugAdTiming` is enabled)
|
|
727
678
|
|
|
@@ -730,14 +681,10 @@ The VMAP parser recognizes all standard `timeOffset` values:
|
|
|
730
681
|
All ads are played through the built-in **HLS ad player** (`createHlsAdPlayer`).
|
|
731
682
|
|
|
732
683
|
The player:
|
|
733
|
-
1. Resolves a VAST tag URL (`
|
|
684
|
+
1. Resolves a VAST tag URL (`vastTagUrl`, VMAP, or `/ads/web`)
|
|
734
685
|
2. Fetches and parses VAST XML (including wrapper chains)
|
|
735
686
|
3. Plays HLS or progressive `MediaFile` URLs from the VAST response
|
|
736
687
|
|
|
737
|
-
`vastMode` only changes how the initial VAST tag URL is obtained:
|
|
738
|
-
- `vastMode: 'adstorm'` → `/vast/{licenseKey}` returns VAST XML directly (used as the tag URL for pod generation)
|
|
739
|
-
- `vastMode: 'default'` → `/ads/web` or `vastTagUrl` supplies the tag URL; the HLS ad player fetches VAST from that URL
|
|
740
|
-
|
|
741
688
|
### SCTE-35 Support
|
|
742
689
|
|
|
743
690
|
The HlsPlayer automatically detects and responds to SCTE-35 signals embedded in HLS streams:
|
|
@@ -881,7 +828,6 @@ Example with error handling:
|
|
|
881
828
|
```javascript
|
|
882
829
|
const player = new StormcloudVideoPlayer({
|
|
883
830
|
// ... config
|
|
884
|
-
vastMode: 'adstorm',
|
|
885
831
|
debugAdTiming: true, // Enable detailed logging
|
|
886
832
|
});
|
|
887
833
|
|
|
@@ -905,14 +851,11 @@ const player = new StormcloudVideoPlayer({
|
|
|
905
851
|
|
|
906
852
|
Authenticated requests are sent to:
|
|
907
853
|
|
|
908
|
-
- **
|
|
909
|
-
-
|
|
910
|
-
|
|
911
|
-
- **Default Mode** (`vastMode: 'default'`):
|
|
912
|
-
- Ad configuration: `GET https://adstorm.co/api-adstorm-dev/adstorm/ads/web` (requires `Authorization: Bearer {licenseKey}` header)
|
|
854
|
+
- **Ad Configuration**:
|
|
855
|
+
- Ad configuration: `GET https://edge.stormcloudhub.com/api/v1/adstorm/ads/web` (requires `Authorization: Bearer {licenseKey}` header)
|
|
913
856
|
- Returns JSON with a VAST tag URL in `response.ima["publisherdesk.ima"].payload`
|
|
914
857
|
|
|
915
|
-
- **Player Tracking
|
|
858
|
+
- **Player Tracking**:
|
|
916
859
|
- Metrics / heartbeat: `POST https://player-analytics-ingest-api-760490581852.us-central1.run.app/api/adstorm/player-tracking/metrics/ingest` (requires `Authorization: License-Key {licenseKey}` header)
|
|
917
860
|
- Ad impressions: `POST https://player-analytics-ingest-api-760490581852.us-central1.run.app/api/adstorm/player-tracking/impressions/ingest` (requires `Authorization: License-Key {licenseKey}` header)
|
|
918
861
|
- Ad-detect, ad-loaded, and ad-impression events are automatically emitted during ad breaks.
|
|
@@ -1344,15 +1287,12 @@ Built with ❤️ by the Stormcloud team
|
|
|
1344
1287
|
### What's New in v0.3
|
|
1345
1288
|
|
|
1346
1289
|
- 🎬 **Custom HLS Ad Player**: Native HLS ad playback with VAST XML parsing
|
|
1347
|
-
- 🎯 **VAST Tag Resolution**:
|
|
1290
|
+
- 🎯 **VAST Tag Resolution**: `/ads/web` or custom `vastTagUrl`
|
|
1348
1291
|
- 📊 **Direct Analytics**: Full control over ad tracking and metrics
|
|
1349
1292
|
- ⚡ **Better Performance**: Native HLS playback for ads (same format as content)
|
|
1350
1293
|
- 🔧 **Custom VAST URLs**: Point to your own ad serving backend
|
|
1351
1294
|
- 📦 **Zero external ad SDK dependencies**
|
|
1352
1295
|
- 🎨 **Seamless Playback**: Same player stack for content and ads
|
|
1353
|
-
- 🔀 **VAST Mode System**: `vastMode` configures which endpoint supplies the VAST tag URL
|
|
1354
|
-
- `vastMode: 'adstorm'` → `/vast/{licenseKey}` endpoint
|
|
1355
|
-
- `vastMode: 'default'` → `/ads/web` endpoint or `vastTagUrl` (both resolve to HLS ad player playback)
|
|
1356
1296
|
- ⚠️ **Improved Error Handling**: Distinguishes between parsing errors and "no ads available" scenarios
|
|
1357
1297
|
- Logs warnings for "no ads available" (graceful handling)
|
|
1358
1298
|
- Logs errors for actual parsing/fetch failures
|