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.
@@ -532,7 +532,7 @@ function isSupportedFormat(url, mimeType) {
532
532
  return false;
533
533
  }
534
534
  function createAdStormPlayer(contentVideo, options) {
535
- var licenseKey = options.licenseKey, _options_debug = options.debug, debug = _options_debug === void 0 ? false : _options_debug;
535
+ var licenseKey = options.licenseKey, _options_debug = options.debug, debug = _options_debug === void 0 ? false : _options_debug, channelId = options.channelId;
536
536
  var adPlaying = false;
537
537
  var originalMutedState = false;
538
538
  var originalVolume = Math.max(0, Math.min(1, contentVideo.volume || 1));
@@ -739,7 +739,12 @@ function createAdStormPlayer(contentVideo, options) {
739
739
  }
740
740
  function buildVastUrl(durationSeconds) {
741
741
  var baseUrl = "https://adstorm.co/api-adstorm-dev/adstorm/nab/vast/pod";
742
- return "".concat(baseUrl, "?duration=").concat(Math.ceil(durationSeconds));
742
+ var params = new URLSearchParams();
743
+ if (channelId != null) {
744
+ params.set("channel_id", String(channelId));
745
+ }
746
+ params.set("duration", String(Math.ceil(durationSeconds)));
747
+ return "".concat(baseUrl, "?").concat(params.toString());
743
748
  }
744
749
  function parseVastXml(xmlString) {
745
750
  var ads = [];
@@ -2737,10 +2742,12 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
2737
2742
  logBrowserInfo(config.debugAdTiming);
2738
2743
  var browserForAdLayer = detectBrowser();
2739
2744
  var isSinglePipeline = browserForAdLayer.isSmartTV || !!this.config.singlePipelineMode;
2740
- this.adLayer = createAdStormPlayer(this.video, {
2745
+ this.adLayer = createAdStormPlayer(this.video, _object_spread({
2741
2746
  licenseKey: this.config.licenseKey || "",
2742
2747
  debug: !!config.debugAdTiming
2743
- });
2748
+ }, this.config.channelId != null && {
2749
+ channelId: this.config.channelId
2750
+ }));
2744
2751
  this.adLayer.updateOptions({
2745
2752
  continueLiveStreamDuringAds: !isSinglePipeline && this.shouldContinueLiveStreamDuringAds()
2746
2753
  });