@banou/media-player 0.10.29 → 0.10.31
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 +23 -1
- package/dist/de-DphEdq0O.js +52 -0
- package/dist/engine/index.js +1 -1
- package/dist/{engine-DeEY2qao.js → engine-5XbZqrD3.js} +213 -162
- package/dist/es-419-D6gsvnn8.js +52 -0
- package/dist/fr-BqAzAJX0.js +52 -0
- package/dist/index.js +931 -844
- package/dist/it-NTcUh3Gr.js +52 -0
- package/dist/ja-DSmX_bxj.js +52 -0
- package/dist/ko-DyPzWasj.js +52 -0
- package/dist/labels.d.ts +71 -0
- package/dist/language/index.d.ts +6 -0
- package/dist/language/index.js +34 -27
- package/dist/pl-C6Ow4ra5.js +52 -0
- package/dist/pt-BR-wudK3giz.js +52 -0
- package/dist/react/labels.d.ts +28 -0
- package/dist/react/video-player.d.ts +9 -0
- package/dist/ru-D5kxBkik.js +52 -0
- package/dist/tr-CW7R7N9k.js +52 -0
- package/dist/utils/track-label.d.ts +9 -8
- package/dist/zh-Hans-IhL1Pl78.js +52 -0
- package/dist/zh-Hant-C5YyFjEc.js +52 -0
- package/package.json +3 -1
- package/src/lib/engine/playback.ts +6 -5
- package/src/lib/engine/source-buffer.ts +3 -1
- package/src/lib/labels.ts +75 -0
- package/src/lib/language/index.ts +13 -1
- package/src/lib/locales/de.json +49 -0
- package/src/lib/locales/es-419.json +49 -0
- package/src/lib/locales/fr.json +49 -0
- package/src/lib/locales/it.json +49 -0
- package/src/lib/locales/ja.json +49 -0
- package/src/lib/locales/ko.json +49 -0
- package/src/lib/locales/pl.json +49 -0
- package/src/lib/locales/pt-BR.json +49 -0
- package/src/lib/locales/ru.json +49 -0
- package/src/lib/locales/tr.json +49 -0
- package/src/lib/locales/zh-Hans.json +49 -0
- package/src/lib/locales/zh-Hant.json +49 -0
- package/src/lib/react/components/burn-in-hint.tsx +4 -1
- package/src/lib/react/components/chrome.tsx +9 -0
- package/src/lib/react/components/control-bar.tsx +15 -26
- package/src/lib/react/components/errors.tsx +11 -9
- package/src/lib/react/components/overlay.tsx +18 -5
- package/src/lib/react/components/playback-slider.tsx +4 -1
- package/src/lib/react/components/settings.tsx +23 -31
- package/src/lib/react/components/skip-chapter.tsx +5 -2
- package/src/lib/react/components/sound.tsx +5 -2
- package/src/lib/react/components/subtitles.tsx +7 -4
- package/src/lib/react/components/track-menu.tsx +8 -4
- package/src/lib/react/components/volume-slider.tsx +3 -1
- package/src/lib/react/hooks/use-playback.ts +12 -2
- package/src/lib/react/labels.tsx +125 -0
- package/src/lib/react/video-player.tsx +14 -1
- package/src/lib/utils/track-label.ts +16 -11
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
//#region src/lib/locales/zh-Hans.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/zh-Hant.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@banou/media-player",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.31",
|
|
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",
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
"author": "Banou26",
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@banou/ponyfill": "^0.0.12",
|
|
52
|
+
"@formatjs/intl": "^6.1.4",
|
|
52
53
|
"@videojs/core": "10.0.0-beta.26",
|
|
53
54
|
"@videojs/react": "10.0.0-beta.26",
|
|
54
55
|
"ass-compiler": "^0.1.16",
|
|
@@ -64,6 +65,7 @@
|
|
|
64
65
|
},
|
|
65
66
|
"devDependencies": {
|
|
66
67
|
"@emotion/react": "^11.14.0",
|
|
68
|
+
"@formatjs/cli": "^6.16.35",
|
|
67
69
|
"@types/node": "^22.20.1",
|
|
68
70
|
"@types/react": "^19.0.0",
|
|
69
71
|
"@types/react-dom": "^19.0.0",
|
|
@@ -4,6 +4,7 @@ import { makeRemuxer } from 'libav-wasm'
|
|
|
4
4
|
|
|
5
5
|
import { getTimeRanges, updateSourceBuffer } from './source-buffer'
|
|
6
6
|
import { createSubtitleRenderer } from './subtitles'
|
|
7
|
+
import { labelledError } from '../labels'
|
|
7
8
|
import type { SubtitleStream } from './subtitles'
|
|
8
9
|
|
|
9
10
|
export type { AudioStream }
|
|
@@ -219,10 +220,10 @@ export const startPlayback = async (options: PlaybackOptions): Promise<PlaybackC
|
|
|
219
220
|
if (metadata.attachments?.length) subtitles.pushAttachments(metadata.attachments)
|
|
220
221
|
|
|
221
222
|
// an unparseable codec is an empty string, which isTypeSupported would accept as audio-only
|
|
222
|
-
if (!metadata.info.output.videoMimeType) throw
|
|
223
|
+
if (!metadata.info.output.videoMimeType) throw labelledError('The video codec in this file could not be identified')
|
|
223
224
|
const codecs = [metadata.info.output.videoMimeType, metadata.info.output.audioMimeType].filter(Boolean).join(',')
|
|
224
225
|
const mime = `video/mp4; codecs="${codecs}"`
|
|
225
|
-
if (!MediaSource.isTypeSupported(mime)) throw
|
|
226
|
+
if (!MediaSource.isTypeSupported(mime)) throw labelledError('This browser cannot play the codecs in this file: {codecs}', { codecs })
|
|
226
227
|
|
|
227
228
|
const mediaSource = new MediaSource()
|
|
228
229
|
const mediaSourceUrl = URL.createObjectURL(mediaSource)
|
|
@@ -252,7 +253,7 @@ export const startPlayback = async (options: PlaybackOptions): Promise<PlaybackC
|
|
|
252
253
|
})
|
|
253
254
|
|
|
254
255
|
const sourceBuffer = await new Promise<SourceBuffer>((resolve, reject) => {
|
|
255
|
-
const timeout = setTimeout(() => { cleanup(); reject(
|
|
256
|
+
const timeout = setTimeout(() => { cleanup(); reject(labelledError('The MediaSource never opened')) }, SOURCE_OPEN_TIMEOUT)
|
|
256
257
|
const cleanup = () => {
|
|
257
258
|
clearTimeout(timeout)
|
|
258
259
|
mediaSource.removeEventListener('sourceopen', onSourceOpen)
|
|
@@ -272,7 +273,7 @@ export const startPlayback = async (options: PlaybackOptions): Promise<PlaybackC
|
|
|
272
273
|
reject(error)
|
|
273
274
|
}
|
|
274
275
|
}
|
|
275
|
-
const onFail = () => { cleanup(); reject(
|
|
276
|
+
const onFail = () => { cleanup(); reject(labelledError('The MediaSource closed before a SourceBuffer could be created')) }
|
|
276
277
|
mediaSource.addEventListener('sourceopen', onSourceOpen, { once: true })
|
|
277
278
|
mediaSource.addEventListener('sourceclose', onFail, { once: true })
|
|
278
279
|
mediaSource.addEventListener('error', onFail, { once: true })
|
|
@@ -326,7 +327,7 @@ export const startPlayback = async (options: PlaybackOptions): Promise<PlaybackC
|
|
|
326
327
|
// and never told to.
|
|
327
328
|
if (outstandingError && !terminal) return
|
|
328
329
|
outstandingError = true
|
|
329
|
-
onError?.(cancelled ?
|
|
330
|
+
onError?.(cancelled ? labelledError('Reading the video file failed', undefined, { cause: error }) : error)
|
|
330
331
|
}
|
|
331
332
|
|
|
332
333
|
const evict = async (tight = false) => {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { labelledError } from '../labels'
|
|
2
|
+
|
|
1
3
|
// appendBuffer, remove and timestampOffset must never overlap an in-flight update, so every op
|
|
2
4
|
// goes through one chain
|
|
3
5
|
|
|
@@ -20,7 +22,7 @@ const waitForUpdate = (sourceBuffer: SourceBuffer) =>
|
|
|
20
22
|
sourceBuffer.removeEventListener('error', onError)
|
|
21
23
|
}
|
|
22
24
|
const onEnd = () => { cleanup(); resolve() }
|
|
23
|
-
const onError = (ev: Event) => { cleanup(); reject(
|
|
25
|
+
const onError = (ev: Event) => { cleanup(); reject(labelledError('The browser rejected a media segment', undefined, { cause: ev })) }
|
|
24
26
|
sourceBuffer.addEventListener('updateend', onEnd, { once: true })
|
|
25
27
|
sourceBuffer.addEventListener('abort', onEnd, { once: true })
|
|
26
28
|
sourceBuffer.addEventListener('error', onError, { once: true })
|
|
@@ -0,0 +1,75 @@
|
|
|
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 const LABELS = {
|
|
8
|
+
play: 'Play',
|
|
9
|
+
pause: 'Pause',
|
|
10
|
+
replay: 'Replay',
|
|
11
|
+
playKey: 'Play (k)',
|
|
12
|
+
pauseKey: 'Pause (k)',
|
|
13
|
+
replayKey: 'Replay (k)',
|
|
14
|
+
mute: 'Mute',
|
|
15
|
+
muteKey: 'Mute (m)',
|
|
16
|
+
unmuteKey: 'Unmute (m)',
|
|
17
|
+
fullScreen: 'Full screen',
|
|
18
|
+
fullScreenKey: 'Full screen (f)',
|
|
19
|
+
exitFullScreenKey: 'Exit full screen (f)',
|
|
20
|
+
pictureInPicture: 'Picture in picture',
|
|
21
|
+
exitPictureInPicture: 'Exit picture in picture',
|
|
22
|
+
burnIn: 'Put the subtitles in the video',
|
|
23
|
+
burnInOffer: 'Put the subtitles in the picture',
|
|
24
|
+
burnedIn: 'Subtitles are in the picture',
|
|
25
|
+
noSubtitles: 'This file has no subtitles',
|
|
26
|
+
burnInHint: 'Now click your browser\'s pop out button',
|
|
27
|
+
subtitles: 'Subtitles',
|
|
28
|
+
subtitlesOff: 'Disable',
|
|
29
|
+
settings: 'Settings',
|
|
30
|
+
audio: 'Audio',
|
|
31
|
+
quality: 'Quality',
|
|
32
|
+
playbackSpeed: 'Playback speed',
|
|
33
|
+
defaultSpeed: '(Default)',
|
|
34
|
+
speed: '{rate}x',
|
|
35
|
+
normalizeVolume: 'Normalize volume',
|
|
36
|
+
unavailable: 'Unavailable',
|
|
37
|
+
switchFailed: 'Could not switch. Try again.',
|
|
38
|
+
track: 'Track {number}',
|
|
39
|
+
skipOpening: 'Skip Opening',
|
|
40
|
+
skipEnding: 'Skip Ending',
|
|
41
|
+
errors: 'Playback errors ({count})',
|
|
42
|
+
copyErrors: 'Copy the errors',
|
|
43
|
+
copy: 'Copy',
|
|
44
|
+
copied: 'Copied',
|
|
45
|
+
errorSpan: '{start} to {end}',
|
|
46
|
+
errorAt: 'at {time}',
|
|
47
|
+
recovered: 'recovered',
|
|
48
|
+
failed: 'Playback failed',
|
|
49
|
+
codecUnknown: 'The video codec in this file could not be identified',
|
|
50
|
+
codecsUnsupported: 'This browser cannot play the codecs in this file: {codecs}',
|
|
51
|
+
sourceNeverOpened: 'The MediaSource never opened',
|
|
52
|
+
sourceClosed: 'The MediaSource closed before a SourceBuffer could be created',
|
|
53
|
+
readFailed: 'Reading the video file failed',
|
|
54
|
+
segmentRejected: 'The browser rejected a media segment',
|
|
55
|
+
} as const
|
|
56
|
+
|
|
57
|
+
export type Label = (typeof LABELS)[keyof typeof LABELS]
|
|
58
|
+
|
|
59
|
+
type Placeholders<T extends string> = T extends `${string}{${infer Name}}${infer Rest}` ? Name | Placeholders<Rest> : never
|
|
60
|
+
|
|
61
|
+
/** The values `label` is shown with, one per `{name}` it holds, or none. */
|
|
62
|
+
export type LabelValues<L extends Label> = [Placeholders<L>] extends [never] ? [] : [Record<Placeholders<L>, string | number>]
|
|
63
|
+
|
|
64
|
+
/** `label` in English, each `{name}` replaced by its value as given. */
|
|
65
|
+
export const fill = (label: string, values: Readonly<Record<string, string | number>> = {}) =>
|
|
66
|
+
label.replace(/\{(\w+)\}/g, (_, name: string) => String(values[name]))
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* A failure of the engine the chrome shows in its language: an Error whose message is `label` in English, with the
|
|
70
|
+
* label and its values on it. The engine writes the label as its literal, so taking this module brings no table along.
|
|
71
|
+
*/
|
|
72
|
+
export type LabelledError = Error & { label: Label, values?: Readonly<Record<string, string>> }
|
|
73
|
+
|
|
74
|
+
export const labelledError = (label: Label, values?: Readonly<Record<string, string>>, options?: ErrorOptions): LabelledError =>
|
|
75
|
+
Object.assign(new Error(fill(label, values), options), { label, values })
|
|
@@ -20,6 +20,8 @@ const NOT_LANGUAGES = new Set(['und', 'zxx', 'mul', 'mis'])
|
|
|
20
20
|
// sign and song tracks, forced subtitles, commentaries and described audio, unless the title says it is the full track
|
|
21
21
|
const PARTIAL = /sign|song|forced|commentary|karaoke|descri/i
|
|
22
22
|
const FULL = /full|dialog/i
|
|
23
|
+
// closed captions, hearing impaired and audio description in a title, which Intl.Locale reads as regions (CC, AD) or accepts
|
|
24
|
+
const TRACK_NOTES = new Set(['CC', 'HI', 'AD'])
|
|
23
25
|
|
|
24
26
|
const key = (text: string) => text.normalize('NFKC').toLowerCase().replace(/\s+/g, ' ').trim()
|
|
25
27
|
|
|
@@ -65,7 +67,7 @@ const parseName = (text: string | undefined): Language | undefined => {
|
|
|
65
67
|
if (!named) return undefined
|
|
66
68
|
const region = qualifier?.trim()
|
|
67
69
|
// through Intl.Locale, which reads the 'UK' of 'English (UK)' as GB
|
|
68
|
-
return (region && /^(?:[A-Z]{2}|\d{3})$/.test(region) ? fromTag(`${named}-${region}`) : undefined) ?? fromTag(named)
|
|
70
|
+
return (region && /^(?:[A-Z]{2}|\d{3})$/.test(region) && !TRACK_NOTES.has(region) ? fromTag(`${named}-${region}`) : undefined) ?? fromTag(named)
|
|
69
71
|
}
|
|
70
72
|
|
|
71
73
|
const parseLanguage = (text: string | undefined) => {
|
|
@@ -80,6 +82,16 @@ const parseLanguage = (text: string | undefined) => {
|
|
|
80
82
|
export const languageOf = (track: LanguageTrack | undefined): string | undefined =>
|
|
81
83
|
parseLanguage(track?.language) ? track!.language!.trim() : parseName(track?.title) ? track!.title!.trim() : undefined
|
|
82
84
|
|
|
85
|
+
/**
|
|
86
|
+
* The BCP 47 tag of the language `text` names, as a tag (`jpn`, `en_US`) or a name (`Japanese`, `Português (Brasil)`),
|
|
87
|
+
* with its region or script when it names one: `ja`, `en-US`, `pt-BR`. Undefined for a text naming no language (`und`,
|
|
88
|
+
* `Signs & Songs`), so a preference `languageOf` saved can be handed to code that reads tags.
|
|
89
|
+
*/
|
|
90
|
+
export const languageTag = (text: string | undefined): string | undefined => {
|
|
91
|
+
const found = parseLanguage(text)
|
|
92
|
+
return found && (found.variant ? `${found.language}-${found.variant}` : found.language)
|
|
93
|
+
}
|
|
94
|
+
|
|
83
95
|
const isPartial = ({ language = '', title = '' }: LanguageTrack) => {
|
|
84
96
|
const text = `${language} ${title}`
|
|
85
97
|
return PARTIAL.test(text) && !FULL.test(text)
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"(Default)": "(Normal)",
|
|
3
|
+
"Audio": "Audio",
|
|
4
|
+
"Copied": "Kopiert",
|
|
5
|
+
"Copy": "Kopieren",
|
|
6
|
+
"Copy the errors": "Fehler kopieren",
|
|
7
|
+
"Could not switch. Try again.": "Wechsel fehlgeschlagen. Versuch es noch einmal.",
|
|
8
|
+
"Disable": "Aus",
|
|
9
|
+
"Exit full screen (f)": "Vollbild beenden (f)",
|
|
10
|
+
"Exit picture in picture": "Bild-im-Bild beenden",
|
|
11
|
+
"Full screen": "Vollbild",
|
|
12
|
+
"Full screen (f)": "Vollbild (f)",
|
|
13
|
+
"Mute": "Stummschalten",
|
|
14
|
+
"Mute (m)": "Stummschalten (m)",
|
|
15
|
+
"Normalize volume": "Lautstärke angleichen",
|
|
16
|
+
"Now click your browser's pop out button": "Klicke jetzt auf die Bild-im-Bild-Schaltfläche deines Browsers",
|
|
17
|
+
"Pause": "Pause",
|
|
18
|
+
"Pause (k)": "Pause (k)",
|
|
19
|
+
"Picture in picture": "Bild-im-Bild",
|
|
20
|
+
"Play": "Wiedergabe",
|
|
21
|
+
"Play (k)": "Wiedergabe (k)",
|
|
22
|
+
"Playback errors ({count})": "Wiedergabefehler ({count})",
|
|
23
|
+
"Playback failed": "Wiedergabe fehlgeschlagen",
|
|
24
|
+
"Playback speed": "Geschwindigkeit",
|
|
25
|
+
"Put the subtitles in the picture": "Untertitel ins Bild einbetten",
|
|
26
|
+
"Put the subtitles in the video": "Untertitel ins Video einbetten",
|
|
27
|
+
"Quality": "Qualität",
|
|
28
|
+
"Reading the video file failed": "Die Videodatei konnte nicht gelesen werden",
|
|
29
|
+
"Replay": "Erneut abspielen",
|
|
30
|
+
"Replay (k)": "Erneut abspielen (k)",
|
|
31
|
+
"Settings": "Einstellungen",
|
|
32
|
+
"Skip Ending": "Abspann überspringen",
|
|
33
|
+
"Skip Opening": "Intro überspringen",
|
|
34
|
+
"Subtitles": "Untertitel",
|
|
35
|
+
"Subtitles are in the picture": "Die Untertitel sind im Bild",
|
|
36
|
+
"The MediaSource closed before a SourceBuffer could be created": "Die MediaSource wurde geschlossen, bevor ein SourceBuffer erstellt werden konnte",
|
|
37
|
+
"The MediaSource never opened": "Die MediaSource wurde nie geöffnet",
|
|
38
|
+
"The browser rejected a media segment": "Der Browser hat ein Mediensegment abgelehnt",
|
|
39
|
+
"The video codec in this file could not be identified": "Der Videocodec dieser Datei konnte nicht erkannt werden",
|
|
40
|
+
"This browser cannot play the codecs in this file: {codecs}": "Dieser Browser kann die Codecs dieser Datei nicht abspielen: {codecs}",
|
|
41
|
+
"This file has no subtitles": "Diese Datei hat keine Untertitel",
|
|
42
|
+
"Track {number}": "Spur {number}",
|
|
43
|
+
"Unavailable": "Nicht verfügbar",
|
|
44
|
+
"Unmute (m)": "Ton einschalten (m)",
|
|
45
|
+
"at {time}": "bei {time}",
|
|
46
|
+
"recovered": "behoben",
|
|
47
|
+
"{rate}x": "{rate}x",
|
|
48
|
+
"{start} to {end}": "von {start} bis {end}"
|
|
49
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"(Default)": "(Normal)",
|
|
3
|
+
"Audio": "Audio",
|
|
4
|
+
"Copied": "Copiado",
|
|
5
|
+
"Copy": "Copiar",
|
|
6
|
+
"Copy the errors": "Copiar los errores",
|
|
7
|
+
"Could not switch. Try again.": "No se pudo cambiar. Vuelve a intentarlo.",
|
|
8
|
+
"Disable": "Desactivados",
|
|
9
|
+
"Exit full screen (f)": "Salir de pantalla completa (f)",
|
|
10
|
+
"Exit picture in picture": "Salir de imagen en imagen",
|
|
11
|
+
"Full screen": "Pantalla completa",
|
|
12
|
+
"Full screen (f)": "Pantalla completa (f)",
|
|
13
|
+
"Mute": "Silenciar",
|
|
14
|
+
"Mute (m)": "Silenciar (m)",
|
|
15
|
+
"Normalize volume": "Normalizar volumen",
|
|
16
|
+
"Now click your browser's pop out button": "Ahora haz clic en el botón de imagen en imagen de tu navegador",
|
|
17
|
+
"Pause": "Pausar",
|
|
18
|
+
"Pause (k)": "Pausar (k)",
|
|
19
|
+
"Picture in picture": "Imagen en imagen",
|
|
20
|
+
"Play": "Reproducir",
|
|
21
|
+
"Play (k)": "Reproducir (k)",
|
|
22
|
+
"Playback errors ({count})": "Errores de reproducción ({count})",
|
|
23
|
+
"Playback failed": "No se pudo reproducir",
|
|
24
|
+
"Playback speed": "Velocidad",
|
|
25
|
+
"Put the subtitles in the picture": "Incrustar los subtítulos en la imagen",
|
|
26
|
+
"Put the subtitles in the video": "Incrustar los subtítulos en el video",
|
|
27
|
+
"Quality": "Calidad",
|
|
28
|
+
"Reading the video file failed": "No se pudo leer el archivo de video",
|
|
29
|
+
"Replay": "Volver a ver",
|
|
30
|
+
"Replay (k)": "Volver a ver (k)",
|
|
31
|
+
"Settings": "Configuración",
|
|
32
|
+
"Skip Ending": "Saltar créditos",
|
|
33
|
+
"Skip Opening": "Saltar intro",
|
|
34
|
+
"Subtitles": "Subtítulos",
|
|
35
|
+
"Subtitles are in the picture": "Los subtítulos están en la imagen",
|
|
36
|
+
"The MediaSource closed before a SourceBuffer could be created": "La MediaSource se cerró antes de poder crear un SourceBuffer",
|
|
37
|
+
"The MediaSource never opened": "La MediaSource nunca se abrió",
|
|
38
|
+
"The browser rejected a media segment": "El navegador rechazó un segmento multimedia",
|
|
39
|
+
"The video codec in this file could not be identified": "No se pudo identificar el códec de video de este archivo",
|
|
40
|
+
"This browser cannot play the codecs in this file: {codecs}": "Este navegador no puede reproducir los códecs de este archivo: {codecs}",
|
|
41
|
+
"This file has no subtitles": "Este archivo no tiene subtítulos",
|
|
42
|
+
"Track {number}": "Pista {number}",
|
|
43
|
+
"Unavailable": "No disponible",
|
|
44
|
+
"Unmute (m)": "Activar sonido (m)",
|
|
45
|
+
"at {time}": "en {time}",
|
|
46
|
+
"recovered": "recuperado",
|
|
47
|
+
"{rate}x": "{rate}x",
|
|
48
|
+
"{start} to {end}": "de {start} a {end}"
|
|
49
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"(Default)": "(Normale)",
|
|
3
|
+
"Audio": "Audio",
|
|
4
|
+
"Copied": "Copié",
|
|
5
|
+
"Copy": "Copier",
|
|
6
|
+
"Copy the errors": "Copier les erreurs",
|
|
7
|
+
"Could not switch. Try again.": "Échec du changement. Réessayez.",
|
|
8
|
+
"Disable": "Désactivés",
|
|
9
|
+
"Exit full screen (f)": "Quitter le plein écran (f)",
|
|
10
|
+
"Exit picture in picture": "Quitter l’image dans l’image",
|
|
11
|
+
"Full screen": "Plein écran",
|
|
12
|
+
"Full screen (f)": "Plein écran (f)",
|
|
13
|
+
"Mute": "Couper le son",
|
|
14
|
+
"Mute (m)": "Couper le son (m)",
|
|
15
|
+
"Normalize volume": "Normaliser le volume",
|
|
16
|
+
"Now click your browser's pop out button": "Cliquez maintenant sur le bouton d’incrustation vidéo de votre navigateur",
|
|
17
|
+
"Pause": "Pause",
|
|
18
|
+
"Pause (k)": "Pause (k)",
|
|
19
|
+
"Picture in picture": "Image dans l’image",
|
|
20
|
+
"Play": "Lecture",
|
|
21
|
+
"Play (k)": "Lecture (k)",
|
|
22
|
+
"Playback errors ({count})": "Erreurs de lecture ({count})",
|
|
23
|
+
"Playback failed": "Échec de la lecture",
|
|
24
|
+
"Playback speed": "Vitesse de lecture",
|
|
25
|
+
"Put the subtitles in the picture": "Incruster les sous-titres dans l’image",
|
|
26
|
+
"Put the subtitles in the video": "Incruster les sous-titres dans la vidéo",
|
|
27
|
+
"Quality": "Qualité",
|
|
28
|
+
"Reading the video file failed": "La lecture du fichier vidéo a échoué",
|
|
29
|
+
"Replay": "Revoir",
|
|
30
|
+
"Replay (k)": "Revoir (k)",
|
|
31
|
+
"Settings": "Paramètres",
|
|
32
|
+
"Skip Ending": "Passer le générique de fin",
|
|
33
|
+
"Skip Opening": "Passer le générique",
|
|
34
|
+
"Subtitles": "Sous-titres",
|
|
35
|
+
"Subtitles are in the picture": "Les sous-titres sont incrustés dans l’image",
|
|
36
|
+
"The MediaSource closed before a SourceBuffer could be created": "La MediaSource s’est fermée avant qu’un SourceBuffer puisse être créé",
|
|
37
|
+
"The MediaSource never opened": "La MediaSource ne s’est jamais ouverte",
|
|
38
|
+
"The browser rejected a media segment": "Le navigateur a refusé un segment multimédia",
|
|
39
|
+
"The video codec in this file could not be identified": "Le codec vidéo de ce fichier n’a pas pu être identifié",
|
|
40
|
+
"This browser cannot play the codecs in this file: {codecs}": "Ce navigateur ne peut pas lire les codecs de ce fichier : {codecs}",
|
|
41
|
+
"This file has no subtitles": "Ce fichier n’a pas de sous-titres",
|
|
42
|
+
"Track {number}": "Piste {number}",
|
|
43
|
+
"Unavailable": "Indisponible",
|
|
44
|
+
"Unmute (m)": "Réactiver le son (m)",
|
|
45
|
+
"at {time}": "position {time}",
|
|
46
|
+
"recovered": "lecture rétablie",
|
|
47
|
+
"{rate}x": "{rate}x",
|
|
48
|
+
"{start} to {end}": "de {start} à {end}"
|
|
49
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"(Default)": "(Normale)",
|
|
3
|
+
"Audio": "Audio",
|
|
4
|
+
"Copied": "Copiato",
|
|
5
|
+
"Copy": "Copia",
|
|
6
|
+
"Copy the errors": "Copia gli errori",
|
|
7
|
+
"Could not switch. Try again.": "Impossibile cambiare. Riprova.",
|
|
8
|
+
"Disable": "Disattivati",
|
|
9
|
+
"Exit full screen (f)": "Esci da schermo intero (f)",
|
|
10
|
+
"Exit picture in picture": "Esci da picture in picture",
|
|
11
|
+
"Full screen": "Schermo intero",
|
|
12
|
+
"Full screen (f)": "Schermo intero (f)",
|
|
13
|
+
"Mute": "Disattiva audio",
|
|
14
|
+
"Mute (m)": "Disattiva audio (m)",
|
|
15
|
+
"Normalize volume": "Normalizza volume",
|
|
16
|
+
"Now click your browser's pop out button": "Ora fai clic sul pulsante picture in picture del browser",
|
|
17
|
+
"Pause": "Pausa",
|
|
18
|
+
"Pause (k)": "Pausa (k)",
|
|
19
|
+
"Picture in picture": "Picture in picture",
|
|
20
|
+
"Play": "Riproduci",
|
|
21
|
+
"Play (k)": "Riproduci (k)",
|
|
22
|
+
"Playback errors ({count})": "Errori di riproduzione ({count})",
|
|
23
|
+
"Playback failed": "Riproduzione non riuscita",
|
|
24
|
+
"Playback speed": "Velocità",
|
|
25
|
+
"Put the subtitles in the picture": "Inserisci i sottotitoli nell’immagine",
|
|
26
|
+
"Put the subtitles in the video": "Inserisci i sottotitoli nel video",
|
|
27
|
+
"Quality": "Qualità",
|
|
28
|
+
"Reading the video file failed": "Lettura del file video non riuscita",
|
|
29
|
+
"Replay": "Guarda di nuovo",
|
|
30
|
+
"Replay (k)": "Guarda di nuovo (k)",
|
|
31
|
+
"Settings": "Impostazioni",
|
|
32
|
+
"Skip Ending": "Salta sigla finale",
|
|
33
|
+
"Skip Opening": "Salta sigla",
|
|
34
|
+
"Subtitles": "Sottotitoli",
|
|
35
|
+
"Subtitles are in the picture": "I sottotitoli sono nell’immagine",
|
|
36
|
+
"The MediaSource closed before a SourceBuffer could be created": "La MediaSource si è chiusa prima che si potesse creare un SourceBuffer",
|
|
37
|
+
"The MediaSource never opened": "La MediaSource non si è mai aperta",
|
|
38
|
+
"The browser rejected a media segment": "Il browser ha rifiutato un segmento multimediale",
|
|
39
|
+
"The video codec in this file could not be identified": "Impossibile identificare il codec video di questo file",
|
|
40
|
+
"This browser cannot play the codecs in this file: {codecs}": "Questo browser non può riprodurre i codec di questo file: {codecs}",
|
|
41
|
+
"This file has no subtitles": "Questo file non ha sottotitoli",
|
|
42
|
+
"Track {number}": "Traccia {number}",
|
|
43
|
+
"Unavailable": "Non disponibile",
|
|
44
|
+
"Unmute (m)": "Attiva audio (m)",
|
|
45
|
+
"at {time}": "posizione {time}",
|
|
46
|
+
"recovered": "ripristinato",
|
|
47
|
+
"{rate}x": "{rate}x",
|
|
48
|
+
"{start} to {end}": "da {start} a {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": "SourceBuffer を作成する前に MediaSource が閉じました",
|
|
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": "PIP 모드 종료",
|
|
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": "이제 브라우저의 PIP 버튼을 클릭하세요",
|
|
17
|
+
"Pause": "일시정지",
|
|
18
|
+
"Pause (k)": "일시정지 (k)",
|
|
19
|
+
"Picture in picture": "PIP 모드",
|
|
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": "SourceBuffer를 만들기 전에 MediaSource가 닫혔습니다",
|
|
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
|
+
}
|