@banou/media-player 0.0.0

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.
@@ -0,0 +1,260 @@
1
+ type Language = {
2
+ tag: string;
3
+ name: string;
4
+ originalName: string;
5
+ locale: string;
6
+ };
7
+ export declare const languages: Language[];
8
+ export declare const languageToTag: (lang: string) => string | undefined;
9
+ export declare const tagToLanguage: (langTag: string) => string | undefined;
10
+ export declare enum LanguageTag {
11
+ /** isiZulu */
12
+ ZU = "zu",
13
+ /** Chinese */
14
+ ZH = "zh",
15
+ /** Yoruba */
16
+ YO = "yo",
17
+ /** isiXhosa */
18
+ XH = "xh",
19
+ /** Wolof */
20
+ WO = "wo",
21
+ /** Vietnamese */
22
+ VI = "vi",
23
+ /** Uzbek */
24
+ UZ = "uz",
25
+ /** Urdu */
26
+ UR = "ur",
27
+ /** Ukrainian */
28
+ UK = "uk",
29
+ /** Uyghur */
30
+ UG = "ug",
31
+ /** Tamazight */
32
+ TZM = "tzm",
33
+ /** Tatar */
34
+ TT = "tt",
35
+ /** Turkish */
36
+ TR = "tr",
37
+ /** Setswana */
38
+ TN = "tn",
39
+ /** Turkmen */
40
+ TK = "tk",
41
+ /** Thai */
42
+ TH = "th",
43
+ /** Tajik */
44
+ TG = "tg",
45
+ /** Telugu */
46
+ TE = "te",
47
+ /** Tamil */
48
+ TA = "ta",
49
+ /** Syriac */
50
+ SYR = "syr",
51
+ /** Kiswahili */
52
+ SW = "sw",
53
+ /** Swedish */
54
+ SV = "sv",
55
+ /** Serbian */
56
+ SR = "sr",
57
+ /** Albanian */
58
+ SQ = "sq",
59
+ /** Sami */
60
+ SMS = "sms",
61
+ /** Sami */
62
+ SMN = "smn",
63
+ /** Sami */
64
+ SMJ = "smj",
65
+ /** Sami */
66
+ SMA = "sma",
67
+ /** Slovenian */
68
+ SL = "sl",
69
+ /** Slovak */
70
+ SK = "sk",
71
+ /** Sinhala */
72
+ SI = "si",
73
+ /** Sami */
74
+ SE = "se",
75
+ /** Yakut */
76
+ SAH = "sah",
77
+ /** Sanskrit */
78
+ SA = "sa",
79
+ /** Kinyarwanda */
80
+ RW = "rw",
81
+ /** Russian */
82
+ RU = "ru",
83
+ /** Romanian */
84
+ RO = "ro",
85
+ /** Romansh */
86
+ RM = "rm",
87
+ /** Quechua */
88
+ QUZ = "quz",
89
+ /** K */
90
+ QUT = "qut",
91
+ /** Portuguese */
92
+ PT = "pt",
93
+ /** Pashto */
94
+ PS = "ps",
95
+ /** Dari */
96
+ PRS = "prs",
97
+ /** Polish */
98
+ PL = "pl",
99
+ /** Punjabi */
100
+ PA = "pa",
101
+ /** Oriya */
102
+ OR = "or",
103
+ /** Occitan */
104
+ OC = "oc",
105
+ /** Sesotho sa Leboa */
106
+ NSO = "nso",
107
+ /** Norwegian */
108
+ NO = "no",
109
+ /** Norwegian, Nynorsk */
110
+ NN = "nn",
111
+ /** Dutch */
112
+ NL = "nl",
113
+ /** Nepali */
114
+ NE = "ne",
115
+ /** Norwegian, Bokmål */
116
+ NB = "nb",
117
+ /** Maltese */
118
+ MT = "mt",
119
+ /** Malay */
120
+ MS = "ms",
121
+ /** Marathi */
122
+ MR = "mr",
123
+ /** Mohawk */
124
+ MOH = "moh",
125
+ /** Mongolian */
126
+ MN = "mn",
127
+ /** Malayalam */
128
+ ML = "ml",
129
+ /** Macedonian */
130
+ MK = "mk",
131
+ /** Maori */
132
+ MI = "mi",
133
+ /** Latvian */
134
+ LV = "lv",
135
+ /** Lithuanian */
136
+ LT = "lt",
137
+ /** Lao */
138
+ LO = "lo",
139
+ /** Luxembourgish */
140
+ LB = "lb",
141
+ /** Kyrgyz */
142
+ KY = "ky",
143
+ /** Konkani */
144
+ KOK = "kok",
145
+ /** Korean */
146
+ KO = "ko",
147
+ /** Kannada */
148
+ KN = "kn",
149
+ /** Khmer */
150
+ KM = "km",
151
+ /** Greenlandic */
152
+ KL = "kl",
153
+ /** Kazakh */
154
+ KK = "kk",
155
+ /** Georgian */
156
+ KA = "ka",
157
+ /** Japanese */
158
+ JA = "ja",
159
+ /** Inuktitut */
160
+ IU = "iu",
161
+ /** Italian */
162
+ IT = "it",
163
+ /** Icelandic */
164
+ IS = "is",
165
+ /** Yi */
166
+ II = "ii",
167
+ /** Igbo */
168
+ IG = "ig",
169
+ /** Indonesian */
170
+ ID = "id",
171
+ /** Armenian */
172
+ HY = "hy",
173
+ /** Hungarian */
174
+ HU = "hu",
175
+ /** Upper Sorbian */
176
+ HSB = "hsb",
177
+ /** Croatian */
178
+ HR = "hr",
179
+ /** Hindi */
180
+ HI = "hi",
181
+ /** Hebrew */
182
+ HE = "he",
183
+ /** Hausa */
184
+ HA = "ha",
185
+ /** Gujarati */
186
+ GU = "gu",
187
+ /** Alsatian */
188
+ GSW = "gsw",
189
+ /** Galician */
190
+ GL = "gl",
191
+ /** Scottish Gaelic */
192
+ GD = "gd",
193
+ /** Irish */
194
+ GA = "ga",
195
+ /** Frisian */
196
+ FY = "fy",
197
+ /** French */
198
+ FR = "fr",
199
+ /** Faroese */
200
+ FO = "fo",
201
+ /** Filipino */
202
+ FIL = "fil",
203
+ /** Finnish */
204
+ FI = "fi",
205
+ /** Persian */
206
+ FA = "fa",
207
+ /** Basque */
208
+ EU = "eu",
209
+ /** Estonian */
210
+ ET = "et",
211
+ /** Spanish */
212
+ ES = "es",
213
+ /** English */
214
+ EN = "en",
215
+ /** Greek */
216
+ EL = "el",
217
+ /** Divehi */
218
+ DV = "dv",
219
+ /** Lower Sorbian */
220
+ DSB = "dsb",
221
+ /** German */
222
+ DE = "de",
223
+ /** Danish */
224
+ DA = "da",
225
+ /** Welsh */
226
+ CY = "cy",
227
+ /** Czech */
228
+ CS = "cs",
229
+ /** Corsican */
230
+ CO = "co",
231
+ /** Catalan */
232
+ CA = "ca",
233
+ /** Bosnian */
234
+ BS = "bs",
235
+ /** Breton */
236
+ BR = "br",
237
+ /** Tibetan */
238
+ BO = "bo",
239
+ /** Bengali */
240
+ BN = "bn",
241
+ /** Bulgarian */
242
+ BG = "bg",
243
+ /** Belarusian */
244
+ BE = "be",
245
+ /** Bashkir */
246
+ BA = "ba",
247
+ /** Azeri */
248
+ AZ = "az",
249
+ /** Assamese */
250
+ AS = "as",
251
+ /** Mapudungun */
252
+ ARN = "arn",
253
+ /** Arabic */
254
+ AR = "ar",
255
+ /** Amharic */
256
+ AM = "am",
257
+ /** Afrikaans */
258
+ AF = "af"
259
+ }
260
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,61 @@
1
+ declare module "mp4box" {
2
+ interface MP4MediaTrack {
3
+ id: number;
4
+ created: Date;
5
+ modified: Date;
6
+ movie_duration: number;
7
+ layer: number;
8
+ alternate_group: number;
9
+ volume: number;
10
+ track_width: number;
11
+ track_height: number;
12
+ timescale: number;
13
+ duration: number;
14
+ bitrate: number;
15
+ codec: string;
16
+ language: string;
17
+ nb_samples: number;
18
+ }
19
+ interface MP4VideoData {
20
+ width: number;
21
+ height: number;
22
+ }
23
+ interface MP4VideoTrack extends MP4MediaTrack {
24
+ video: MP4VideoData;
25
+ }
26
+ interface MP4AudioData {
27
+ sample_rate: number;
28
+ channel_count: number;
29
+ sample_size: number;
30
+ }
31
+ interface MP4AudioTrack extends MP4MediaTrack {
32
+ audio: MP4AudioData;
33
+ }
34
+ type MP4Track = MP4VideoTrack | MP4AudioTrack;
35
+ interface MP4Info {
36
+ duration: number;
37
+ timescale: number;
38
+ fragment_duration: number;
39
+ isFragmented: boolean;
40
+ isProgressive: boolean;
41
+ hasIOD: boolean;
42
+ brands: string[];
43
+ created: Date;
44
+ modified: Date;
45
+ tracks: MP4Track[];
46
+ }
47
+ type MP4ArrayBuffer = ArrayBuffer & {
48
+ fileStart: number;
49
+ };
50
+ interface MP4File {
51
+ onMoovStart?: () => void;
52
+ onReady?: (info: MP4Info) => void;
53
+ onError?: (e: Error) => void;
54
+ appendBuffer(data: MP4ArrayBuffer): number;
55
+ start(): void;
56
+ stop(): void;
57
+ flush(): void;
58
+ }
59
+ function createFile(): MP4File;
60
+ }
61
+ export {};
@@ -0,0 +1,6 @@
1
+ declare const useNamespacedLocalStorage: <T extends {
2
+ [key: string]: string | number | boolean | object | any[] | null | undefined;
3
+ [key: number]: string | number | boolean | object | any[] | null | undefined;
4
+ [key: symbol]: string | number | boolean | object | any[] | null | undefined;
5
+ }>(namespace: string) => <T2 extends keyof T, T3 extends T[T2]>(key: T2, value: T[T2]) => readonly [T[T2], (newValue: T3 | ((oldValue: T3) => T3)) => void];
6
+ export default useNamespacedLocalStorage;
@@ -0,0 +1,10 @@
1
+ import type { MouseEventHandler, RefObject } from 'react';
2
+ declare const _default: ({ ref, defaultValue }: {
3
+ ref: RefObject<HTMLElement>;
4
+ defaultValue?: number | undefined;
5
+ }) => {
6
+ value: number | undefined;
7
+ scrubbing: boolean;
8
+ scrub: MouseEventHandler<HTMLDivElement>;
9
+ };
10
+ export default _default;
@@ -0,0 +1,13 @@
1
+ export type Chunk = {
2
+ offset: number;
3
+ buffer: Uint8Array;
4
+ pts: number;
5
+ duration: number;
6
+ pos: number;
7
+ buffered: boolean;
8
+ };
9
+ export declare const queuedDebounceWithLastCall: <T2 extends any[], T extends (...args: T2) => any>(time: number, func: T) => (...args: Parameters<T>) => Promise<any> | undefined;
10
+ export declare const bufferStream: ({ stream, size: SIZE }: {
11
+ stream: ReadableStream;
12
+ size: number;
13
+ }) => ReadableStream<Uint8Array>;
package/package.json ADDED
@@ -0,0 +1,49 @@
1
+ {
2
+ "name": "@banou/media-player",
3
+ "version": "0.0.0",
4
+ "description": "",
5
+ "type": "module",
6
+ "main": "build/index.js",
7
+ "files": [
8
+ "build",
9
+ "tsconfig.json",
10
+ "tsconfig.node.json",
11
+ "src"
12
+ ],
13
+ "scripts": {
14
+ "dev": "vite --port 4560",
15
+ "build": "vite build && npm run types",
16
+ "build-for-dev": "vite build && npm run copy-dependencies && npm run types",
17
+ "copy-dependencies": "npm run copy-libass && npm run copy-worker && npm run copy-worker-deps && npm run copy-worker-wasm",
18
+ "copy-worker": "shx cp node_modules/@banou26/libav-wasm/build/worker.js build/libav.js",
19
+ "copy-worker-deps": "copyfiles -u 4 node_modules/@banou26/libav-wasm/build/shared-memory-api_pb.*.js build",
20
+ "copy-worker-wasm": "shx cp node_modules/@banou26/libav-wasm/build/libav.wasm build/libav.wasm",
21
+ "copy-libass": "copyfiles -u 3 ./node_modules/jassub/dist/* build",
22
+ "types": "tsc"
23
+ },
24
+ "author": "Banou26",
25
+ "devDependencies": {
26
+ "@types/node": "^18.11.18",
27
+ "@types/react": "^18.0.27",
28
+ "@types/react-dom": "^18.0.10",
29
+ "@vitejs/plugin-react": "^3.0.1",
30
+ "concurrently": "^7.6.0",
31
+ "copyfiles": "^2.4.1",
32
+ "mime": "^3.0.0",
33
+ "react-dom": "^18.2.0",
34
+ "shx": "^0.3.4",
35
+ "typescript": "^4.9.4",
36
+ "vite": "^4.0.4"
37
+ },
38
+ "dependencies": {
39
+ "@emotion/react": "^11.10.5",
40
+ "jassub": "^1.7.1",
41
+ "libav-wasm": "^0.1.7",
42
+ "mp4box": "^0.5.2",
43
+ "osra": "^0.0.11",
44
+ "p-queue": "^7.3.4",
45
+ "react": "^18.2.0",
46
+ "react-feather": "^2.0.10",
47
+ "react-tooltip": "^4.2.21"
48
+ }
49
+ }