stormcloud-video-player 0.5.5 → 0.5.7
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 +28 -40
- package/dist/stormcloud-vp.min.js +1 -1
- package/lib/index.cjs +1075 -3918
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +8 -67
- package/lib/index.d.ts +8 -67
- package/lib/index.js +1076 -3903
- package/lib/index.js.map +1 -1
- package/lib/player/StormcloudVideoPlayer.cjs +1063 -3876
- package/lib/player/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/player/StormcloudVideoPlayer.d.cts +4 -37
- package/lib/players/HlsPlayer.cjs +1063 -3876
- package/lib/players/HlsPlayer.cjs.map +1 -1
- package/lib/players/HlsPlayer.d.cts +1 -1
- package/lib/players/index.cjs +1063 -3876
- package/lib/players/index.cjs.map +1 -1
- package/lib/sdk/prebid.cjs +114 -43
- package/lib/sdk/prebid.cjs.map +1 -1
- package/lib/sdk/prebid.d.cts +1 -1
- package/lib/sdk/prebidController.cjs +124 -71
- package/lib/sdk/prebidController.cjs.map +1 -1
- package/lib/sdk/prebidController.d.cts +2 -2
- package/lib/{types-CRi_KrjM.d.cts → types-BOJiWNWa.d.cts} +23 -7
- package/lib/ui/StormcloudVideoPlayer.cjs +1063 -3886
- package/lib/ui/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/ui/StormcloudVideoPlayer.d.cts +1 -1
- package/lib/utils/browserCompat.cjs +0 -3
- package/lib/utils/browserCompat.cjs.map +1 -1
- package/lib/utils/browserCompat.d.cts +0 -1
- package/lib/utils/tracking.cjs +226 -1
- package/lib/utils/tracking.cjs.map +1 -1
- package/lib/utils/tracking.d.cts +5 -2
- package/package.json +1 -1
- package/lib/sdk/hlsAdPlayer.cjs +0 -1052
- package/lib/sdk/hlsAdPlayer.cjs.map +0 -1
- package/lib/sdk/hlsAdPlayer.d.cts +0 -10
- package/lib/sdk/ima.cjs +0 -1383
- package/lib/sdk/ima.cjs.map +0 -1
- package/lib/sdk/ima.d.cts +0 -12
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Stormcloud Video Player
|
|
2
2
|
|
|
3
|
-
A professional video player with advanced ad integration for web applications. Built with precision ad break alignment, SCTE-35 signal parsing,
|
|
3
|
+
A professional video player with advanced ad integration for web applications. Built with precision ad break alignment, SCTE-35 signal parsing, and Prebid Server integration for server-side header bidding and VAST ad playback. Now featuring a modern, extensible architecture inspired by react-player.
|
|
4
4
|
|
|
5
5
|
## 🎯 Key Features
|
|
6
6
|
|
|
@@ -147,7 +147,7 @@ Include the single script tag and access everything from `window.StormcloudVP`:
|
|
|
147
147
|
</script>
|
|
148
148
|
```
|
|
149
149
|
|
|
150
|
-
|
|
150
|
+
Prebid utilities (`createPrebidManager`, `createPrebidController`) are available on the `window.StormcloudVP` global. See the [Prebid Mode](#3-prebid-mode-server-side-header-bidding) section for a full CDN example with Prebid Server.
|
|
151
151
|
|
|
152
152
|
## 🏗️ Professional Architecture
|
|
153
153
|
|
|
@@ -170,7 +170,7 @@ StormcloudPlayer (Main Component)
|
|
|
170
170
|
- **Purpose**: Handles HLS (.m3u8) streams with advanced features
|
|
171
171
|
- **Features**:
|
|
172
172
|
- SCTE-35 ad marker detection and processing
|
|
173
|
-
-
|
|
173
|
+
- Prebid Server integration for VAST ad playback
|
|
174
174
|
- Live stream support with low-latency mode
|
|
175
175
|
- Drift correction for live timing
|
|
176
176
|
- Manifest-based and ID3 ad markers
|
|
@@ -274,10 +274,9 @@ interface StormcloudPlayerProps {
|
|
|
274
274
|
minSegmentsBeforePlay?: number; // Number of segments to buffer before starting playback (default: 2)
|
|
275
275
|
|
|
276
276
|
// Ad player configuration
|
|
277
|
-
vastMode?: 'adstorm' | 'default'; // VAST mode
|
|
278
|
-
vastTagUrl?: string; // Custom VAST URL (
|
|
279
|
-
|
|
280
|
-
prebid?: PrebidConfig; // Prebid Server configuration (required when adPlayerType is 'prebid')
|
|
277
|
+
vastMode?: 'adstorm' | 'default'; // VAST mode (default: 'default')
|
|
278
|
+
vastTagUrl?: string; // Custom VAST URL (if provided)
|
|
279
|
+
prebid?: PrebidConfig; // Prebid Server configuration for ad auctions
|
|
281
280
|
|
|
282
281
|
// Event handlers
|
|
283
282
|
onReady?: (player: StormcloudVideoPlayer) => void;
|
|
@@ -362,10 +361,9 @@ interface StormcloudVideoPlayerConfig {
|
|
|
362
361
|
minSegmentsBeforePlay?: number; // Number of segments to buffer before starting playback (default: 2)
|
|
363
362
|
|
|
364
363
|
// Ad configuration
|
|
365
|
-
vastMode?: 'adstorm' | 'default'; // VAST mode
|
|
366
|
-
vastTagUrl?: string; // Custom VAST tag URL (
|
|
367
|
-
|
|
368
|
-
prebid?: PrebidConfig; // Prebid Server configuration (required when adPlayerType is 'prebid')
|
|
364
|
+
vastMode?: 'adstorm' | 'default'; // VAST mode (default: 'default')
|
|
365
|
+
vastTagUrl?: string; // Custom VAST tag URL (if provided)
|
|
366
|
+
prebid?: PrebidConfig; // Prebid Server configuration for ad auctions
|
|
369
367
|
|
|
370
368
|
onVolumeToggle?: () => void; // Callback for volume toggle
|
|
371
369
|
onFullscreenToggle?: () => void; // Callback for fullscreen toggle
|
|
@@ -448,7 +446,7 @@ const player = new StormcloudVideoPlayer({
|
|
|
448
446
|
```
|
|
449
447
|
|
|
450
448
|
**What happens:**
|
|
451
|
-
- 🎯
|
|
449
|
+
- 🎯 Ad playback via Prebid Controller
|
|
452
450
|
- 🔗 VAST endpoint: `GET https://adstorm.co/api-adstorm-dev/adstorm/vast/{licenseKey}`
|
|
453
451
|
- License key is passed in the URL path (no authorization header needed)
|
|
454
452
|
- Returns VAST XML directly with HLS media files
|
|
@@ -462,7 +460,7 @@ const player = new StormcloudVideoPlayer({
|
|
|
462
460
|
4. HLS ad player loads and plays the ad segments
|
|
463
461
|
|
|
464
462
|
**Benefits:**
|
|
465
|
-
- ✅ Zero external dependencies (
|
|
463
|
+
- ✅ Zero external ad SDK dependencies (Prebid Server only)
|
|
466
464
|
- ✅ Full control over ad serving
|
|
467
465
|
- ✅ Native HLS playback (same format as content)
|
|
468
466
|
- ✅ Better performance and reliability
|
|
@@ -471,7 +469,7 @@ const player = new StormcloudVideoPlayer({
|
|
|
471
469
|
|
|
472
470
|
#### 2. **Default Mode**
|
|
473
471
|
|
|
474
|
-
|
|
472
|
+
Ad playback uses Prebid Server for VAST ads:
|
|
475
473
|
|
|
476
474
|
```javascript
|
|
477
475
|
const player = new StormcloudVideoPlayer({
|
|
@@ -479,7 +477,7 @@ const player = new StormcloudVideoPlayer({
|
|
|
479
477
|
src: "https://your-stream.com/playlist.m3u8",
|
|
480
478
|
licenseKey: "your-license-key",
|
|
481
479
|
|
|
482
|
-
//
|
|
480
|
+
// Uses Prebid Controller for ad playback
|
|
483
481
|
vastMode: 'default', // or omit this property entirely
|
|
484
482
|
vastTagUrl: 'https://your-vast-server.com/vast.xml', // optional
|
|
485
483
|
|
|
@@ -488,20 +486,20 @@ const player = new StormcloudVideoPlayer({
|
|
|
488
486
|
```
|
|
489
487
|
|
|
490
488
|
**What happens:**
|
|
491
|
-
- 🎯
|
|
489
|
+
- 🎯 Ad playback via Prebid Controller
|
|
492
490
|
- 🔗 VAST endpoint resolution:
|
|
493
491
|
1. If `vastTagUrl` is provided, uses that URL directly
|
|
494
492
|
2. Otherwise, calls `GET https://adstorm.co/api-adstorm-dev/adstorm/ads/web`
|
|
495
493
|
- Requires `Authorization: Bearer {licenseKey}` header
|
|
496
|
-
- Returns
|
|
494
|
+
- Returns VAST URLs from your ad backend
|
|
497
495
|
- Extracts VAST tag URL from the `payload` field
|
|
498
|
-
- 📊
|
|
496
|
+
- 📊 VAST ad serving through Prebid Server
|
|
499
497
|
|
|
500
498
|
**API Flow:**
|
|
501
499
|
1. Player calls `/ads/web` endpoint with Bearer token (if no `vastTagUrl` provided)
|
|
502
|
-
2. Backend
|
|
500
|
+
2. Backend or Prebid Server provides VAST URLs
|
|
503
501
|
3. Player extracts VAST tag URL from `response.ima["publisherdesk.ima"].payload`
|
|
504
|
-
4.
|
|
502
|
+
4. Prebid Controller loads and plays the VAST ad
|
|
505
503
|
|
|
506
504
|
**Benefits:**
|
|
507
505
|
- ✅ Industry-standard ad serving
|
|
@@ -522,7 +520,7 @@ const player = new StormcloudVideoPlayer({
|
|
|
522
520
|
src: "https://your-stream.com/playlist.m3u8",
|
|
523
521
|
licenseKey: "your-license-key",
|
|
524
522
|
|
|
525
|
-
|
|
523
|
+
prebid: { /* PrebidConfig */ },
|
|
526
524
|
prebid: {
|
|
527
525
|
enabled: true,
|
|
528
526
|
serverUrl: "https://prebid-server.example.com",
|
|
@@ -586,7 +584,6 @@ await player.load();
|
|
|
586
584
|
muted: true,
|
|
587
585
|
licenseKey: "your-license-key",
|
|
588
586
|
|
|
589
|
-
adPlayerType: "prebid",
|
|
590
587
|
prebid: {
|
|
591
588
|
enabled: true,
|
|
592
589
|
serverUrl: "https://prebid-server.example.com",
|
|
@@ -819,17 +816,13 @@ const player = new StormcloudVideoPlayer({
|
|
|
819
816
|
src: "https://your-stream.com/playlist.m3u8",
|
|
820
817
|
|
|
821
818
|
vastMode: 'default',
|
|
822
|
-
|
|
823
|
-
vastTagUrl: 'https://your-backend.com/vast', // Will use this URL directly
|
|
819
|
+
vastTagUrl: 'https://your-backend.com/vast', // Optional custom VAST URL
|
|
824
820
|
|
|
825
821
|
debugAdTiming: true,
|
|
826
822
|
});
|
|
827
823
|
```
|
|
828
824
|
|
|
829
|
-
**Note:**
|
|
830
|
-
- `vastMode: 'adstorm'` → Always calls `/vast/{licenseKey}` endpoint
|
|
831
|
-
- `vastMode: 'default'` → Calls `/ads/web` endpoint (unless `vastTagUrl` is provided)
|
|
832
|
-
- `adPlayerType: 'prebid'` → Bypasses `vastMode` entirely; VAST URLs are sourced from Prebid Server auctions (requires `prebid` config)
|
|
825
|
+
**Note:** The player uses Prebid Controller for ad playback. Provide `prebid` config for Prebid Server auctions.
|
|
833
826
|
|
|
834
827
|
### SCTE-35 Support
|
|
835
828
|
|
|
@@ -1003,7 +996,7 @@ Authenticated requests are sent to:
|
|
|
1003
996
|
|
|
1004
997
|
- **Default Mode** (`vastMode: 'default'`):
|
|
1005
998
|
- Ad configuration: `GET https://adstorm.co/api-adstorm-dev/adstorm/ads/web` (requires `Authorization: Bearer {licenseKey}` header)
|
|
1006
|
-
- Returns
|
|
999
|
+
- Returns VAST tag URL or Prebid Server provides creatives
|
|
1007
1000
|
|
|
1008
1001
|
- **Player Tracking** (both modes):
|
|
1009
1002
|
- Player tracking: `POST https://adstorm.co/api-adstorm-dev/adstorm/player-tracking/track` (requires `Authorization: Bearer {licenseKey}` header)
|
|
@@ -1173,8 +1166,6 @@ src/
|
|
|
1173
1166
|
├── ui/
|
|
1174
1167
|
│ └── StormcloudVideoPlayer.tsx # Legacy React component
|
|
1175
1168
|
├── sdk/
|
|
1176
|
-
│ ├── ima.ts # Google IMA integration
|
|
1177
|
-
│ ├── hlsAdPlayer.ts # HLS ad player (AdStorm mode)
|
|
1178
1169
|
│ ├── prebid.ts # Prebid Server auction manager
|
|
1179
1170
|
│ ├── prebidController.ts # Prebid ad controller (VAST playback + tracking)
|
|
1180
1171
|
│ └── vastParser.ts # VAST XML parser
|
|
@@ -1297,7 +1288,7 @@ Built with ❤️ by the Stormcloud team
|
|
|
1297
1288
|
|
|
1298
1289
|
### What's New in v0.5
|
|
1299
1290
|
|
|
1300
|
-
- **Prebid Server Integration**:
|
|
1291
|
+
- **Prebid Server Integration**: Server-side header bidding via Prebid Server (OpenRTB 2.5)
|
|
1301
1292
|
- **Zero-SDK Ad Auctions**: Run server-side auctions across multiple bidders (AppNexus, Rubicon, Index Exchange, etc.) without any client-side ad SDK
|
|
1302
1293
|
- **PrebidConfig**: Full OpenRTB 2.5 request configuration with auto-populated device/site fields
|
|
1303
1294
|
- **CPM Floor Enforcement**: Client-side floor pricing to reject bids below a minimum CPM threshold
|
|
@@ -1329,17 +1320,14 @@ Built with ❤️ by the Stormcloud team
|
|
|
1329
1320
|
|
|
1330
1321
|
### What's New in v0.3
|
|
1331
1322
|
|
|
1332
|
-
- 🎬 **
|
|
1333
|
-
- 🎯 **
|
|
1323
|
+
- 🎬 **Prebid Ad Controller**: VAST ad playback via Prebid Server
|
|
1324
|
+
- 🎯 **Ad Integration**: Prebid Server for server-side header bidding
|
|
1334
1325
|
- 📊 **Direct Analytics**: Full control over ad tracking and metrics
|
|
1335
|
-
- ⚡ **Better Performance**: Native
|
|
1326
|
+
- ⚡ **Better Performance**: Native VAST playback for ads
|
|
1336
1327
|
- 🔧 **Custom VAST URLs**: Point to your own ad serving backend
|
|
1337
|
-
-
|
|
1338
|
-
- 📦 **Zero Dependencies**: No external ad SDKs required (when using HLS ad player)
|
|
1328
|
+
- 📦 **Zero Dependencies**: No external ad SDKs (Prebid Server only)
|
|
1339
1329
|
- 🎨 **Seamless Playback**: Same player for content and ads
|
|
1340
|
-
- 🔀 **VAST Mode
|
|
1341
|
-
- `vastMode: 'adstorm'` → Uses `/vast/{licenseKey}` endpoint with HLS ad player
|
|
1342
|
-
- `vastMode: 'default'` → Uses `/ads/web` endpoint with Google IMA SDK
|
|
1330
|
+
- 🔀 **VAST Mode**: `vastMode` property for endpoint configuration
|
|
1343
1331
|
- ⚠️ **Improved Error Handling**: Distinguishes between parsing errors and "no ads available" scenarios
|
|
1344
1332
|
- Logs warnings for "no ads available" (graceful handling)
|
|
1345
1333
|
- Logs errors for actual parsing/fetch failures
|