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.
@@ -570,7 +570,7 @@ function isSupportedFormat(url, mimeType) {
570
570
  return false;
571
571
  }
572
572
  function createAdStormPlayer(contentVideo, options) {
573
- var licenseKey = options.licenseKey, _options_debug = options.debug, debug = _options_debug === void 0 ? false : _options_debug;
573
+ var licenseKey = options.licenseKey, _options_debug = options.debug, debug = _options_debug === void 0 ? false : _options_debug, channelId = options.channelId;
574
574
  var adPlaying = false;
575
575
  var originalMutedState = false;
576
576
  var originalVolume = Math.max(0, Math.min(1, contentVideo.volume || 1));
@@ -777,7 +777,12 @@ function createAdStormPlayer(contentVideo, options) {
777
777
  }
778
778
  function buildVastUrl(durationSeconds) {
779
779
  var baseUrl = "https://adstorm.co/api-adstorm-dev/adstorm/nab/vast/pod";
780
- return "".concat(baseUrl, "?duration=").concat(Math.ceil(durationSeconds));
780
+ var params = new URLSearchParams();
781
+ if (channelId != null) {
782
+ params.set("channel_id", String(channelId));
783
+ }
784
+ params.set("duration", String(Math.ceil(durationSeconds)));
785
+ return "".concat(baseUrl, "?").concat(params.toString());
781
786
  }
782
787
  function parseVastXml(xmlString) {
783
788
  var ads = [];
@@ -2775,10 +2780,12 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
2775
2780
  logBrowserInfo(config.debugAdTiming);
2776
2781
  var browserForAdLayer = detectBrowser();
2777
2782
  var isSinglePipeline = browserForAdLayer.isSmartTV || !!this.config.singlePipelineMode;
2778
- this.adLayer = createAdStormPlayer(this.video, {
2783
+ this.adLayer = createAdStormPlayer(this.video, _object_spread({
2779
2784
  licenseKey: this.config.licenseKey || "",
2780
2785
  debug: !!config.debugAdTiming
2781
- });
2786
+ }, this.config.channelId != null && {
2787
+ channelId: this.config.channelId
2788
+ }));
2782
2789
  this.adLayer.updateOptions({
2783
2790
  continueLiveStreamDuringAds: !isSinglePipeline && this.shouldContinueLiveStreamDuringAds()
2784
2791
  });
@@ -7569,8 +7576,10 @@ var StormcloudVideoPlayerComponent = import_react2.default.memo(function(props)
7569
7576
  if (minSegmentsBeforePlay !== void 0) cfg.minSegmentsBeforePlay = minSegmentsBeforePlay;
7570
7577
  if (disableAds !== void 0) cfg.disableAds = disableAds;
7571
7578
  cfg.disableFiller = disableFiller !== null && disableFiller !== void 0 ? disableFiller : true;
7572
- if (adcisionChannelId !== void 0) cfg.projectId = String(adcisionChannelId);
7573
- else if (swirlProjectId !== void 0) cfg.projectId = String(swirlProjectId);
7579
+ if (adcisionChannelId !== void 0) {
7580
+ cfg.projectId = String(adcisionChannelId);
7581
+ cfg.channelId = adcisionChannelId;
7582
+ } else if (swirlProjectId !== void 0) cfg.projectId = String(swirlProjectId);
7574
7583
  var player = new StormcloudVideoPlayer(cfg);
7575
7584
  playerRef.current = player;
7576
7585
  player.load().then(function() {