stormcloud-video-player 0.5.6 → 0.5.8

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.
Files changed (40) hide show
  1. package/README.md +28 -40
  2. package/dist/stormcloud-vp.min.js +1 -1
  3. package/lib/index.cjs +2122 -5135
  4. package/lib/index.cjs.map +1 -1
  5. package/lib/index.d.cts +9 -67
  6. package/lib/index.d.ts +9 -67
  7. package/lib/index.js +2146 -5143
  8. package/lib/index.js.map +1 -1
  9. package/lib/player/StormcloudVideoPlayer.cjs +879 -3862
  10. package/lib/player/StormcloudVideoPlayer.cjs.map +1 -1
  11. package/lib/player/StormcloudVideoPlayer.d.cts +5 -37
  12. package/lib/players/HlsPlayer.cjs +879 -3862
  13. package/lib/players/HlsPlayer.cjs.map +1 -1
  14. package/lib/players/HlsPlayer.d.cts +1 -1
  15. package/lib/players/index.cjs +879 -3862
  16. package/lib/players/index.cjs.map +1 -1
  17. package/lib/sdk/prebid.cjs +114 -43
  18. package/lib/sdk/prebid.cjs.map +1 -1
  19. package/lib/sdk/prebid.d.cts +1 -1
  20. package/lib/sdk/prebidController.cjs +127 -77
  21. package/lib/sdk/prebidController.cjs.map +1 -1
  22. package/lib/sdk/prebidController.d.cts +2 -2
  23. package/lib/sdk/vastParser.cjs +3 -5
  24. package/lib/sdk/vastParser.cjs.map +1 -1
  25. package/lib/sdk/vastParser.d.cts +1 -1
  26. package/lib/{types-Bwp6-yys.d.cts → types-BOJiWNWa.d.cts} +4 -7
  27. package/lib/ui/StormcloudVideoPlayer.cjs +879 -3872
  28. package/lib/ui/StormcloudVideoPlayer.cjs.map +1 -1
  29. package/lib/ui/StormcloudVideoPlayer.d.cts +1 -1
  30. package/lib/utils/browserCompat.cjs +0 -3
  31. package/lib/utils/browserCompat.cjs.map +1 -1
  32. package/lib/utils/browserCompat.d.cts +0 -1
  33. package/lib/utils/tracking.d.cts +1 -1
  34. package/package.json +1 -1
  35. package/lib/sdk/hlsAdPlayer.cjs +0 -1053
  36. package/lib/sdk/hlsAdPlayer.cjs.map +0 -1
  37. package/lib/sdk/hlsAdPlayer.d.cts +0 -10
  38. package/lib/sdk/ima.cjs +0 -1384
  39. package/lib/sdk/ima.cjs.map +0 -1
  40. 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, custom VAST ad serving, and optional Google IMA SDK integration for seamless ad playback. Now featuring a modern, extensible architecture inspired by react-player.
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
- All ad player types (`ima`, `hls`, `prebid`) and 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.
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
- - Google IMA SDK integration for VAST/VPAID ads
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: 'adstorm' (HLS player + AdStorm VAST endpoint) or 'default' (IMA SDK + /ads/web endpoint) (default: 'default')
278
- vastTagUrl?: string; // Custom VAST URL (used in default mode if provided; when not provided, uses /ads/web endpoint)
279
- adPlayerType?: 'ima' | 'hls' | 'prebid'; // Manual override for ad player type (auto-determined by vastMode if not specified)
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: 'adstorm' (uses HLS player + AdStorm VAST endpoint) or 'default' (uses Google IMA SDK + /ads/web endpoint) (default: 'default')
366
- vastTagUrl?: string; // Custom VAST tag URL (used in default mode if provided; when not provided, defaults to /ads/web endpoint)
367
- adPlayerType?: 'ima' | 'hls' | 'prebid'; // Manual override for ad player type (auto-determined by vastMode if not specified)
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
- - 🎯 Automatically uses HLS ad player (`adPlayerType: 'hls'`)
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 (no Google IMA SDK)
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
- Uses Google IMA SDK for traditional ad serving:
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
- // Default mode - uses Google IMA SDK automatically
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
- - 🎯 Automatically uses Google IMA SDK (`adPlayerType: 'ima'`)
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 JSON response with IMA payload: `{ response: { ima: { "publisherdesk.ima": { payload: "VAST_URL" } } } }`
494
+ - Returns VAST URLs from your ad backend
497
495
  - Extracts VAST tag URL from the `payload` field
498
- - 📊 Standard VAST/VPAID ad serving through Google IMA SDK
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 returns JSON with IMA configuration
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. Google IMA SDK loads and plays the VAST ad
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
- adPlayerType: 'prebid',
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
- adPlayerType: 'hls', // Manual override to use HLS player with default mode
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:** When `adPlayerType` is manually set, the `vastMode` property still determines which backend endpoint is called:
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 JSON with IMA payload containing VAST tag URL
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**: New `adPlayerType: 'prebid'` mode for server-side header bidding via Prebid Server (OpenRTB 2.5)
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
- - 🎬 **Custom HLS Ad Player**: Native HLS ad playback with custom VAST service
1333
- - 🎯 **Flexible Ad Integration**: Choose between custom HLS or Google IMA SDK
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 HLS playback for ads (same format as content)
1326
+ - ⚡ **Better Performance**: Native VAST playback for ads
1336
1327
  - 🔧 **Custom VAST URLs**: Point to your own ad serving backend
1337
- - 🔄 **Backward Compatible**: Existing Google IMA integration still works
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 System**: `vastMode` property automatically configures endpoints and ad players
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