@banou/media-player 0.10.33 → 0.10.34

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/README.md CHANGED
@@ -364,10 +364,12 @@ host page shows, for another:
364
364
 
365
365
  They are shown in the closest language the player has: Latin American Spanish (`es-419`, for every `es-*`), Brazilian
366
366
  Portuguese (`pt-BR`, for every `pt-*`), French, German, Italian, Russian, Japanese, Korean, Simplified and Traditional
367
- Chinese (`zh-Hans`, `zh-Hant`), Turkish and Polish, else English. The numbers in them are written as the tag writes them
367
+ Chinese (`zh-Hans`, `zh-Hant`), Turkish, Polish, Arabic and Hebrew, else English. The numbers in them are written as the tag writes them
368
368
  (`es-AR` gives `0,5x`, `es-419` itself `0.5x`), and track languages are named in it, even when the labels are English
369
369
  (`en-DE` gives `0,5x`). A language's text is fetched the first time a player shows it, with FormatJS (`@formatjs/intl`),
370
370
  and the labels are English until it has arrived. A player given no `language`, or one it does not have, fetches neither.
371
+ The bar and the seek bar stay left to right in every language: a host page written right to left puts `dir="ltr"` on the
372
+ player's parent.
371
373
 
372
374
  Each language is `src/lib/locales/<tag>.json`, keyed by the English of `src/lib/labels.ts`; a unit test holds every
373
375
  file to FormatJS's `verify` against that English.
