@banou/media-player 0.10.30 → 0.10.32

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.
Files changed (59) hide show
  1. package/README.md +23 -0
  2. package/dist/de-DphEdq0O.js +52 -0
  3. package/dist/engine/index.js +1 -1
  4. package/dist/engine/playback.d.ts +4 -3
  5. package/dist/engine/source-buffer.d.ts +0 -1
  6. package/dist/{engine-DeEY2qao.js → engine-BZDbaSfM.js} +211 -161
  7. package/dist/es-419-D6gsvnn8.js +52 -0
  8. package/dist/fr-BqAzAJX0.js +52 -0
  9. package/dist/index.js +942 -855
  10. package/dist/it-NTcUh3Gr.js +52 -0
  11. package/dist/ja-DSmX_bxj.js +52 -0
  12. package/dist/ko-DyPzWasj.js +52 -0
  13. package/dist/labels.d.ts +71 -0
  14. package/dist/pl-C6Ow4ra5.js +52 -0
  15. package/dist/pt-BR-wudK3giz.js +52 -0
  16. package/dist/react/labels.d.ts +28 -0
  17. package/dist/react/video-player.d.ts +9 -0
  18. package/dist/ru-D5kxBkik.js +52 -0
  19. package/dist/tr-CW7R7N9k.js +52 -0
  20. package/dist/utils/track-label.d.ts +9 -8
  21. package/dist/volume-normalizer-worklet.js +40 -26
  22. package/dist/zh-Hans-IhL1Pl78.js +52 -0
  23. package/dist/zh-Hant-C5YyFjEc.js +52 -0
  24. package/package.json +4 -2
  25. package/src/lib/audio/loudness-analysis.ts +3 -3
  26. package/src/lib/audio/playback-tap.ts +3 -3
  27. package/src/lib/audio/volume-normalizer-worklet.d.ts +1 -1
  28. package/src/lib/audio/volume-normalizer-worklet.js +40 -26
  29. package/src/lib/engine/playback.ts +21 -22
  30. package/src/lib/engine/source-buffer.ts +5 -7
  31. package/src/lib/labels.ts +75 -0
  32. package/src/lib/locales/de.json +49 -0
  33. package/src/lib/locales/es-419.json +49 -0
  34. package/src/lib/locales/fr.json +49 -0
  35. package/src/lib/locales/it.json +49 -0
  36. package/src/lib/locales/ja.json +49 -0
  37. package/src/lib/locales/ko.json +49 -0
  38. package/src/lib/locales/pl.json +49 -0
  39. package/src/lib/locales/pt-BR.json +49 -0
  40. package/src/lib/locales/ru.json +49 -0
  41. package/src/lib/locales/tr.json +49 -0
  42. package/src/lib/locales/zh-Hans.json +49 -0
  43. package/src/lib/locales/zh-Hant.json +49 -0
  44. package/src/lib/react/components/burn-in-hint.tsx +4 -1
  45. package/src/lib/react/components/chrome.tsx +9 -0
  46. package/src/lib/react/components/control-bar.tsx +15 -26
  47. package/src/lib/react/components/errors.tsx +11 -9
  48. package/src/lib/react/components/overlay.tsx +18 -5
  49. package/src/lib/react/components/playback-slider.tsx +4 -1
  50. package/src/lib/react/components/settings.tsx +23 -31
  51. package/src/lib/react/components/skip-chapter.tsx +5 -2
  52. package/src/lib/react/components/sound.tsx +5 -2
  53. package/src/lib/react/components/subtitles.tsx +7 -4
  54. package/src/lib/react/components/track-menu.tsx +8 -4
  55. package/src/lib/react/components/volume-slider.tsx +3 -1
  56. package/src/lib/react/hooks/use-playback.ts +12 -2
  57. package/src/lib/react/labels.tsx +125 -0
  58. package/src/lib/react/video-player.tsx +14 -1
  59. package/src/lib/utils/track-label.ts +16 -11
