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,5 +1,5 @@
1
1
  import { Component } from 'react';
2
- import { S as StormcloudVideoPlayerConfig } from '../types-DrBGHN4q.cjs';
2
+ import { S as StormcloudVideoPlayerConfig } from '../types-CIHDHY7A.cjs';
3
3
 
4
4
  interface HlsPlayerProps extends StormcloudVideoPlayerConfig {
5
5
  onMount?: (player: any) => void;
@@ -620,7 +620,7 @@ function isSupportedFormat(url, mimeType) {
620
620
  return false;
621
621
  }
622
622
  function createAdStormPlayer(contentVideo, options) {
623
- var licenseKey = options.licenseKey, _options_debug = options.debug, debug = _options_debug === void 0 ? false : _options_debug;
623
+ var licenseKey = options.licenseKey, _options_debug = options.debug, debug = _options_debug === void 0 ? false : _options_debug, channelId = options.channelId;
624
624
  var adPlaying = false;
625
625
  var originalMutedState = false;
626
626
  var originalVolume = Math.max(0, Math.min(1, contentVideo.volume || 1));
@@ -827,7 +827,12 @@ function createAdStormPlayer(contentVideo, options) {
827
827
  }
828
828
  function buildVastUrl(durationSeconds) {
829
829
  var baseUrl = "https://adstorm.co/api-adstorm-dev/adstorm/nab/vast/pod";
830
- return "".concat(baseUrl, "?duration=").concat(Math.ceil(durationSeconds));
830
+ var params = new URLSearchParams();
831
+ if (channelId != null) {
832
+ params.set("channel_id", String(channelId));
833
+ }
834
+ params.set("duration", String(Math.ceil(durationSeconds)));
835
+ return "".concat(baseUrl, "?").concat(params.toString());
831
836
  }
832
837
  function parseVastXml(xmlString) {
833
838
  var ads = [];
@@ -2825,10 +2830,12 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
2825
2830
  logBrowserInfo(config.debugAdTiming);
2826
2831
  var browserForAdLayer = detectBrowser();
2827
2832
  var isSinglePipeline = browserForAdLayer.isSmartTV || !!this.config.singlePipelineMode;
2828
- this.adLayer = createAdStormPlayer(this.video, {
2833
+ this.adLayer = createAdStormPlayer(this.video, _object_spread({
2829
2834
  licenseKey: this.config.licenseKey || "",
2830
2835
  debug: !!config.debugAdTiming
2831
- });
2836
+ }, this.config.channelId != null && {
2837
+ channelId: this.config.channelId
2838
+ }));
2832
2839
  this.adLayer.updateOptions({
2833
2840
  continueLiveStreamDuringAds: !isSinglePipeline && this.shouldContinueLiveStreamDuringAds()
2834
2841
  });