@@ -0,0 +1,52 @@
1
+ //#region src/lib/locales/ar.json
2
+ var e = "الصوت", t = "تم النسخ", n = "نسخ", r = "إيقاف", i = "كتم الصوت", a = "إيقاف مؤقت", o = "تشغيل", s = "الجودة", c = "إعادة التشغيل", l = "الإعدادات", u = "الترجمة", d = "غير متاح", f = "استُؤنف التشغيل", p = {
3
+ "(Default)": "(عادية)",
4
+ Audio: e,
5
+ Copied: t,
6
+ Copy: n,
7
+ "Copy the errors": "نسخ الأخطاء",
8
+ "Could not switch. Try again.": "تعذّر التبديل. حاول مرة أخرى.",
9
+ Disable: r,
10
+ "Exit full screen (f)": "الخروج من ملء الشاشة (f)",
11
+ "Exit picture in picture": "الخروج من صورة داخل صورة",
12
+ "Full screen": "ملء الشاشة",
13
+ "Full screen (f)": "ملء الشاشة (f)",
14
+ Mute: i,
15
+ "Mute (m)": "كتم الصوت (m)",
16
+ "Normalize volume": "موازنة مستوى الصوت",
17
+ "Now click your browser's pop out button": "انقر الآن على زر النافذة المنبثقة في متصفحك",
18
+ Pause: a,
19
+ "Pause (k)": "إيقاف مؤقت (k)",
20
+ "Picture in picture": "صورة داخل صورة",
21
+ Play: o,
22
+ "Play (k)": "تشغيل (k)",
23
+ "Playback errors ({count})": "أخطاء التشغيل ({count})",
24
+ "Playback failed": "فشل التشغيل",
25
+ "Playback speed": "سرعة التشغيل",
26
+ "Put the subtitles in the picture": "دمج الترجمة في الصورة",
27
+ "Put the subtitles in the video": "دمج الترجمة في الفيديو",
28
+ Quality: s,
29
+ "Reading the video file failed": "فشلت قراءة ملف الفيديو",
30
+ Replay: c,
31
+ "Replay (k)": "إعادة التشغيل (k)",
32
+ Settings: l,
33
+ "Skip Ending": "تخطي النهاية",
34
+ "Skip Opening": "تخطي المقدمة",
35
+ Subtitles: u,
36
+ "Subtitles are in the picture": "الترجمة مدمجة في الصورة",
37
+ "The MediaSource closed before a SourceBuffer could be created": "أُغلق MediaSource قبل إنشاء SourceBuffer",
38
+ "The MediaSource never opened": "لم يُفتح MediaSource",
39
+ "The browser rejected a media segment": "رفض المتصفح مقطعًا من الوسائط",
40
+ "The video codec in this file could not be identified": "تعذّر التعرف على ترميز الفيديو في هذا الملف",
41
+ "This browser cannot play the codecs in this file: {codecs}": "لا يمكن لهذا المتصفح تشغيل الترميزات في هذا الملف: {codecs}",
42
+ "This file has no subtitles": "لا توجد ترجمة في هذا الملف",
43
+ "Track {number}": "المقطع {number}",
44
+ Unavailable: d,
45
+ "Unmute (m)": "إلغاء كتم الصوت (m)",
46
+ "at {time}": "عند {time}",
47
+ recovered: f,
48
+ "{rate}x": "{rate}x",
49
+ "{start} to {end}": "من {start} إلى {end}"
50
+ };
51
+ //#endregion
52
+ export { e as Audio, t as Copied, n as Copy, r as Disable, i as Mute, a as Pause, o as Play, s as Quality, c as Replay, l as Settings, u as Subtitles, d as Unavailable, p as default, f as recovered };
@@ -0,0 +1,52 @@
1
+ //#region src/lib/locales/he.json
2
+ var e = "שמע", t = "הועתק", n = "העתקה", r = "כבוי", i = "השתקה", a = "השהיה", o = "הפעלה", s = "איכות", c = "הפעלה מחדש", l = "הגדרות", u = "כתוביות", d = "לא זמין", f = "ההפעלה התאוששה", p = {
3
+ "(Default)": "(רגילה)",
4
+ Audio: e,
5
+ Copied: t,
6
+ Copy: n,
7
+ "Copy the errors": "העתקת השגיאות",
8
+ "Could not switch. Try again.": "ההחלפה נכשלה. נסו שוב.",
9
+ Disable: r,
10
+ "Exit full screen (f)": "יציאה ממסך מלא (f)",
11
+ "Exit picture in picture": "יציאה מתמונה בתוך תמונה",
12
+ "Full screen": "מסך מלא",
13
+ "Full screen (f)": "מסך מלא (f)",
14
+ Mute: i,
15
+ "Mute (m)": "השתקה (m)",
16
+ "Normalize volume": "איזון עוצמת הקול",
17
+ "Now click your browser's pop out button": "עכשיו לחצו על לחצן החלון הצף בדפדפן",
18
+ Pause: a,
19
+ "Pause (k)": "השהיה (k)",
20
+ "Picture in picture": "תמונה בתוך תמונה",
21
+ Play: o,
22
+ "Play (k)": "הפעלה (k)",
23
+ "Playback errors ({count})": "שגיאות הפעלה ({count})",
24
+ "Playback failed": "ההפעלה נכשלה",
25
+ "Playback speed": "מהירות הפעלה",
26
+ "Put the subtitles in the picture": "הטמעת הכתוביות בתמונה",
27
+ "Put the subtitles in the video": "הטמעת הכתוביות בסרטון",
28
+ Quality: s,
29
+ "Reading the video file failed": "קריאת קובץ הווידאו נכשלה",
30
+ Replay: c,
31
+ "Replay (k)": "הפעלה מחדש (k)",
32
+ Settings: l,
33
+ "Skip Ending": "דילוג על הסיום",
34
+ "Skip Opening": "דילוג על הפתיח",
35
+ Subtitles: u,
36
+ "Subtitles are in the picture": "הכתוביות מוטמעות בתמונה",
37
+ "The MediaSource closed before a SourceBuffer could be created": "ה-MediaSource נסגר לפני שנוצר SourceBuffer",
38
+ "The MediaSource never opened": "ה-MediaSource לא נפתח",
39
+ "The browser rejected a media segment": "הדפדפן דחה מקטע מדיה",
40
+ "The video codec in this file could not be identified": "לא ניתן לזהות את קודק הווידאו בקובץ הזה",
41
+ "This browser cannot play the codecs in this file: {codecs}": "הדפדפן הזה לא יכול להפעיל את הקודקים בקובץ: {codecs}",
42
+ "This file has no subtitles": "בקובץ הזה אין כתוביות",
43
+ "Track {number}": "רצועה {number}",
44
+ Unavailable: d,
45
+ "Unmute (m)": "ביטול השתקה (m)",
46
+ "at {time}": "ב-{time}",
47
+ recovered: f,
48
+ "{rate}x": "{rate}x",
49
+ "{start} to {end}": "מ-{start} עד {end}"
50
+ };
51
+ //#endregion
52
+ export { e as Audio, t as Copied, n as Copy, r as Disable, i as Mute, a as Pause, o as Play, s as Quality, c as Replay, l as Settings, u as Subtitles, d as Unavailable, p as default, f as recovered };
package/dist/index.js CHANGED
@@ -49,9 +49,11 @@ var oe = {
49
49
  features: [...j, se],
50
50
  displayName: "MediaPlayer"
51
51
  }), Y = ce.usePlayer, le = {
52
+ ar: () => import("./ar-CS4Yzfxw.js"),
52
53
  de: () => import("./de-DphEdq0O.js"),
53
54
  "es-419": () => import("./es-419-D6gsvnn8.js"),
54
55
  fr: () => import("./fr-BqAzAJX0.js"),
56
+ he: () => import("./he-DbFw1CdO.js"),
55
57
  it: () => import("./it-NTcUh3Gr.js"),
56
58
  ja: () => import("./ja-DSmX_bxj.js"),
57
59
  ko: () => import("./ko-DyPzWasj.js"),
@@ -1014,6 +1016,7 @@ var oe = {
1014
1016
  return /* @__PURE__ */ F(N, { children: [
1015
1017
  n ? /* @__PURE__ */ P("div", {
1016
1018
  className: "title",
1019
+ dir: "auto",
1017
1020
  css: rt,
1018
1021
  style: { ...r ? {
1019
1022
  opacity: "0",
@@ -1024,6 +1027,7 @@ var oe = {
1024
1027
  ((o ? !a : s) || c !== void 0) && !i ? /* @__PURE__ */ P("div", { css: at }) : void 0,
1025
1028
  i ? /* @__PURE__ */ P("div", {
1026
1029
  css: ot,
1030
+ dir: "auto",
1027
1031
  children: lt(i, t)
1028
1032
  }) : void 0,
1029
1033
  /* @__PURE__ */ P("div", {
@@ -1052,7 +1056,7 @@ var oe = {
1052
1056
  max-width: min(calc(26 * var(--mp-unit)), calc(100vw - calc(2.4 * var(--mp-unit))));
1053
1057
  white-space: normal;
1054
1058
  overflow-wrap: anywhere;
1055
- text-align: left;
1059
+ text-align: start;
1056
1060
 
1057
1061
  /*
1058
1062
  * The radius carries !important for the same reason the paddings below do.
@@ -1069,6 +1073,8 @@ var oe = {
1069
1073
 
1070
1074
  * {
1071
1075
  ${$.bMedium.regular}
1076
+ /* a label reads in its own direction, though the player around it stays left to right */
1077
+ unicode-bidi: plaintext;
1072
1078
  }
1073
1079
 
1074
1080
  ${e === "sm" && E`
@@ -1735,6 +1741,7 @@ var oe = {
1735
1741
  }),
1736
1742
  c ? /* @__PURE__ */ P("div", {
1737
1743
  className: "no-hover failed",
1744
+ dir: "auto",
1738
1745
  children: l(a.switchFailed)
1739
1746
  }) : null,
1740
1747
  o ? d(null, o) : null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@banou/media-player",
3
- "version": "0.10.33",
3
+ "version": "0.10.34",
4
4
  "description": "A video player for containers and codecs the browser cannot play natively, remuxed on the fly",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -0,0 +1,49 @@
1
+ {
2
+ "(Default)": "(عادية)",
3
+ "Audio": "الصوت",
4
+ "Copied": "تم النسخ",
5
+ "Copy": "نسخ",
6
+ "Copy the errors": "نسخ الأخطاء",
7
+ "Could not switch. Try again.": "تعذّر التبديل. حاول مرة أخرى.",
8
+ "Disable": "إيقاف",
9
+ "Exit full screen (f)": "الخروج من ملء الشاشة (f)",
10
+ "Exit picture in picture": "الخروج من صورة داخل صورة",
11
+ "Full screen": "ملء الشاشة",
12
+ "Full screen (f)": "ملء الشاشة (f)",
13
+ "Mute": "كتم الصوت",
14
+ "Mute (m)": "كتم الصوت (m)",
15
+ "Normalize volume": "موازنة مستوى الصوت",
16
+ "Now click your browser's pop out button": "انقر الآن على زر النافذة المنبثقة في متصفحك",
17
+ "Pause": "إيقاف مؤقت",
18
+ "Pause (k)": "إيقاف مؤقت (k)",
19
+ "Picture in picture": "صورة داخل صورة",
20
+ "Play": "تشغيل",
21
+ "Play (k)": "تشغيل (k)",
22
+ "Playback errors ({count})": "أخطاء التشغيل ({count})",
23
+ "Playback failed": "فشل التشغيل",
24
+ "Playback speed": "سرعة التشغيل",
25
+ "Put the subtitles in the picture": "دمج الترجمة في الصورة",
26
+ "Put the subtitles in the video": "دمج الترجمة في الفيديو",
27
+ "Quality": "الجودة",
28
+ "Reading the video file failed": "فشلت قراءة ملف الفيديو",
29
+ "Replay": "إعادة التشغيل",
30
+ "Replay (k)": "إعادة التشغيل (k)",
31
+ "Settings": "الإعدادات",
32
+ "Skip Ending": "تخطي النهاية",
33
+ "Skip Opening": "تخطي المقدمة",
34
+ "Subtitles": "الترجمة",
35
+ "Subtitles are in the picture": "الترجمة مدمجة في الصورة",
36
+ "The MediaSource closed before a SourceBuffer could be created": "أُغلق MediaSource قبل إنشاء SourceBuffer",
37
+ "The MediaSource never opened": "لم يُفتح MediaSource",
38
+ "The browser rejected a media segment": "رفض المتصفح مقطعًا من الوسائط",
39
+ "The video codec in this file could not be identified": "تعذّر التعرف على ترميز الفيديو في هذا الملف",
40
+ "This browser cannot play the codecs in this file: {codecs}": "لا يمكن لهذا المتصفح تشغيل الترميزات في هذا الملف: {codecs}",
41
+ "This file has no subtitles": "لا توجد ترجمة في هذا الملف",
42
+ "Track {number}": "المقطع {number}",
43
+ "Unavailable": "غير متاح",
44
+ "Unmute (m)": "إلغاء كتم الصوت (m)",
45
+ "at {time}": "عند {time}",
46
+ "recovered": "استُؤنف التشغيل",
47
+ "{rate}x": "{rate}x",
48
+ "{start} to {end}": "من {start} إلى {end}"
49
+ }
@@ -0,0 +1,49 @@
1
+ {
2
+ "(Default)": "(רגילה)",
3
+ "Audio": "שמע",
4
+ "Copied": "הועתק",
5
+ "Copy": "העתקה",
6
+ "Copy the errors": "העתקת השגיאות",
7
+ "Could not switch. Try again.": "ההחלפה נכשלה. נסו שוב.",
8
+ "Disable": "כבוי",
9
+ "Exit full screen (f)": "יציאה ממסך מלא (f)",
10
+ "Exit picture in picture": "יציאה מתמונה בתוך תמונה",
11
+ "Full screen": "מסך מלא",
12
+ "Full screen (f)": "מסך מלא (f)",
13
+ "Mute": "השתקה",
14
+ "Mute (m)": "השתקה (m)",
15
+ "Normalize volume": "איזון עוצמת הקול",
16
+ "Now click your browser's pop out button": "עכשיו לחצו על לחצן החלון הצף בדפדפן",
17
+ "Pause": "השהיה",
18
+ "Pause (k)": "השהיה (k)",
19
+ "Picture in picture": "תמונה בתוך תמונה",
20
+ "Play": "הפעלה",
21
+ "Play (k)": "הפעלה (k)",
22
+ "Playback errors ({count})": "שגיאות הפעלה ({count})",
23
+ "Playback failed": "ההפעלה נכשלה",
24
+ "Playback speed": "מהירות הפעלה",
25
+ "Put the subtitles in the picture": "הטמעת הכתוביות בתמונה",
26
+ "Put the subtitles in the video": "הטמעת הכתוביות בסרטון",
27
+ "Quality": "איכות",
28
+ "Reading the video file failed": "קריאת קובץ הווידאו נכשלה",
29
+ "Replay": "הפעלה מחדש",
30
+ "Replay (k)": "הפעלה מחדש (k)",
31
+ "Settings": "הגדרות",
32
+ "Skip Ending": "דילוג על הסיום",
33
+ "Skip Opening": "דילוג על הפתיח",
34
+ "Subtitles": "כתוביות",
35
+ "Subtitles are in the picture": "הכתוביות מוטמעות בתמונה",
36
+ "The MediaSource closed before a SourceBuffer could be created": "ה-MediaSource נסגר לפני שנוצר SourceBuffer",
37
+ "The MediaSource never opened": "ה-MediaSource לא נפתח",
38
+ "The browser rejected a media segment": "הדפדפן דחה מקטע מדיה",
39
+ "The video codec in this file could not be identified": "לא ניתן לזהות את קודק הווידאו בקובץ הזה",
40
+ "This browser cannot play the codecs in this file: {codecs}": "הדפדפן הזה לא יכול להפעיל את הקודקים בקובץ: {codecs}",
41
+ "This file has no subtitles": "בקובץ הזה אין כתוביות",
42
+ "Track {number}": "רצועה {number}",
43
+ "Unavailable": "לא זמין",
44
+ "Unmute (m)": "ביטול השתקה (m)",
45
+ "at {time}": "ב-{time}",
46
+ "recovered": "ההפעלה התאוששה",
47
+ "{rate}x": "{rate}x",
48
+ "{start} to {end}": "מ-{start} עד {end}"
49
+ }
@@ -138,6 +138,7 @@ export const Overlay = ({ onSubtitleRef }: { onSubtitleRef: (element: HTMLDivEle
138
138
  ? (
139
139
  <div
140
140
  className="title"
141
+ dir="auto"
141
142
  css={titleStyle}
142
143
  style={{ ...hideUI ? { opacity: '0', pointerEvents: 'none' } : {} }}
143
144
  >
@@ -153,7 +154,7 @@ export const Overlay = ({ onSubtitleRef }: { onSubtitleRef: (element: HTMLDivEle
153
154
  ? <div css={loadingStyle} />
154
155
  : undefined}
155
156
  {playbackError
156
- ? <div css={errorStyle}>{errorMessage(playbackError, labels)}</div>
157
+ ? <div css={errorStyle} dir="auto">{errorMessage(playbackError, labels)}</div>
157
158
  : undefined}
158
159
  <div className="subtitles" ref={onSubtitleRef} css={style} />
159
160
  </>
@@ -29,7 +29,7 @@ const style = (size: buttonSize) => css`
29
29
  max-width: min(calc(26 * var(--mp-unit)), calc(100vw - calc(2.4 * var(--mp-unit))));
30
30
  white-space: normal;
31
31
  overflow-wrap: anywhere;
32
- text-align: left;
32
+ text-align: start;
33
33
 
34
34
  /*
35
35
  * The radius carries !important for the same reason the paddings below do.
@@ -46,6 +46,8 @@ const style = (size: buttonSize) => css`
46
46
 
47
47
  * {
48
48
  ${fonts.bMedium.regular}
49
+ /* a label reads in its own direction, though the player around it stays left to right */
50
+ unicode-bidi: plaintext;
49
51
  }
50
52
 
51
53
  ${size === buttonSize.sm && css`
@@ -194,7 +194,7 @@ export const TrackMenu = (
194
194
  {onBack ? <ChevronLeft /> : null}
195
195
  <span>{title}</span>
196
196
  </div>
197
- {failed ? <div className="no-hover failed">{format(LABELS.switchFailed)}</div> : null}
197
+ {failed ? <div className="no-hover failed" dir="auto">{format(LABELS.switchFailed)}</div> : null}
198
198
  {offLabel ? row(null, offLabel) : null}
199
199
  {tracks.map(({ id, label }) => row(id, label, 'description'))}
200
200
  </div>
@@ -10,9 +10,11 @@ type Catalogue = Readonly<Record<string, string>>
10
10
 
11
11
  // One chunk per language, fetched with FormatJS by the first player shown in it, so a player in English loads neither.
12
12
  const CATALOGUES: Readonly<Record<string, () => Promise<{ default: Catalogue }>>> = {
13
+ 'ar': () => import('../locales/ar.json'),
13
14
  'de': () => import('../locales/de.json'),
14
15
  'es-419': () => import('../locales/es-419.json'),
15
16
  'fr': () => import('../locales/fr.json'),
17
+ 'he': () => import('../locales/he.json'),
16
18
  'it': () => import('../locales/it.json'),
17
19
  'ja': () => import('../locales/ja.json'),
18
20
  'ko': () => import('../locales/ko.json'),