stormcloud-video-player 0.2.11 → 0.2.13
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 +100 -1
- package/dist/stormcloud-vp.min.js +2 -2
- package/lib/index.cjs +1010 -48
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +75 -2
- package/lib/index.d.ts +75 -2
- package/lib/index.js +1000 -48
- package/lib/index.js.map +1 -1
- package/lib/player/StormcloudVideoPlayer.cjs +934 -44
- package/lib/player/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/player/StormcloudVideoPlayer.d.cts +2 -2
- package/lib/players/HlsPlayer.cjs +934 -44
- package/lib/players/HlsPlayer.cjs.map +1 -1
- package/lib/players/HlsPlayer.d.cts +1 -1
- package/lib/players/index.cjs +934 -44
- package/lib/players/index.cjs.map +1 -1
- package/lib/sdk/hlsAdPlayer.cjs +488 -0
- package/lib/sdk/hlsAdPlayer.cjs.map +1 -0
- package/lib/sdk/hlsAdPlayer.d.cts +8 -0
- package/lib/sdk/ima.cjs +143 -0
- package/lib/sdk/ima.cjs.map +1 -1
- package/lib/sdk/ima.d.cts +1 -1
- package/lib/{types-GpA_hKek.d.cts → types-mVgmKmzM.d.cts} +3 -0
- package/lib/ui/StormcloudVideoPlayer.cjs +934 -44
- package/lib/ui/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/ui/StormcloudVideoPlayer.d.cts +1 -1
- package/lib/utils/browserCompat.cjs +228 -0
- package/lib/utils/browserCompat.cjs.map +1 -0
- package/lib/utils/browserCompat.d.cts +36 -0
- package/lib/utils/polyfills.cjs +253 -0
- package/lib/utils/polyfills.cjs.map +1 -0
- package/lib/utils/polyfills.d.cts +11 -0
- package/lib/utils/tracking.cjs +12 -4
- package/lib/utils/tracking.cjs.map +1 -1
- package/lib/utils/tracking.d.cts +1 -1
- package/package.json +1 -1
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, and Google IMA SDK integration for seamless
|
|
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.
|
|
4
4
|
|
|
5
5
|
## 🎯 Key Features
|
|
6
6
|
|
|
@@ -265,6 +265,10 @@ interface StormcloudPlayerProps {
|
|
|
265
265
|
licenseKey?: string;
|
|
266
266
|
adFailsafeTimeoutMs?: number;
|
|
267
267
|
|
|
268
|
+
// Ad player configuration
|
|
269
|
+
adPlayerType?: 'ima' | 'hls'; // Choose ad player (default: 'ima')
|
|
270
|
+
vastTagUrl?: string; // Custom VAST URL for HLS ad player
|
|
271
|
+
|
|
268
272
|
// Event handlers
|
|
269
273
|
onReady?: (player: StormcloudVideoPlayer) => void;
|
|
270
274
|
onStart?: () => void;
|
|
@@ -345,6 +349,12 @@ interface StormcloudVideoPlayerConfig {
|
|
|
345
349
|
licenseKey?: string; // API authentication key
|
|
346
350
|
debugAdTiming?: boolean; // Enable debug logging (default: false)
|
|
347
351
|
adFailsafeTimeoutMs?: number; // Ad timeout in milliseconds (default: 10000)
|
|
352
|
+
|
|
353
|
+
// Ad configuration
|
|
354
|
+
vastMode?: 'adstorm' | 'default'; // VAST mode: 'adstorm' (uses HLS player + AdStorm backend) or 'default' (uses Google IMA SDK) (default: 'default')
|
|
355
|
+
vastTagUrl?: string; // Custom VAST tag URL (used in default mode if provided)
|
|
356
|
+
adPlayerType?: 'ima' | 'hls'; // Manual override for ad player type (auto-determined by vastMode if not specified)
|
|
357
|
+
|
|
348
358
|
onVolumeToggle?: () => void; // Callback for volume toggle
|
|
349
359
|
onFullscreenToggle?: () => void; // Callback for fullscreen toggle
|
|
350
360
|
onControlClick?: () => void; // Callback for control area clicks
|
|
@@ -404,6 +414,84 @@ All controls use a consistent high-contrast design:
|
|
|
404
414
|
|
|
405
415
|
## 🎬 Ad Integration (HLS Streams Only)
|
|
406
416
|
|
|
417
|
+
### VAST Mode Configuration
|
|
418
|
+
|
|
419
|
+
The player supports two VAST modes that automatically configure the appropriate ad player:
|
|
420
|
+
|
|
421
|
+
#### 1. **AdStorm Mode** (Recommended)
|
|
422
|
+
|
|
423
|
+
Uses AdStorm backend with HLS ad player for optimal performance:
|
|
424
|
+
|
|
425
|
+
```javascript
|
|
426
|
+
const player = new StormcloudVideoPlayer({
|
|
427
|
+
videoElement: video,
|
|
428
|
+
src: "https://your-stream.com/playlist.m3u8",
|
|
429
|
+
licenseKey: "your-license-key",
|
|
430
|
+
|
|
431
|
+
// AdStorm mode - uses HLS ad player automatically
|
|
432
|
+
vastMode: 'adstorm',
|
|
433
|
+
|
|
434
|
+
debugAdTiming: true,
|
|
435
|
+
});
|
|
436
|
+
```
|
|
437
|
+
|
|
438
|
+
**What happens:**
|
|
439
|
+
- 🎯 Automatically uses HLS ad player (`adPlayerType: 'hls'`)
|
|
440
|
+
- 🔗 VAST endpoint: `https://adstorm.co/api-adstorm-dev/adstorm/vast/${licenseKey}`
|
|
441
|
+
- 📊 Direct tracking and analytics through AdStorm backend
|
|
442
|
+
|
|
443
|
+
**Benefits:**
|
|
444
|
+
- ✅ Zero external dependencies (no Google IMA SDK)
|
|
445
|
+
- ✅ Full control over ad serving
|
|
446
|
+
- ✅ Native HLS playback (same format as content)
|
|
447
|
+
- ✅ Better performance and reliability
|
|
448
|
+
- ✅ Custom targeting and selection
|
|
449
|
+
|
|
450
|
+
#### 2. **Default Mode**
|
|
451
|
+
|
|
452
|
+
Uses Google IMA SDK for traditional ad serving:
|
|
453
|
+
|
|
454
|
+
```javascript
|
|
455
|
+
const player = new StormcloudVideoPlayer({
|
|
456
|
+
videoElement: video,
|
|
457
|
+
src: "https://your-stream.com/playlist.m3u8",
|
|
458
|
+
|
|
459
|
+
// Default mode - uses Google IMA SDK automatically
|
|
460
|
+
vastMode: 'default', // or omit this property entirely
|
|
461
|
+
vastTagUrl: 'https://your-vast-server.com/vast.xml', // optional
|
|
462
|
+
|
|
463
|
+
debugAdTiming: true,
|
|
464
|
+
});
|
|
465
|
+
```
|
|
466
|
+
|
|
467
|
+
**What happens:**
|
|
468
|
+
- 🎯 Automatically uses Google IMA SDK (`adPlayerType: 'ima'`)
|
|
469
|
+
- 🔗 VAST endpoint: Uses `vastTagUrl` if provided, otherwise `https://adstorm.co/api-adstorm-dev/adstorm/ads/web`
|
|
470
|
+
- 📊 Standard VAST/VPAID ad serving
|
|
471
|
+
|
|
472
|
+
**Benefits:**
|
|
473
|
+
- ✅ Industry-standard ad serving
|
|
474
|
+
- ✅ Wide format support (VAST, VPAID)
|
|
475
|
+
- ✅ Established ecosystem
|
|
476
|
+
- ✅ Backward compatible with existing VAST tags
|
|
477
|
+
|
|
478
|
+
### Manual Ad Player Override
|
|
479
|
+
|
|
480
|
+
You can still manually override the ad player type if needed:
|
|
481
|
+
|
|
482
|
+
```javascript
|
|
483
|
+
const player = new StormcloudVideoPlayer({
|
|
484
|
+
videoElement: video,
|
|
485
|
+
src: "https://your-stream.com/playlist.m3u8",
|
|
486
|
+
|
|
487
|
+
vastMode: 'default',
|
|
488
|
+
adPlayerType: 'hls', // Manual override to use HLS player with default mode
|
|
489
|
+
vastTagUrl: 'https://your-backend.com/vast',
|
|
490
|
+
|
|
491
|
+
debugAdTiming: true,
|
|
492
|
+
});
|
|
493
|
+
```
|
|
494
|
+
|
|
407
495
|
### SCTE-35 Support
|
|
408
496
|
|
|
409
497
|
The HlsPlayer automatically detects and responds to SCTE-35 signals embedded in HLS streams:
|
|
@@ -707,6 +795,17 @@ MIT License - see [LICENSE](LICENSE) file for details.
|
|
|
707
795
|
|
|
708
796
|
Built with ❤️ by the Stormcloud team
|
|
709
797
|
|
|
798
|
+
### What's New in v0.3
|
|
799
|
+
|
|
800
|
+
- 🎬 **Custom HLS Ad Player**: Native HLS ad playback with custom VAST service
|
|
801
|
+
- 🎯 **Flexible Ad Integration**: Choose between custom HLS or Google IMA SDK
|
|
802
|
+
- 📊 **Direct Analytics**: Full control over ad tracking and metrics
|
|
803
|
+
- ⚡ **Better Performance**: Native HLS playback for ads (same format as content)
|
|
804
|
+
- 🔧 **Custom VAST URLs**: Point to your own ad serving backend
|
|
805
|
+
- 🔄 **Backward Compatible**: Existing Google IMA integration still works
|
|
806
|
+
- 📦 **Zero Dependencies**: No external ad SDKs required (when using HLS ad player)
|
|
807
|
+
- 🎨 **Seamless Playback**: Same player for content and ads
|
|
808
|
+
|
|
710
809
|
### What's New in v0.2
|
|
711
810
|
|
|
712
811
|
- 🎯 **Professional Architecture**: Modular player system inspired by react-player
|