myetv-player 1.6.2 → 1.6.4

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myetv-player",
3
- "version": "1.6.2",
3
+ "version": "1.6.4",
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": [
@@ -63,3 +63,5 @@
63
63
 
64
64
 
65
65
 
66
+
67
+
@@ -372,23 +372,29 @@
372
372
  subtitlesBtn.style.display = 'none';
373
373
  }
374
374
 
375
- // Hide original speed menu option from settings (if exists)
376
- if (settingsMenu) {
377
- // Hide old non-expandable speed option
378
- const originalSpeedOption = settingsMenu.querySelector('[data-action="speed"]');
379
- if (originalSpeedOption) {
380
- originalSpeedOption.style.display = 'none';
381
- }
382
-
383
- // Hide new expandable speed option
384
- const expandableSpeedWrapper = settingsMenu.querySelector('[data-action="speed-expand"]');
385
- if (expandableSpeedWrapper) {
386
- const wrapper = expandableSpeedWrapper.closest('.settings-expandable-wrapper');
375
+ // Remove ONLY the original player speed (not YouTube speed)
376
+ if (settingsMenu) {
377
+ // Find and remove ONLY options with data-action="speed" or "speed-expand"
378
+ // that are NOT inside .yt-speed-wrapper
379
+ const speedOptions = settingsMenu.querySelectorAll('[data-action="speed"], [data-action="speed_expand"]');
380
+
381
+ speedOptions.forEach(option => {
382
+ // Check if this option is NOT inside YouTube speed wrapper
383
+ if (!option.closest('.yt-speed-wrapper')) {
384
+ // It's the original player speed - remove it
385
+ const wrapper = option.closest('.settings-expandable-wrapper');
387
386
  if (wrapper) {
388
- wrapper.style.display = 'none';
387
+ wrapper.remove(); // Remove the whole wrapper
388
+ } else {
389
+ option.remove(); // Remove just the option
390
+ }
391
+
392
+ if (this.api.player.options.debug) {
393
+ console.log('YT Plugin: Removed original player speed option');
389
394
  }
390
395
  }
391
- }
396
+ });
397
+ }
392
398
 
393
399
  // Add subtitles option to settings menu
394
400
  if (settingsMenu) {
@@ -4681,42 +4687,36 @@
4681
4687
  }
4682
4688
 
4683
4689
  /**
4684
- * Initialize chapter display in title overlay
4685
- */
4690
+ * Initialize chapter display in top bar subtitle (instead of title overlay)
4691
+ */
4686
4692
  initChapterDisplayInOverlay() {
4687
4693
  if (!this.chapters || this.chapters.length === 0) return;
4688
4694
 
4689
- const titleOverlay = this.api.container.querySelector('.title-overlay');
4690
- if (!titleOverlay) return;
4691
-
4692
- // Remove existing chapter element if present
4693
- let chapterElement = titleOverlay.querySelector('.chapter-name');
4694
- if (chapterElement) {
4695
- chapterElement.remove();
4696
- }
4697
-
4698
- // Create chapter name element
4699
- chapterElement = document.createElement('div');
4700
- chapterElement.className = 'chapter-name';
4701
- chapterElement.style.cssText = `
4702
- font-size: 13px;
4703
- font-weight: 500;
4704
- color: rgba(255, 255, 255, 0.9);
4705
- margin-top: 6px;
4706
- max-width: 400px;
4707
- overflow: hidden;
4708
- text-overflow: ellipsis;
4709
- white-space: nowrap;
4710
- `;
4695
+ // Use topBar instead of old title-overlay
4696
+ const topBar = this.api.container.querySelector('.player-top-bar');
4697
+ if (!topBar) return;
4698
+
4699
+ // Find or create subtitle element in top bar
4700
+ let subtitleElement = topBar.querySelector('.video-subtitle');
4701
+
4702
+ if (!subtitleElement) {
4703
+ // Create subtitle element if it doesn't exist
4704
+ const titleSection = topBar.querySelector('.top-bar-title');
4705
+ if (!titleSection) return;
4711
4706
 
4712
- // Append to title overlay
4713
- titleOverlay.appendChild(chapterElement);
4707
+ subtitleElement = document.createElement('span');
4708
+ subtitleElement.className = 'video-subtitle chapter-name';
4709
+ titleSection.appendChild(subtitleElement);
4710
+ } else {
4711
+ // Add chapter-name class to existing subtitle
4712
+ subtitleElement.classList.add('chapter-name');
4713
+ }
4714
4714
 
4715
4715
  // Start monitoring playback to update chapter name
4716
4716
  this.startChapterNameMonitoring();
4717
4717
 
4718
4718
  if (this.api.player.options.debug) {
4719
- console.log('YT Plugin: Chapter name display initialized in title overlay');
4719
+ console.log('YT Plugin: Chapter name display initialized in top bar');
4720
4720
  }
4721
4721
  }
4722
4722
 
@@ -4746,10 +4746,11 @@
4746
4746
  }
4747
4747
 
4748
4748
  /**
4749
- * Update chapter name in overlay based on current time
4750
- */
4749
+ * Update chapter name in top bar subtitle based on current time
4750
+ */
4751
4751
  updateChapterNameDisplay(currentTime) {
4752
- const chapterElement = this.api.container.querySelector('.title-overlay .chapter-name');
4752
+ // Use topBar instead of title-overlay
4753
+ const chapterElement = this.api.container.querySelector('.player-top-bar .video-subtitle.chapter-name');
4753
4754
  if (!chapterElement) return;
4754
4755
 
4755
4756
  // Find current chapter
@@ -4766,7 +4767,13 @@
4766
4767
  chapterElement.textContent = currentChapter.title;
4767
4768
  chapterElement.style.display = 'block';
4768
4769
  } else {
4769
- chapterElement.style.display = 'none';
4770
+ // Show original subtitle if no chapter active
4771
+ if (this.api.player.options.videoSubtitle) {
4772
+ chapterElement.textContent = this.api.player.options.videoSubtitle;
4773
+ chapterElement.style.display = 'block';
4774
+ } else {
4775
+ chapterElement.style.display = 'none';
4776
+ }
4770
4777
  }
4771
4778
  }
4772
4779