stormcloud-video-player 0.7.24 → 0.7.26

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.
@@ -1,4 +1,4 @@
1
- import { S as StormcloudVideoPlayerConfig } from '../types-DrBGHN4q.cjs';
1
+ import { S as StormcloudVideoPlayerConfig } from '../types-CIHDHY7A.cjs';
2
2
 
3
3
  type DebugLogLevel = "info" | "warn" | "error";
4
4
  declare class StormcloudVideoPlayer {
@@ -584,7 +584,7 @@ function isSupportedFormat(url, mimeType) {
584
584
  return false;
585
585
  }
586
586
  function createAdStormPlayer(contentVideo, options) {
587
- var licenseKey = options.licenseKey, _options_debug = options.debug, debug = _options_debug === void 0 ? false : _options_debug;
587
+ var licenseKey = options.licenseKey, _options_debug = options.debug, debug = _options_debug === void 0 ? false : _options_debug, channelId = options.channelId;
588
588
  var adPlaying = false;
589
589
  var originalMutedState = false;
590
590
  var originalVolume = Math.max(0, Math.min(1, contentVideo.volume || 1));
@@ -791,7 +791,12 @@ function createAdStormPlayer(contentVideo, options) {
791
791
  }
792
792
  function buildVastUrl(durationSeconds) {
793
793
  var baseUrl = "https://adstorm.co/api-adstorm-dev/adstorm/nab/vast/pod";
794
- return "".concat(baseUrl, "?duration=").concat(Math.ceil(durationSeconds));
794
+ var params = new URLSearchParams();
795
+ if (channelId != null) {
796
+ params.set("channel_id", String(channelId));
797
+ }
798
+ params.set("duration", String(Math.ceil(durationSeconds)));
799
+ return "".concat(baseUrl, "?").concat(params.toString());
795
800
  }
796
801
  function parseVastXml(xmlString) {
797
802
  var ads = [];
@@ -2789,10 +2794,12 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
2789
2794
  logBrowserInfo(config.debugAdTiming);
2790
2795
  var browserForAdLayer = detectBrowser();
2791
2796
  var isSinglePipeline = browserForAdLayer.isSmartTV || !!this.config.singlePipelineMode;
2792
- this.adLayer = createAdStormPlayer(this.video, {
2797
+ this.adLayer = createAdStormPlayer(this.video, _object_spread({
2793
2798
  licenseKey: this.config.licenseKey || "",
2794
2799
  debug: !!config.debugAdTiming
2795
- });
2800
+ }, this.config.channelId != null && {
2801
+ channelId: this.config.channelId
2802
+ }));
2796
2803
  this.adLayer.updateOptions({
2797
2804
  continueLiveStreamDuringAds: !isSinglePipeline && this.shouldContinueLiveStreamDuringAds()
2798
2805
  });