stormcloud-video-player 0.7.24 → 0.7.25
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/stormcloud-vp.min.js +1 -1
- package/lib/index.cjs +16 -7
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +2 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +16 -7
- package/lib/index.js.map +1 -1
- package/lib/player/StormcloudVideoPlayer.cjs +12 -5
- package/lib/player/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/player/StormcloudVideoPlayer.d.cts +1 -1
- package/lib/players/HlsPlayer.cjs +12 -5
- package/lib/players/HlsPlayer.cjs.map +1 -1
- package/lib/players/HlsPlayer.d.cts +1 -1
- package/lib/players/index.cjs +12 -5
- package/lib/players/index.cjs.map +1 -1
- package/lib/sdk/adstormPlayer.cjs +8 -3
- package/lib/sdk/adstormPlayer.cjs.map +1 -1
- package/lib/sdk/adstormPlayer.d.cts +2 -1
- package/lib/{types-DrBGHN4q.d.cts → types-CIHDHY7A.d.cts} +1 -0
- package/lib/ui/StormcloudVideoPlayer.cjs +16 -7
- package/lib/ui/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/ui/StormcloudVideoPlayer.d.cts +1 -1
- package/lib/utils/tracking.d.cts +1 -1
- package/package.json +1 -1
package/lib/index.d.cts
CHANGED
|
@@ -36,6 +36,7 @@ interface StormcloudVideoPlayerConfig {
|
|
|
36
36
|
adTransitionGapMs?: number;
|
|
37
37
|
singlePipelineMode?: boolean;
|
|
38
38
|
projectId?: string;
|
|
39
|
+
channelId?: number;
|
|
39
40
|
}
|
|
40
41
|
interface AdController {
|
|
41
42
|
initialize: () => void;
|
|
@@ -4111,6 +4112,7 @@ declare function supportsFeature(feature: string): boolean;
|
|
|
4111
4112
|
interface AdStormPlayerOptions {
|
|
4112
4113
|
licenseKey: string;
|
|
4113
4114
|
debug?: boolean;
|
|
4115
|
+
channelId?: number;
|
|
4114
4116
|
}
|
|
4115
4117
|
interface AdStormLayerOptionsUpdate {
|
|
4116
4118
|
continueLiveStreamDuringAds?: boolean;
|
package/lib/index.d.ts
CHANGED
|
@@ -36,6 +36,7 @@ interface StormcloudVideoPlayerConfig {
|
|
|
36
36
|
adTransitionGapMs?: number;
|
|
37
37
|
singlePipelineMode?: boolean;
|
|
38
38
|
projectId?: string;
|
|
39
|
+
channelId?: number;
|
|
39
40
|
}
|
|
40
41
|
interface AdController {
|
|
41
42
|
initialize: () => void;
|
|
@@ -4111,6 +4112,7 @@ declare function supportsFeature(feature: string): boolean;
|
|
|
4111
4112
|
interface AdStormPlayerOptions {
|
|
4112
4113
|
licenseKey: string;
|
|
4113
4114
|
debug?: boolean;
|
|
4115
|
+
channelId?: number;
|
|
4114
4116
|
}
|
|
4115
4117
|
interface AdStormLayerOptionsUpdate {
|
|
4116
4118
|
continueLiveStreamDuringAds?: boolean;
|
package/lib/index.js
CHANGED
|
@@ -554,7 +554,7 @@ function isSupportedFormat(url, mimeType) {
|
|
|
554
554
|
return false;
|
|
555
555
|
}
|
|
556
556
|
function createAdStormPlayer(contentVideo, options) {
|
|
557
|
-
var licenseKey = options.licenseKey, _options_debug = options.debug, debug = _options_debug === void 0 ? false : _options_debug;
|
|
557
|
+
var licenseKey = options.licenseKey, _options_debug = options.debug, debug = _options_debug === void 0 ? false : _options_debug, channelId = options.channelId;
|
|
558
558
|
var adPlaying = false;
|
|
559
559
|
var originalMutedState = false;
|
|
560
560
|
var originalVolume = Math.max(0, Math.min(1, contentVideo.volume || 1));
|
|
@@ -760,8 +760,13 @@ function createAdStormPlayer(contentVideo, options) {
|
|
|
760
760
|
adVideoElement.load();
|
|
761
761
|
}
|
|
762
762
|
function buildVastUrl(durationSeconds) {
|
|
763
|
-
var baseUrl = "https://adstorm.co/api
|
|
764
|
-
|
|
763
|
+
var baseUrl = "https://adstorm.co/api/adstorm/nab/vast/pod";
|
|
764
|
+
var params = new URLSearchParams();
|
|
765
|
+
if (channelId != null) {
|
|
766
|
+
params.set("channel_id", String(channelId));
|
|
767
|
+
}
|
|
768
|
+
params.set("duration", String(Math.ceil(durationSeconds)));
|
|
769
|
+
return "".concat(baseUrl, "?").concat(params.toString());
|
|
765
770
|
}
|
|
766
771
|
function parseVastXml(xmlString) {
|
|
767
772
|
var ads = [];
|
|
@@ -2787,10 +2792,12 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
2787
2792
|
logBrowserInfo(config.debugAdTiming);
|
|
2788
2793
|
var browserForAdLayer = detectBrowser();
|
|
2789
2794
|
var isSinglePipeline = browserForAdLayer.isSmartTV || !!this.config.singlePipelineMode;
|
|
2790
|
-
this.adLayer = createAdStormPlayer(this.video, {
|
|
2795
|
+
this.adLayer = createAdStormPlayer(this.video, _object_spread({
|
|
2791
2796
|
licenseKey: this.config.licenseKey || "",
|
|
2792
2797
|
debug: !!config.debugAdTiming
|
|
2793
|
-
}
|
|
2798
|
+
}, this.config.channelId != null && {
|
|
2799
|
+
channelId: this.config.channelId
|
|
2800
|
+
}));
|
|
2794
2801
|
this.adLayer.updateOptions({
|
|
2795
2802
|
continueLiveStreamDuringAds: !isSinglePipeline && this.shouldContinueLiveStreamDuringAds()
|
|
2796
2803
|
});
|
|
@@ -7581,8 +7588,10 @@ var StormcloudVideoPlayerComponent = React2.memo(function(props) {
|
|
|
7581
7588
|
if (minSegmentsBeforePlay !== void 0) cfg.minSegmentsBeforePlay = minSegmentsBeforePlay;
|
|
7582
7589
|
if (disableAds !== void 0) cfg.disableAds = disableAds;
|
|
7583
7590
|
cfg.disableFiller = disableFiller !== null && disableFiller !== void 0 ? disableFiller : true;
|
|
7584
|
-
if (adcisionChannelId !== void 0)
|
|
7585
|
-
|
|
7591
|
+
if (adcisionChannelId !== void 0) {
|
|
7592
|
+
cfg.projectId = String(adcisionChannelId);
|
|
7593
|
+
cfg.channelId = adcisionChannelId;
|
|
7594
|
+
} else if (swirlProjectId !== void 0) cfg.projectId = String(swirlProjectId);
|
|
7586
7595
|
var player = new StormcloudVideoPlayer(cfg);
|
|
7587
7596
|
playerRef.current = player;
|
|
7588
7597
|
player.load().then(function() {
|