eb-player 2.3.2 → 2.4.1

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.
@@ -3342,12 +3342,18 @@
3342
3342
  here — it cancels the native mirroring. Only elements positioned with a
3343
3343
  physical inline style (chapter markers use right: N% under RTL) need an
3344
3344
  explicit override.
3345
+
3346
+ Both overrides below MUST stay anchored to .eb-player[dir="rtl"]. As bare
3347
+ [dir="rtl"] descendant selectors they also matched through an ancestor —
3348
+ inside an RTL document (<html dir="rtl">) they fired even when the player
3349
+ itself was LTR, mirroring the markers and volume thumb while Seekbar and
3350
+ VolumeControl used their LTR pointer maths. Never widen these back.
3345
3351
  ============================================================ */
3346
- [dir="rtl"] .eb-chapter-marker {
3352
+ .eb-player[dir="rtl"] .eb-chapter-marker {
3347
3353
  --eb-chapter-marker-x: 50%;
3348
3354
  }
3349
3355
 
3350
- [dir="rtl"] .eb-volume-thumb {
3356
+ .eb-player[dir="rtl"] .eb-volume-thumb {
3351
3357
  --eb-volume-thumb-x: 50%;
3352
3358
  }
3353
3359
 
@@ -4,7 +4,7 @@
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.EBPlayer = {}));
5
5
  })(this, (function (exports) { 'use strict';
6
6
 
7
- var __EB_PLAYER_VERSION__ = "2.3.2";
7
+ var __EB_PLAYER_VERSION__ = "2.4.1";
8
8
 
9
9
  /**
10
10
  * Finite State Machine for player playback state transitions.
@@ -459,6 +459,7 @@
459
459
  hasPlaylistPicker: false,
460
460
  disableCustomAbr: true,
461
461
  lang: undefined,
462
+ rtl: undefined,
462
463
  // EPG
463
464
  epgContentId: undefined,
464
465
  epgPolling: null,
@@ -3121,7 +3122,7 @@
3121
3122
  return b `
3122
3123
  <div
3123
3124
  class="eb-player${isIOS ? ' eb-ios-native' : ''}"
3124
- dir="${isRtl ? 'rtl' : ''}"
3125
+ dir="${isRtl ? 'rtl' : 'ltr'}"
3125
3126
  >
3126
3127
  <video
3127
3128
  class="eb-video"
@@ -3433,20 +3434,20 @@
3433
3434
  inner.classList.toggle('eb-ad-playing', this.state.adPlaying);
3434
3435
  }
3435
3436
  /**
3436
- * Applies or removes the dir=rtl attribute without full re-render.
3437
+ * Writes a concrete dir attribute without full re-render.
3437
3438
  * More efficient than re-rendering the entire template for a simple attribute change.
3439
+ *
3440
+ * Always asserts a direction — never removes the attribute. `dir` is an enumerated
3441
+ * attribute: absent and `""` both mean "inherit from the ancestor", so removing it
3442
+ * inside an RTL document (`<html dir="rtl">`) left the player mirrored by inheritance
3443
+ * while Seekbar/VolumeControl had already switched to their LTR pointer maths. The
3444
+ * player element is the authoritative direction root in BOTH states.
3438
3445
  */
3439
3446
  applyRtl() {
3440
3447
  const inner = this.el?.firstElementChild;
3441
3448
  if (inner == null)
3442
3449
  return;
3443
- const isRtl = this.state.isRtl;
3444
- if (isRtl) {
3445
- inner.setAttribute('dir', 'rtl');
3446
- }
3447
- else {
3448
- inner.removeAttribute('dir');
3449
- }
3450
+ inner.setAttribute('dir', this.state.isRtl ? 'rtl' : 'ltr');
3450
3451
  }
3451
3452
  invokeExtensions() {
3452
3453
  const config = this.config;
@@ -4669,7 +4670,9 @@
4669
4670
  container.style.setProperty('--eb-color-volume', skinColors.volumeBar);
4670
4671
  }
4671
4672
  // Set config-derived state flags
4672
- this.state.isRtl = this.config.lang === 'ar';
4673
+ // `rtl` decouples direction from language. Undefined (the default) falls back
4674
+ // to deriving it from `lang`, preserving pre-2.4.0 behaviour exactly.
4675
+ this.state.isRtl = this.config.rtl ?? (this.config.lang === 'ar');
4673
4676
  this.state.isRadio = this.config.radio === true;
4674
4677
  // Step 3: Create SkinRoot. This runs on EVERY mount, including noUi —
4675
4678
  // SkinRoot is the only creator of the <video> element, and its own