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.
@@ -80,6 +80,7 @@ declare class StormcloudVideoPlayer {
80
80
  toggleFullscreen(): Promise<void>;
81
81
  isMuted(): boolean;
82
82
  setMuted(muted: boolean): void;
83
+ setVolume(volume: number): void;
83
84
  isFullscreen(): boolean;
84
85
  isLive(): boolean;
85
86
  get videoElement(): HTMLVideoElement;
@@ -3493,6 +3493,26 @@ var StormcloudVideoPlayer = class {
3493
3493
  console.log("[StormcloudVideoPlayer] setMuted called:", muted);
3494
3494
  }
3495
3495
  }
3496
+ setVolume(volume) {
3497
+ const clampedVolume = Math.max(0, Math.min(1, volume));
3498
+ const adPlaying = this.ima.isAdPlaying();
3499
+ if (adPlaying) {
3500
+ this.ima.setAdVolume(clampedVolume);
3501
+ this.ima.updateOriginalMutedState(clampedVolume === 0, clampedVolume);
3502
+ if (this.config.debugAdTiming) {
3503
+ console.log("[StormcloudVideoPlayer] setVolume applied during ad", {
3504
+ volume: clampedVolume
3505
+ });
3506
+ }
3507
+ } else {
3508
+ this.video.volume = clampedVolume;
3509
+ this.video.muted = clampedVolume === 0;
3510
+ this.ima.updateOriginalMutedState(clampedVolume === 0, clampedVolume);
3511
+ if (this.config.debugAdTiming) {
3512
+ console.log("[StormcloudVideoPlayer] setVolume called:", clampedVolume);
3513
+ }
3514
+ }
3515
+ }
3496
3516
  isFullscreen() {
3497
3517
  return !!document.fullscreenElement;
3498
3518
  }