myetv-player 1.6.7 → 1.6.9

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.
@@ -3045,7 +3045,18 @@ addEventListener(eventType, callback) {
3045
3045
  // Reset auto-hide timer when video starts playing
3046
3046
  if (this.options.autoHide && this.autoHideInitialized) {
3047
3047
  if (this.options.debug) console.log('Video playing - reset auto-hide timer');
3048
+
3049
+ // show controls immediately when play starts (in case they were hidden)
3048
3050
  this.showControlsNow();
3051
+
3052
+ // delete timer
3053
+ if (this.autoHideTimer) {
3054
+ clearTimeout(this.autoHideTimer);
3055
+ this.autoHideTimer = null;
3056
+ if (this.options.debug) console.log('Cleared existing timer before reset');
3057
+ }
3058
+
3059
+ // start new timer
3049
3060
  this.resetAutoHideTimer();
3050
3061
  }
3051
3062
 
@@ -3259,14 +3270,6 @@ addEventListener(eventType, callback) {
3259
3270
  }
3260
3271
  });
3261
3272
 
3262
- // CRITICAL: Start auto-hide when video starts playing
3263
- this.video.addEventListener('play', () => {
3264
- if (this.options.autoHide && this.autoHideInitialized) {
3265
- this.showControlsNow();
3266
- this.resetAutoHideTimer();
3267
- }
3268
- });
3269
-
3270
3273
  // Picture-in-Picture Events
3271
3274
  this.video.addEventListener('enterpictureinpicture', () => {
3272
3275
  this.onEnterPiP();
@@ -3569,29 +3572,23 @@ resetAutoHideTimer() {
3569
3572
  return;
3570
3573
  }
3571
3574
 
3572
- // Allow timer if video is paused at start (autoplay blocked)
3575
+ // do not start the timer if video is in pause
3573
3576
  if (this.video && this.video.paused) {
3574
- const isInitialPause = this.video.currentTime === 0 && !this.video.ended;
3575
-
3576
- if (!isInitialPause) {
3577
- if (this.autoHideDebug && this.options.debug) console.log('Not starting timer - video paused by user');
3578
- return;
3579
- }
3580
-
3581
- if (this.autoHideDebug && this.options.debug) {
3582
- console.log('Video paused but at start - allowing timer (autoplay blocked)');
3577
+ if (this.autoHideDebug || this.options.debug) {
3578
+ console.log('Not starting timer - video is paused');
3583
3579
  }
3580
+ return;
3584
3581
  }
3585
3582
 
3586
- // Start timer
3583
+ // Start timer only if the video is playing
3587
3584
  this.autoHideTimer = setTimeout(() => {
3588
- if (this.autoHideDebug && this.options.debug) {
3585
+ if (this.autoHideDebug || this.options.debug) {
3589
3586
  console.log(`Timer expired after ${this.options.autoHideDelay}ms - hiding controls`);
3590
3587
  }
3591
3588
  this.hideControlsNow();
3592
3589
  }, this.options.autoHideDelay);
3593
3590
 
3594
- if (this.autoHideDebug && this.options.debug) {
3591
+ if (this.autoHideDebug || this.options.debug) {
3595
3592
  console.log(`Auto-hide timer started (${this.options.autoHideDelay}ms)`);
3596
3593
  }
3597
3594
  }
@@ -7964,6 +7961,7 @@ async loadAdaptiveLibraries() {
7964
7961
  });
7965
7962
 
7966
7963
  // Initialize player
7964
+ this.video.dataset.mpdUrl = src;
7967
7965
  this.dashPlayer.initialize(this.video, src, this.options.autoplay);
7968
7966
 
7969
7967
  // Ensure text tracks remain disabled after initialization
@@ -2742,7 +2742,15 @@ addEventListener(eventType, callback) {
2742
2742
 
2743
2743
  if (this.options.autoHide && this.autoHideInitialized) {
2744
2744
  if (this.options.debug) console.log('Video playing - reset auto-hide timer');
2745
+
2745
2746
  this.showControlsNow();
2747
+
2748
+ if (this.autoHideTimer) {
2749
+ clearTimeout(this.autoHideTimer);
2750
+ this.autoHideTimer = null;
2751
+ if (this.options.debug) console.log('Cleared existing timer before reset');
2752
+ }
2753
+
2746
2754
  this.resetAutoHideTimer();
2747
2755
  }
2748
2756
 
@@ -2936,13 +2944,6 @@ addEventListener(eventType, callback) {
2936
2944
  }
2937
2945
  });
2938
2946
 
2939
- this.video.addEventListener('play', () => {
2940
- if (this.options.autoHide && this.autoHideInitialized) {
2941
- this.showControlsNow();
2942
- this.resetAutoHideTimer();
2943
- }
2944
- });
2945
-
2946
2947
  this.video.addEventListener('enterpictureinpicture', () => {
2947
2948
  this.onEnterPiP();
2948
2949
  this.triggerEvent('pipchange', {
@@ -3221,26 +3222,20 @@ resetAutoHideTimer() {
3221
3222
  }
3222
3223
 
3223
3224
  if (this.video && this.video.paused) {
3224
- const isInitialPause = this.video.currentTime === 0 && !this.video.ended;
3225
-
3226
- if (!isInitialPause) {
3227
- if (this.autoHideDebug && this.options.debug) console.log('Not starting timer - video paused by user');
3228
- return;
3229
- }
3230
-
3231
- if (this.autoHideDebug && this.options.debug) {
3232
- console.log('Video paused but at start - allowing timer (autoplay blocked)');
3225
+ if (this.autoHideDebug || this.options.debug) {
3226
+ console.log('Not starting timer - video is paused');
3233
3227
  }
3228
+ return;
3234
3229
  }
3235
3230
 
3236
3231
  this.autoHideTimer = setTimeout(() => {
3237
- if (this.autoHideDebug && this.options.debug) {
3232
+ if (this.autoHideDebug || this.options.debug) {
3238
3233
  console.log(`Timer expired after ${this.options.autoHideDelay}ms - hiding controls`);
3239
3234
  }
3240
3235
  this.hideControlsNow();
3241
3236
  }, this.options.autoHideDelay);
3242
3237
 
3243
- if (this.autoHideDebug && this.options.debug) {
3238
+ if (this.autoHideDebug || this.options.debug) {
3244
3239
  console.log(`Auto-hide timer started (${this.options.autoHideDelay}ms)`);
3245
3240
  }
3246
3241
  }
@@ -7094,6 +7089,7 @@ async loadAdaptiveLibraries() {
7094
7089
  this.updateAdaptiveQualityDisplay();
7095
7090
  });
7096
7091
 
7092
+ this.video.dataset.mpdUrl = src;
7097
7093
  this.dashPlayer.initialize(this.video, src, this.options.autoplay);
7098
7094
 
7099
7095
  setTimeout(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myetv-player",
3
- "version": "1.6.7",
3
+ "version": "1.6.9",
4
4
  "description": "MYETV Video Player - Modular HTML5 video player with plugin support for YouTube, Vimeo, Twitch, Facebook, Cloudflare Stream and streaming protocols (HLS/DASH)",
5
5
  "main": "dist/myetv-player.js",
6
6
  "files": [
@@ -68,3 +68,5 @@
68
68
 
69
69
 
70
70
 
71
+
72
+