stormcloud-video-player 0.2.26 → 0.2.27

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.
@@ -3532,6 +3532,26 @@ var StormcloudVideoPlayer = class {
3532
3532
  console.log("[StormcloudVideoPlayer] setMuted called:", muted);
3533
3533
  }
3534
3534
  }
3535
+ setVolume(volume) {
3536
+ const clampedVolume = Math.max(0, Math.min(1, volume));
3537
+ const adPlaying = this.ima.isAdPlaying();
3538
+ if (adPlaying) {
3539
+ this.ima.setAdVolume(clampedVolume);
3540
+ this.ima.updateOriginalMutedState(clampedVolume === 0, clampedVolume);
3541
+ if (this.config.debugAdTiming) {
3542
+ console.log("[StormcloudVideoPlayer] setVolume applied during ad", {
3543
+ volume: clampedVolume
3544
+ });
3545
+ }
3546
+ } else {
3547
+ this.video.volume = clampedVolume;
3548
+ this.video.muted = clampedVolume === 0;
3549
+ this.ima.updateOriginalMutedState(clampedVolume === 0, clampedVolume);
3550
+ if (this.config.debugAdTiming) {
3551
+ console.log("[StormcloudVideoPlayer] setVolume called:", clampedVolume);
3552
+ }
3553
+ }
3554
+ }
3535
3555
  isFullscreen() {
3536
3556
  return !!document.fullscreenElement;
3537
3557
  }