@@ -0,0 +1,52 @@
1
+ //#region src/lib/locales/it.json
2
+ var e = "Audio", t = "Copiato", n = "Copia", r = "Disattivati", i = "Disattiva audio", a = "Pausa", o = "Riproduci", s = "Qualità", c = "Guarda di nuovo", l = "Impostazioni", u = "Sottotitoli", d = "Non disponibile", f = "ripristinato", p = {
3
+ "(Default)": "(Normale)",
4
+ Audio: e,
5
+ Copied: t,
6
+ Copy: n,
7
+ "Copy the errors": "Copia gli errori",
8
+ "Could not switch. Try again.": "Impossibile cambiare. Riprova.",
9
+ Disable: r,
10
+ "Exit full screen (f)": "Esci da schermo intero (f)",
11
+ "Exit picture in picture": "Esci da picture in picture",
12
+ "Full screen": "Schermo intero",
13
+ "Full screen (f)": "Schermo intero (f)",
14
+ Mute: i,
15
+ "Mute (m)": "Disattiva audio (m)",
16
+ "Normalize volume": "Normalizza volume",
17
+ "Now click your browser's pop out button": "Ora fai clic sul pulsante picture in picture del browser",
18
+ Pause: a,
19
+ "Pause (k)": "Pausa (k)",
20
+ "Picture in picture": "Picture in picture",
21
+ Play: o,
22
+ "Play (k)": "Riproduci (k)",
23
+ "Playback errors ({count})": "Errori di riproduzione ({count})",
24
+ "Playback failed": "Riproduzione non riuscita",
25
+ "Playback speed": "Velocità",
26
+ "Put the subtitles in the picture": "Inserisci i sottotitoli nell’immagine",
27
+ "Put the subtitles in the video": "Inserisci i sottotitoli nel video",
28
+ Quality: s,
29
+ "Reading the video file failed": "Lettura del file video non riuscita",
30
+ Replay: c,
31
+ "Replay (k)": "Guarda di nuovo (k)",
32
+ Settings: l,
33
+ "Skip Ending": "Salta sigla finale",
34
+ "Skip Opening": "Salta sigla",
35
+ Subtitles: u,
36
+ "Subtitles are in the picture": "I sottotitoli sono nell’immagine",
37
+ "The MediaSource closed before a SourceBuffer could be created": "La MediaSource si è chiusa prima che si potesse creare un SourceBuffer",
38
+ "The MediaSource never opened": "La MediaSource non si è mai aperta",
39
+ "The browser rejected a media segment": "Il browser ha rifiutato un segmento multimediale",
40
+ "The video codec in this file could not be identified": "Impossibile identificare il codec video di questo file",
41
+ "This browser cannot play the codecs in this file: {codecs}": "Questo browser non può riprodurre i codec di questo file: {codecs}",
42
+ "This file has no subtitles": "Questo file non ha sottotitoli",
43
+ "Track {number}": "Traccia {number}",
44
+ Unavailable: d,
45
+ "Unmute (m)": "Attiva audio (m)",
46
+ "at {time}": "posizione {time}",
47
+ recovered: f,
48
+ "{rate}x": "{rate}x",
49
+ "{start} to {end}": "da {start} a {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/ja.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": "SourceBuffer を作成する前に MediaSource が閉じました",
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/ko.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": "PIP 모드 종료",
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": "이제 브라우저의 PIP 버튼을 클릭하세요",
18
+ Pause: a,
19
+ "Pause (k)": "일시정지 (k)",
20
+ "Picture in picture": "PIP 모드",
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": "SourceBuffer를 만들기 전에 MediaSource가 닫혔습니다",
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,71 @@
1
+ /**
2
+ * Every text the chrome shows, in English. The English is also the text's id in each catalogue
3
+ * (`src/lib/locales/<tag>.json`), as stub keys its own. A `{name}` is a value filled in where the text is shown,
4
+ * and the English uses nothing else, so it is shown with no formatter loaded; a translation may use any ICU syntax.
5
+ * Imports nothing, since the engine names its failures with it.
6
+ */
7
+ export declare const LABELS: {
8
+ readonly play: 'Play';
9
+ readonly pause: 'Pause';
10
+ readonly replay: 'Replay';
11
+ readonly playKey: 'Play (k)';
12
+ readonly pauseKey: 'Pause (k)';
13
+ readonly replayKey: 'Replay (k)';
14
+ readonly mute: 'Mute';
15
+ readonly muteKey: 'Mute (m)';
16
+ readonly unmuteKey: 'Unmute (m)';
17
+ readonly fullScreen: 'Full screen';
18
+ readonly fullScreenKey: 'Full screen (f)';
19
+ readonly exitFullScreenKey: 'Exit full screen (f)';
20
+ readonly pictureInPicture: 'Picture in picture';
21
+ readonly exitPictureInPicture: 'Exit picture in picture';
22
+ readonly burnIn: 'Put the subtitles in the video';
23
+ readonly burnInOffer: 'Put the subtitles in the picture';
24
+ readonly burnedIn: 'Subtitles are in the picture';
25
+ readonly noSubtitles: 'This file has no subtitles';
26
+ readonly burnInHint: 'Now click your browser\'s pop out button';
27
+ readonly subtitles: 'Subtitles';
28
+ readonly subtitlesOff: 'Disable';
29
+ readonly settings: 'Settings';
30
+ readonly audio: 'Audio';
31
+ readonly quality: 'Quality';
32
+ readonly playbackSpeed: 'Playback speed';
33
+ readonly defaultSpeed: '(Default)';
34
+ readonly speed: '{rate}x';
35
+ readonly normalizeVolume: 'Normalize volume';
36
+ readonly unavailable: 'Unavailable';
37
+ readonly switchFailed: 'Could not switch. Try again.';
38
+ readonly track: 'Track {number}';
39
+ readonly skipOpening: 'Skip Opening';
40
+ readonly skipEnding: 'Skip Ending';
41
+ readonly errors: 'Playback errors ({count})';
42
+ readonly copyErrors: 'Copy the errors';
43
+ readonly copy: 'Copy';
44
+ readonly copied: 'Copied';
45
+ readonly errorSpan: '{start} to {end}';
46
+ readonly errorAt: 'at {time}';
47
+ readonly recovered: 'recovered';
48
+ readonly failed: 'Playback failed';
49
+ readonly codecUnknown: 'The video codec in this file could not be identified';
50
+ readonly codecsUnsupported: 'This browser cannot play the codecs in this file: {codecs}';
51
+ readonly sourceNeverOpened: 'The MediaSource never opened';
52
+ readonly sourceClosed: 'The MediaSource closed before a SourceBuffer could be created';
53
+ readonly readFailed: 'Reading the video file failed';
54
+ readonly segmentRejected: 'The browser rejected a media segment';
55
+ };
56
+ export type Label = (typeof LABELS)[keyof typeof LABELS];
57
+ type Placeholders<T extends string> = T extends `${string}{${infer Name}}${infer Rest}` ? Name | Placeholders<Rest> : never;
58
+ /** The values `label` is shown with, one per `{name}` it holds, or none. */
59
+ export type LabelValues<L extends Label> = [Placeholders<L>] extends [never] ? [] : [Record<Placeholders<L>, string | number>];
60
+ /** `label` in English, each `{name}` replaced by its value as given. */
61
+ export declare const fill: (label: string, values?: Readonly<Record<string, string | number>>) => string;
62
+ /**
63
+ * A failure of the engine the chrome shows in its language: an Error whose message is `label` in English, with the
64
+ * label and its values on it. The engine writes the label as its literal, so taking this module brings no table along.
65
+ */
66
+ export type LabelledError = Error & {
67
+ label: Label;
68
+ values?: Readonly<Record<string, string>>;
69
+ };
70
+ export declare const labelledError: (label: Label, values?: Readonly<Record<string, string>>, options?: ErrorOptions) => LabelledError;
71
+ export {};
@@ -0,0 +1,52 @@
1
+ //#region src/lib/locales/pl.json
2
+ var e = "Dźwięk", t = "Skopiowano", n = "Kopiuj", r = "Wyłączone", i = "Wycisz", a = "Wstrzymaj", o = "Odtwórz", s = "Jakość", c = "Odtwórz ponownie", l = "Ustawienia", u = "Napisy", d = "Niedostępne", f = "naprawiono", p = {
3
+ "(Default)": "(Normalna)",
4
+ Audio: e,
5
+ Copied: t,
6
+ Copy: n,
7
+ "Copy the errors": "Kopiuj błędy",
8
+ "Could not switch. Try again.": "Nie udało się przełączyć. Spróbuj ponownie.",
9
+ Disable: r,
10
+ "Exit full screen (f)": "Zamknij pełny ekran (f)",
11
+ "Exit picture in picture": "Zamknij obraz w obrazie",
12
+ "Full screen": "Pełny ekran",
13
+ "Full screen (f)": "Pełny ekran (f)",
14
+ Mute: i,
15
+ "Mute (m)": "Wycisz (m)",
16
+ "Normalize volume": "Wyrównaj głośność",
17
+ "Now click your browser's pop out button": "Teraz kliknij przycisk obrazu w obrazie w przeglądarce",
18
+ Pause: a,
19
+ "Pause (k)": "Wstrzymaj (k)",
20
+ "Picture in picture": "Obraz w obrazie",
21
+ Play: o,
22
+ "Play (k)": "Odtwórz (k)",
23
+ "Playback errors ({count})": "Błędy odtwarzania ({count})",
24
+ "Playback failed": "Nie udało się odtworzyć",
25
+ "Playback speed": "Szybkość",
26
+ "Put the subtitles in the picture": "Wtop napisy w obraz",
27
+ "Put the subtitles in the video": "Wtop napisy w wideo",
28
+ Quality: s,
29
+ "Reading the video file failed": "Nie udało się odczytać pliku wideo",
30
+ Replay: c,
31
+ "Replay (k)": "Odtwórz ponownie (k)",
32
+ Settings: l,
33
+ "Skip Ending": "Pomiń napisy końcowe",
34
+ "Skip Opening": "Pomiń czołówkę",
35
+ Subtitles: u,
36
+ "Subtitles are in the picture": "Napisy są w obrazie",
37
+ "The MediaSource closed before a SourceBuffer could be created": "MediaSource zamknął się, zanim udało się utworzyć SourceBuffer",
38
+ "The MediaSource never opened": "MediaSource nigdy się nie otworzył",
39
+ "The browser rejected a media segment": "Przeglądarka odrzuciła segment multimedialny",
40
+ "The video codec in this file could not be identified": "Nie udało się rozpoznać kodeka wideo tego pliku",
41
+ "This browser cannot play the codecs in this file: {codecs}": "Ta przeglądarka nie może odtworzyć kodeków tego pliku: {codecs}",
42
+ "This file has no subtitles": "Ten plik nie ma napisów",
43
+ "Track {number}": "Ścieżka {number}",
44
+ Unavailable: d,
45
+ "Unmute (m)": "Wyłącz wyciszenie (m)",
46
+ "at {time}": "w {time}",
47
+ recovered: f,
48
+ "{rate}x": "{rate}x",
49
+ "{start} to {end}": "od {start} do {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/pt-BR.json
2
+ var e = "Áudio", t = "Copiado", n = "Copiar", r = "Desativadas", i = "Desativar som", a = "Pausar", o = "Reproduzir", s = "Qualidade", c = "Assistir de novo", l = "Configurações", u = "Legendas", d = "Indisponível", f = "recuperado", p = {
3
+ "(Default)": "(Normal)",
4
+ Audio: e,
5
+ Copied: t,
6
+ Copy: n,
7
+ "Copy the errors": "Copiar os erros",
8
+ "Could not switch. Try again.": "Não foi possível trocar. Tente de novo.",
9
+ Disable: r,
10
+ "Exit full screen (f)": "Sair da tela cheia (f)",
11
+ "Exit picture in picture": "Sair do picture-in-picture",
12
+ "Full screen": "Tela cheia",
13
+ "Full screen (f)": "Tela cheia (f)",
14
+ Mute: i,
15
+ "Mute (m)": "Desativar som (m)",
16
+ "Normalize volume": "Normalizar volume",
17
+ "Now click your browser's pop out button": "Agora clique no botão de picture-in-picture do seu navegador",
18
+ Pause: a,
19
+ "Pause (k)": "Pausar (k)",
20
+ "Picture in picture": "Picture-in-picture",
21
+ Play: o,
22
+ "Play (k)": "Reproduzir (k)",
23
+ "Playback errors ({count})": "Erros de reprodução ({count})",
24
+ "Playback failed": "Falha na reprodução",
25
+ "Playback speed": "Velocidade",
26
+ "Put the subtitles in the picture": "Colocar as legendas na imagem",
27
+ "Put the subtitles in the video": "Colocar as legendas no vídeo",
28
+ Quality: s,
29
+ "Reading the video file failed": "Não foi possível ler o arquivo de vídeo",
30
+ Replay: c,
31
+ "Replay (k)": "Assistir de novo (k)",
32
+ Settings: l,
33
+ "Skip Ending": "Pular encerramento",
34
+ "Skip Opening": "Pular abertura",
35
+ Subtitles: u,
36
+ "Subtitles are in the picture": "As legendas estão na imagem",
37
+ "The MediaSource closed before a SourceBuffer could be created": "O MediaSource fechou antes que um SourceBuffer pudesse ser criado",
38
+ "The MediaSource never opened": "O MediaSource nunca abriu",
39
+ "The browser rejected a media segment": "O navegador rejeitou um segmento de mídia",
40
+ "The video codec in this file could not be identified": "Não foi possível identificar o codec de vídeo deste arquivo",
41
+ "This browser cannot play the codecs in this file: {codecs}": "Este navegador não consegue reproduzir os codecs deste arquivo: {codecs}",
42
+ "This file has no subtitles": "Este arquivo não tem legendas",
43
+ "Track {number}": "Faixa {number}",
44
+ Unavailable: d,
45
+ "Unmute (m)": "Ativar som (m)",
46
+ "at {time}": "em {time}",
47
+ recovered: f,
48
+ "{rate}x": "{rate}x",
49
+ "{start} to {end}": "de {start} a {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,28 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { Label, LabelValues } from '../labels';
3
+ /** The languages the labels are written in besides English, one catalogue each. */
4
+ export declare const LANGUAGES: readonly string[];
5
+ /**
6
+ * The catalogue serving `language`, a BCP 47 tag: its own, else the one of its language and script once maximized
7
+ * (`es-MX` finds `es-419`, `pt-PT` finds `pt-BR`, `zh-TW` finds `zh-Hant`), else one of its language. Undefined for
8
+ * English and for a language with none.
9
+ */
10
+ export declare const catalogueFor: (language: string) => string | undefined;
11
+ /** The chrome's text in the language of the player around it. */
12
+ export type Labels = {
13
+ /** `label` in the player's language, with its values filled in. */
14
+ format: <L extends Label>(label: L, ...values: LabelValues<L>) => string;
15
+ /** A number as `locale` writes it, as English does when it is undefined. */
16
+ number: (value: number, options?: Intl.NumberFormatOptions) => string;
17
+ /**
18
+ * The tag the player was given, which its numbers and track languages are written in even when no catalogue serves
19
+ * it: `en` when Intl cannot read it, undefined when it was given none.
20
+ */
21
+ locale: string | undefined;
22
+ };
23
+ export declare const useLabels: () => Labels;
24
+ /** The labels of a player given `language`: English at once, then its catalogue's once that has loaded. */
25
+ export declare const LabelsProvider: ({ language, children }: {
26
+ language?: string;
27
+ children: ReactNode;
28
+ }) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -78,6 +78,15 @@ type CommonOptions = {
78
78
  * store's `attach` and does nothing at all until a media arrives.
79
79
  */
80
80
  controls?: boolean;
81
+ /**
82
+ * The language of the player's own labels (the controls, tooltips, menus, skip offers and failures), a BCP 47 tag
83
+ * such as the host page shows (`fr`, `es-MX`, `zh-TW`). The labels are shown in the closest language the player has,
84
+ * the numbers in them written as this tag writes them, and track languages named in it, even when the labels are
85
+ * English (`en-DE` writes `0,5x`). A language's text loads the first time a player shows it, and the labels are
86
+ * English until it has. Without it, or for a language the player does not have, they are English and nothing more is
87
+ * loaded; without it, track languages are named in the browser's.
88
+ */
89
+ language?: string;
81
90
  /**
82
91
  * Where the keyboard shortcuts listen. `'window'`, the default, takes keys from the whole page, which suits a
83
92
  * page that is only the player. `'player'` takes a key only when the focus is inside the player (a click on the
@@ -0,0 +1,52 @@
1
+ //#region src/lib/locales/ru.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/tr.json
2
+ var e = "Ses", t = "Kopyalandı", n = "Kopyala", r = "Kapalı", i = "Sesi kapat", a = "Duraklat", o = "Oynat", s = "Kalite", c = "Tekrar oynat", l = "Ayarlar", u = "Altyazılar", d = "Kullanılamıyor", f = "düzeldi", p = {
3
+ "(Default)": "(Normal)",
4
+ Audio: "Ses",
5
+ Copied: t,
6
+ Copy: n,
7
+ "Copy the errors": "Hataları kopyala",
8
+ "Could not switch. Try again.": "Değiştirilemedi. Tekrar deneyin.",
9
+ Disable: r,
10
+ "Exit full screen (f)": "Tam ekrandan çık (f)",
11
+ "Exit picture in picture": "Pencere içinde pencereden çık",
12
+ "Full screen": "Tam ekran",
13
+ "Full screen (f)": "Tam ekran (f)",
14
+ Mute: i,
15
+ "Mute (m)": "Sesi kapat (m)",
16
+ "Normalize volume": "Sesi dengele",
17
+ "Now click your browser's pop out button": "Şimdi tarayıcınızın pencere içinde pencere düğmesine tıklayın",
18
+ Pause: a,
19
+ "Pause (k)": "Duraklat (k)",
20
+ "Picture in picture": "Pencere içinde pencere",
21
+ Play: o,
22
+ "Play (k)": "Oynat (k)",
23
+ "Playback errors ({count})": "Oynatma hataları ({count})",
24
+ "Playback failed": "Oynatılamadı",
25
+ "Playback speed": "Oynatma hızı",
26
+ "Put the subtitles in the picture": "Altyazıları görüntüye göm",
27
+ "Put the subtitles in the video": "Altyazıları videoya göm",
28
+ Quality: s,
29
+ "Reading the video file failed": "Video dosyası okunamadı",
30
+ Replay: c,
31
+ "Replay (k)": "Tekrar oynat (k)",
32
+ Settings: l,
33
+ "Skip Ending": "Kapanışı atla",
34
+ "Skip Opening": "Açılışı atla",
35
+ Subtitles: u,
36
+ "Subtitles are in the picture": "Altyazılar görüntüye gömülü",
37
+ "The MediaSource closed before a SourceBuffer could be created": "MediaSource, SourceBuffer oluşturulamadan kapandı",
38
+ "The MediaSource never opened": "MediaSource hiç açılmadı",
39
+ "The browser rejected a media segment": "Tarayıcı bir medya segmentini reddetti",
40
+ "The video codec in this file could not be identified": "Bu dosyanın video kodeki belirlenemedi",
41
+ "This browser cannot play the codecs in this file: {codecs}": "Bu tarayıcı bu dosyadaki kodekleri oynatamıyor: {codecs}",
42
+ "This file has no subtitles": "Bu dosyada altyazı yok",
43
+ "Track {number}": "Parça {number}",
44
+ Unavailable: d,
45
+ "Unmute (m)": "Sesi aç (m)",
46
+ "at {time}": "{time} konumunda",
47
+ recovered: f,
48
+ "{rate}x": "{rate}x",
49
+ "{start} to {end}": "{start} ile {end} arası"
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 };
@@ -1,3 +1,4 @@
1
+ import type { Labels } from '../react/labels';
1
2
  export type LabelledTrack = {
2
3
  streamIndex: number;
3
4
  title: string;
@@ -9,16 +10,16 @@ export type NamedTrack = {
9
10
  label: string;
10
11
  };
11
12
  /**
12
- * Human name for a track's language tag. `fallback: 'none'` is what makes an unknown tag come back
13
- * undefined instead of echoing itself, so the caller can fall through to the title.
13
+ * Human name for a track's language tag, in `locale`, else in the browser's language. `fallback: 'none'` is what makes
14
+ * an unknown tag come back undefined instead of echoing itself, so the caller can fall through to the title.
14
15
  */
15
- export declare const displayLanguage: (language: string | undefined) => string | undefined;
16
+ export declare const displayLanguage: (language: string | undefined, locale?: string) => string | undefined;
16
17
  /**
17
- * Names a set of tracks for a menu, by language, falling back to the title then the stream index.
18
- * The title is appended only to break a tie, because on a MultiSub release every title is the same
19
- * source tag and titling every row gives nine identical entries.
18
+ * Names a set of tracks for a menu, by language, falling back to the title then the stream index, in the language of
19
+ * `labels` (English without). The title is appended only to break a tie, because on a MultiSub release every title is
20
+ * the same source tag and titling every row gives nine identical entries.
20
21
  */
21
- export declare const labelTracks: <T extends LabelledTrack>(tracks: T[]) => {
22
+ export declare const labelTracks: <T extends LabelledTrack>(tracks: T[], labels?: Labels) => {
22
23
  track: T;
23
24
  label: string;
24
25
  }[];
@@ -28,4 +29,4 @@ export declare const labelTracks: <T extends LabelledTrack>(tracks: T[]) => {
28
29
  * The store's ids are opaque so a source that owns its own player can use its own track ids; the id
29
30
  * here is the libav stream index, which is what this half of the code has to say.
30
31
  */
31
- export declare const toNamedTracks: <T extends LabelledTrack>(tracks: T[]) => NamedTrack[];
32
+ export declare const toNamedTracks: <T extends LabelledTrack>(tracks: T[], labels?: Labels) => NamedTrack[];