stormcloud-video-player 0.5.20 → 0.5.21

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.
@@ -2831,13 +2831,25 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
2831
2831
  }
2832
2832
  if (!(this.bufferedSegmentsCount >= minSegments)) return [
2833
2833
  3,
2834
- 2
2834
+ 3
2835
2835
  ];
2836
2836
  this.hasInitialBufferCompleted = true;
2837
2837
  if (!this.shouldAutoplayAfterBuffering) return [
2838
2838
  3,
2839
- 2
2839
+ 3
2840
+ ];
2841
+ if (!(this.inAdBreak || this.adLayer.isAdPlaying())) return [
2842
+ 3,
2843
+ 1
2844
+ ];
2845
+ if (this.config.debugAdTiming) {
2846
+ console.log("[StormcloudVideoPlayer] Initial buffer complete (".concat(this.bufferedSegmentsCount, " segments). Ad break active — deferring play() to handleAdPodComplete()."));
2847
+ }
2848
+ return [
2849
+ 3,
2850
+ 3
2840
2851
  ];
2852
+ case 1:
2841
2853
  if (this.config.debugAdTiming) {
2842
2854
  console.log("[StormcloudVideoPlayer] Initial buffer complete (".concat(this.bufferedSegmentsCount, " segments). Starting playback."));
2843
2855
  }
@@ -2849,10 +2861,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
2849
2861
  }
2850
2862
  })
2851
2863
  ];
2852
- case 1:
2853
- _state.sent();
2854
- _state.label = 2;
2855
2864
  case 2:
2865
+ _state.sent();
2866
+ _state.label = 3;
2867
+ case 3:
2856
2868
  return [
2857
2869
  2
2858
2870
  ];
@@ -4692,6 +4704,22 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4692
4704
  var browser = detectBrowser();
4693
4705
  var isSmartTV = browser.tizenVersion !== void 0 || browser.webOSVersion !== void 0;
4694
4706
  if (isSmartTV && this.hls) {
4707
+ if (!restoredMuted) {
4708
+ var hlsRef = this.hls;
4709
+ var savedMuted = restoredMuted;
4710
+ var savedVolume = restoredVolume;
4711
+ var onManifestParsedRestore = function onManifestParsedRestore1() {
4712
+ hlsRef.off(import_hls2.default.Events.MANIFEST_PARSED, onManifestParsedRestore);
4713
+ if (!_this.inAdBreak && !_this.adLayer.isAdPlaying()) {
4714
+ if (_this.video.muted !== savedMuted) _this.video.muted = savedMuted;
4715
+ if (Math.abs(_this.video.volume - savedVolume) > 0.01) _this.video.volume = savedVolume;
4716
+ if (_this.config.debugAdTiming) {
4717
+ console.log("[StormcloudVideoPlayer] Smart TV: audio state restored on MANIFEST_PARSED after re-attach");
4718
+ }
4719
+ }
4720
+ };
4721
+ hlsRef.on(import_hls2.default.Events.MANIFEST_PARSED, onManifestParsedRestore);
4722
+ }
4695
4723
  this.hls.attachMedia(this.video);
4696
4724
  if (this.config.debugAdTiming) {
4697
4725
  console.log("[StormcloudVideoPlayer] Smart TV: re-attached HLS to video element after ad break to restore media pipeline");
@@ -4733,7 +4761,9 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4733
4761
  [
4734
4762
  500,
4735
4763
  1e3,
4736
- 2e3
4764
+ 2e3,
4765
+ 3e3,
4766
+ 5e3
4737
4767
  ].forEach(function(delay) {
4738
4768
  setTimeout(function() {
4739
4769
  if (!_this.inAdBreak && !_this.adLayer.isAdPlaying()) {