@banou/media-player 0.6.2 → 0.8.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.
- package/README.md +149 -3
- package/dist/engine/index.d.ts +10 -0
- package/dist/engine/index.js +2 -0
- package/dist/engine/picture-in-picture.d.ts +27 -0
- package/dist/engine/playback.d.ts +45 -0
- package/dist/engine/source-buffer.d.ts +12 -0
- package/dist/engine/subtitles.d.ts +36 -0
- package/dist/engine/thumbnails.d.ts +22 -0
- package/dist/engine-Dmc7JSd9.js +470 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +1610 -0
- package/dist/react/components/chrome.d.ts +12 -0
- package/dist/react/components/control-bar.d.ts +2 -0
- package/dist/react/components/overlay.d.ts +4 -0
- package/dist/react/components/playback-slider.d.ts +2 -0
- package/dist/react/components/progress-bar.d.ts +2 -0
- package/dist/react/components/settings.d.ts +2 -0
- package/dist/react/components/sound.d.ts +7 -0
- package/{build → dist/react}/components/tooltip-display.d.ts +8 -8
- package/dist/react/components/volume-slider.d.ts +6 -0
- package/dist/react/hooks/use-drag-value.d.ts +23 -0
- package/dist/react/hooks/use-picture-in-picture.d.ts +2 -0
- package/dist/react/hooks/use-playback.d.ts +8 -0
- package/dist/react/hooks/use-thumbnails.d.ts +12 -0
- package/dist/react/media.d.ts +98 -0
- package/dist/react/player.d.ts +26 -0
- package/dist/react/source-feature.d.ts +106 -0
- package/dist/react/video-player.d.ts +83 -0
- package/dist/utils/source.d.ts +30 -0
- package/dist/utils/track-label.d.ts +31 -0
- package/dist/utils/volume-utils.d.ts +6 -0
- package/package.json +58 -37
- package/src/lib/engine/index.ts +14 -0
- package/src/lib/engine/picture-in-picture.ts +250 -0
- package/src/lib/engine/playback.ts +352 -0
- package/src/lib/engine/source-buffer.ts +61 -0
- package/src/lib/engine/subtitles.ts +210 -0
- package/src/lib/engine/thumbnails.ts +137 -0
- package/src/lib/globals.d.ts +8 -0
- package/src/lib/index.tsx +51 -0
- package/src/lib/react/components/chrome.tsx +130 -0
- package/src/{components → lib/react/components}/control-bar.tsx +74 -96
- package/src/lib/react/components/overlay.tsx +125 -0
- package/src/{components → lib/react/components}/playback-slider.tsx +30 -52
- package/src/lib/react/components/progress-bar.tsx +341 -0
- package/src/lib/react/components/settings.tsx +384 -0
- package/src/lib/react/components/sound.tsx +133 -0
- package/src/{components → lib/react/components}/tooltip-display.tsx +15 -12
- package/src/{components → lib/react/components}/volume-slider.tsx +32 -46
- package/src/lib/react/hooks/use-drag-value.ts +73 -0
- package/src/lib/react/hooks/use-picture-in-picture.ts +36 -0
- package/src/lib/react/hooks/use-playback.ts +146 -0
- package/src/lib/react/hooks/use-thumbnails.ts +78 -0
- package/src/lib/react/media.ts +124 -0
- package/src/lib/react/player.ts +20 -0
- package/src/lib/react/source-feature.ts +108 -0
- package/src/lib/react/video-player.tsx +223 -0
- package/src/lib/utils/fonts.ts +160 -0
- package/src/lib/utils/source.ts +60 -0
- package/src/lib/utils/track-label.ts +51 -0
- package/src/lib/utils/volume-utils.ts +13 -0
- package/build/components/chrome.d.ts +0 -7
- package/build/components/control-bar.d.ts +0 -6
- package/build/components/overlay.d.ts +0 -4
- package/build/components/playback-slider.d.ts +0 -2
- package/build/components/progress-bar.d.ts +0 -1
- package/build/components/settings.d.ts +0 -2
- package/build/components/sound.d.ts +0 -4
- package/build/components/volume-slider.d.ts +0 -6
- package/build/index.d.ts +0 -26
- package/build/index.js +0 -3416
- package/build/main.d.ts +0 -1
- package/build/state-machines/data-source.d.ts +0 -27
- package/build/state-machines/index.d.ts +0 -34038
- package/build/state-machines/media-properties.d.ts +0 -45
- package/build/state-machines/media-source.d.ts +0 -34
- package/build/state-machines/media.d.ts +0 -8558
- package/build/state-machines/subtitles.d.ts +0 -56
- package/build/state-machines/thumbnails.d.ts +0 -24
- package/build/state-machines/utils.d.ts +0 -26
- package/build/utils/actor-utils.d.ts +0 -2
- package/build/utils/context.d.ts +0 -14
- package/build/utils/index.d.ts +0 -4
- package/build/utils/languages.d.ts +0 -260
- package/build/utils/mp4box.d.ts +0 -61
- package/build/utils/use-local-storage.d.ts +0 -3
- package/build/utils/use-scrub.d.ts +0 -11
- package/build/utils/volume-utils.d.ts +0 -17
- package/build/utils/window-height.d.ts +0 -2
- package/src/components/chrome.tsx +0 -95
- package/src/components/overlay.tsx +0 -91
- package/src/components/progress-bar.tsx +0 -251
- package/src/components/settings.tsx +0 -322
- package/src/components/sound.tsx +0 -101
- package/src/index.tsx +0 -195
- package/src/main.tsx +0 -169
- package/src/state-machines/data-source.ts +0 -84
- package/src/state-machines/index.ts +0 -5
- package/src/state-machines/media-properties.ts +0 -82
- package/src/state-machines/media-source.ts +0 -129
- package/src/state-machines/media.ts +0 -255
- package/src/state-machines/subtitles.ts +0 -285
- package/src/state-machines/thumbnails.ts +0 -123
- package/src/state-machines/utils.ts +0 -94
- package/src/utils/actor-utils.ts +0 -19
- package/src/utils/context.ts +0 -23
- package/src/utils/fonts.ts +0 -160
- package/src/utils/index.ts +0 -229
- package/src/utils/languages.ts +0 -262
- package/src/utils/mp4box.ts +0 -74
- package/src/utils/use-local-storage.ts +0 -30
- package/src/utils/use-scrub.ts +0 -40
- package/src/utils/volume-utils.ts +0 -39
- package/src/utils/window-height.ts +0 -19
- package/src/vite-env.d.ts +0 -1
- package/tsconfig.json +0 -28
- package/tsconfig.node.json +0 -9
- /package/{build → dist}/utils/colors.d.ts +0 -0
- /package/{build → dist}/utils/fonts.d.ts +0 -0
- /package/{build → dist}/utils/time.d.ts +0 -0
- /package/src/{assets → lib/assets}/picture-in-picture.svg +0 -0
- /package/src/{utils → lib/utils}/colors.ts +0 -0
- /package/src/{utils → lib/utils}/time.ts +0 -0
package/src/utils/languages.ts
DELETED
|
@@ -1,262 +0,0 @@
|
|
|
1
|
-
type Language = {
|
|
2
|
-
tag: string
|
|
3
|
-
name: string
|
|
4
|
-
originalName: string
|
|
5
|
-
locale: string
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export const languages: Language[] = JSON.parse(`[{"tag":"zu","name":"isiZulu","originalName":"isiZulu","locale":"zu-ZA"},{"tag":"zh","name":"Chinese","originalName":"中文","locale":"zh-CHS"},{"tag":"yo","name":"Yoruba","originalName":"Yoruba","locale":"yo-NG"},{"tag":"xh","name":"isiXhosa","originalName":"isiXhosa","locale":"xh-ZA"},{"tag":"wo","name":"Wolof","originalName":"Wolof","locale":"wo-SN"},{"tag":"vi","name":"Vietnamese","originalName":"Tiếng Việt","locale":"vi"},{"tag":"uz","name":"Uzbek","originalName":"U'zbek","locale":"uz"},{"tag":"ur","name":"Urdu","originalName":"اُردو","locale":"ur"},{"tag":"uk","name":"Ukrainian","originalName":"україньска","locale":"uk"},{"tag":"ug","name":"Uyghur","originalName":"ئۇيغۇرچە","locale":"ug-CN"},{"tag":"tzm","name":"Tamazight","originalName":"Tamazight","locale":"tzm-Latn-DZ"},{"tag":"tt","name":"Tatar","originalName":"Татар","locale":"tt"},{"tag":"tr","name":"Turkish","originalName":"Türkçe","locale":"tr"},{"tag":"tn","name":"Setswana","originalName":"Setswana","locale":"tn-ZA"},{"tag":"tk","name":"Turkmen","originalName":"türkmençe","locale":"tk-TM"},{"tag":"th","name":"Thai","originalName":"ไทย","locale":"th"},{"tag":"tg","name":"Tajik","originalName":"Тоҷикӣ","locale":"tg-Cyrl-TJ"},{"tag":"te","name":"Telugu","originalName":"తెలుగు","locale":"te"},{"tag":"ta","name":"Tamil","originalName":"தமிழ்","locale":"ta"},{"tag":"syr","name":"Syriac","originalName":"ܣܘܪܝܝܐ","locale":"syr"},{"tag":"sw","name":"Kiswahili","originalName":"Kiswahili","locale":"sw"},{"tag":"sv","name":"Swedish","originalName":"svenska","locale":"sv"},{"tag":"sr","name":"Serbian","originalName":"srpski","locale":"sr"},{"tag":"sq","name":"Albanian","originalName":"shqipe","locale":"sq"},{"tag":"sms","name":"Sami","originalName":"sääm´ǩiõll","locale":"sms-FI"},{"tag":"smn","name":"Sami","originalName":"sämikielâ","locale":"smn-FI"},{"tag":"smj","name":"Sami","originalName":"julevusámegiella","locale":"smj-NO"},{"tag":"sma","name":"Sami","originalName":"åarjelsaemiengiele","locale":"sma-NO"},{"tag":"sl","name":"Slovenian","originalName":"slovenski","locale":"sl"},{"tag":"sk","name":"Slovak","originalName":"slovenčina","locale":"sk"},{"tag":"si","name":"Sinhala","originalName":"සිංහ","locale":"si-LK"},{"tag":"se","name":"Sami","originalName":"davvisámegiella","locale":"se-FI"},{"tag":"sah","name":"Yakut","originalName":"саха","locale":"sah-RU"},{"tag":"sa","name":"Sanskrit","originalName":"संस्कृत","locale":"sa"},{"tag":"rw","name":"Kinyarwanda","originalName":"Kinyarwanda","locale":"rw-RW"},{"tag":"ru","name":"Russian","originalName":"русский","locale":"ru"},{"tag":"ro","name":"Romanian","originalName":"română","locale":"ro"},{"tag":"rm","name":"Romansh","originalName":"Rumantsch","locale":"rm-CH"},{"tag":"quz","name":"Quechua","originalName":"runasimi","locale":"quz-BO"},{"tag":"qut","name":"K'iche","originalName":"K'iche","locale":"qut-GT"},{"tag":"pt","name":"Portuguese","originalName":"Português","locale":"pt"},{"tag":"ps","name":"Pashto","originalName":"پښتو","locale":"ps-AF"},{"tag":"prs","name":"Dari","originalName":"درى","locale":"prs-AF"},{"tag":"pl","name":"Polish","originalName":"polski","locale":"pl"},{"tag":"pa","name":"Punjabi","originalName":"ਪੰਜਾਬੀ","locale":"pa"},{"tag":"or","name":"Oriya","originalName":"ଓଡ଼ିଆ","locale":"or-IN"},{"tag":"oc","name":"Occitan","originalName":"Occitan","locale":"oc-FR"},{"tag":"nso","name":"Sesotho sa Leboa","originalName":"Sesotho sa Leboa","locale":"nso-ZA"},{"tag":"no","name":"Norwegian","originalName":"norsk","locale":"no"},{"tag":"nn","name":"Norwegian, Nynorsk","originalName":"norsk, nynorsk","locale":"nn-NO"},{"tag":"nl","name":"Dutch","originalName":"Nederlands","locale":"nl"},{"tag":"ne","name":"Nepali","originalName":"नेपाली","locale":"ne-NP"},{"tag":"nb","name":"Norwegian, Bokmål","originalName":"norsk, bokmål","locale":"nb-NO"},{"tag":"mt","name":"Maltese","originalName":"Malti","locale":"mt-MT"},{"tag":"ms","name":"Malay","originalName":"Bahasa Malaysia","locale":"ms"},{"tag":"mr","name":"Marathi","originalName":"मराठी","locale":"mr"},{"tag":"moh","name":"Mohawk","originalName":"Kanien'kéha","locale":"moh-CA"},{"tag":"mn","name":"Mongolian","originalName":"Монгол хэл","locale":"mn"},{"tag":"ml","name":"Malayalam","originalName":"മലയാളം","locale":"ml-IN"},{"tag":"mk","name":"Macedonian","originalName":"македонски јазик","locale":"mk"},{"tag":"mi","name":"Maori","originalName":"Reo Māori","locale":"mi-NZ"},{"tag":"lv","name":"Latvian","originalName":"latviešu","locale":"lv"},{"tag":"lt","name":"Lithuanian","originalName":"lietuvių","locale":"lt"},{"tag":"lo","name":"Lao","originalName":"ລາວ","locale":"lo-LA"},{"tag":"lb","name":"Luxembourgish","originalName":"Lëtzebuergesch","locale":"lb-LU"},{"tag":"ky","name":"Kyrgyz","originalName":"Кыргыз","locale":"ky"},{"tag":"kok","name":"Konkani","originalName":"कोंकणी","locale":"kok"},{"tag":"ko","name":"Korean","originalName":"한국어","locale":"ko"},{"tag":"kn","name":"Kannada","originalName":"ಕನ್ನಡ","locale":"kn"},{"tag":"km","name":"Khmer","originalName":"ខ្មែរ","locale":"km-KH"},{"tag":"kl","name":"Greenlandic","originalName":"kalaallisut","locale":"kl-GL"},{"tag":"kk","name":"Kazakh","originalName":"Қазащb","locale":"kk"},{"tag":"ka","name":"Georgian","originalName":"ქართული","locale":"ka"},{"tag":"ja","name":"Japanese","originalName":"日本語","locale":"ja"},{"tag":"iu","name":"Inuktitut","originalName":"ᐃᓄᒃᑎᑐᑦ","locale":"iu-Cans-CA"},{"tag":"it","name":"Italian","originalName":"italiano","locale":"it"},{"tag":"is","name":"Icelandic","originalName":"íslenska","locale":"is"},{"tag":"ii","name":"Yi","originalName":"ꆈꌠꁱꂷ","locale":"ii-CN"},{"tag":"ig","name":"Igbo","originalName":"Igbo","locale":"ig-NG"},{"tag":"id","name":"Indonesian","originalName":"Bahasa Indonesia","locale":"id"},{"tag":"hy","name":"Armenian","originalName":"Հայերեն","locale":"hy"},{"tag":"hu","name":"Hungarian","originalName":"magyar","locale":"hu"},{"tag":"hsb","name":"Upper Sorbian","originalName":"hornjoserbšćina","locale":"hsb-DE"},{"tag":"hr","name":"Croatian","originalName":"hrvatski","locale":"hr"},{"tag":"hi","name":"Hindi","originalName":"हिंदी","locale":"hi"},{"tag":"he","name":"Hebrew","originalName":"עברית","locale":"he"},{"tag":"ha","name":"Hausa","originalName":"Hausa","locale":"ha-Latn-NG"},{"tag":"gu","name":"Gujarati","originalName":"ગુજરાતી","locale":"gu"},{"tag":"gsw","name":"Alsatian","originalName":"Elsässisch","locale":"gsw-FR"},{"tag":"gl","name":"Galician","originalName":"galego","locale":"gl"},{"tag":"gd","name":"Scottish Gaelic","originalName":"Gàidhlig","locale":"gd-GB"},{"tag":"ga","name":"Irish","originalName":"Gaeilge","locale":"ga-IE"},{"tag":"fy","name":"Frisian","originalName":"Frysk","locale":"fy-NL"},{"tag":"fr","name":"French","originalName":"français","locale":"fr"},{"tag":"fo","name":"Faroese","originalName":"føroyskt","locale":"fo"},{"tag":"fil","name":"Filipino","originalName":"Filipino","locale":"fil-PH"},{"tag":"fi","name":"Finnish","originalName":"suomi","locale":"fi"},{"tag":"fa","name":"Persian","originalName":"فارسى","locale":"fa"},{"tag":"eu","name":"Basque","originalName":"euskara","locale":"eu"},{"tag":"et","name":"Estonian","originalName":"eesti","locale":"et"},{"tag":"es","name":"Spanish","originalName":"español","locale":"es"},{"tag":"en","name":"English","originalName":"English","locale":"en"},{"tag":"el","name":"Greek","originalName":"ελληνικά","locale":"el"},{"tag":"dv","name":"Divehi","originalName":"ދިވެހިބަސް","locale":"dv"},{"tag":"dsb","name":"Lower Sorbian","originalName":"dolnoserbšćina","locale":"dsb-DE"},{"tag":"de","name":"German","originalName":"Deutsch","locale":"de"},{"tag":"da","name":"Danish","originalName":"dansk","locale":"da"},{"tag":"cy","name":"Welsh","originalName":"Cymraeg","locale":"cy-GB"},{"tag":"cs","name":"Czech","originalName":"čeština","locale":"cs"},{"tag":"co","name":"Corsican","originalName":"Corsu","locale":"co-FR"},{"tag":"ca","name":"Catalan","originalName":"català","locale":"ca"},{"tag":"bs","name":"Bosnian","originalName":"босански","locale":"bs-Cyrl-BA"},{"tag":"br","name":"Breton","originalName":"brezhoneg","locale":"br-FR"},{"tag":"bo","name":"Tibetan","originalName":"བོད་ཡིག","locale":"bo-CN"},{"tag":"bn","name":"Bengali","originalName":"বাংলা","locale":"bn-BD"},{"tag":"bg","name":"Bulgarian","originalName":"български","locale":"bg"},{"tag":"be","name":"Belarusian","originalName":"Беларускі","locale":"be"},{"tag":"ba","name":"Bashkir","originalName":"Башҡорт","locale":"ba-RU"},{"tag":"az","name":"Azeri","originalName":"Azərbaycanılı","locale":"az"},{"tag":"as","name":"Assamese","originalName":"অসমীয়া","locale":"as-IN"},{"tag":"arn","name":"Mapudungun","originalName":"Mapudungun","locale":"arn-CL"},{"tag":"ar","name":"Arabic","originalName":"العربية","locale":"ar"},{"tag":"am","name":"Amharic","originalName":"አማርኛ","locale":"am-ET"},{"tag":"af","name":"Afrikaans","originalName":"Afrikaans","locale":"af"},{"tag":"iv","name":"Invariant Language","originalName":"Invariant Language","locale":""},{"tag":"Two letter","name":"English","originalName":"Native","locale":"Culture .NET"}]`)
|
|
9
|
-
|
|
10
|
-
export const languageToTag = (lang: string) => languages.find(language => language.name === lang)?.tag
|
|
11
|
-
export const tagToLanguage = (langTag: string) => languages.find(language => language.tag === langTag)?.name
|
|
12
|
-
|
|
13
|
-
export enum LanguageTag {
|
|
14
|
-
/** isiZulu */
|
|
15
|
-
ZU = 'zu',// "isiZulu",
|
|
16
|
-
/** Chinese */
|
|
17
|
-
ZH = 'zh',// "Chinese",
|
|
18
|
-
/** Yoruba */
|
|
19
|
-
YO = 'yo',// "Yoruba",
|
|
20
|
-
/** isiXhosa */
|
|
21
|
-
XH = 'xh',// "isiXhosa",
|
|
22
|
-
/** Wolof */
|
|
23
|
-
WO = 'wo',// "Wolof",
|
|
24
|
-
/** Vietnamese */
|
|
25
|
-
VI = 'vi',// "Vietnamese",
|
|
26
|
-
/** Uzbek */
|
|
27
|
-
UZ = 'uz',// "Uzbek",
|
|
28
|
-
/** Urdu */
|
|
29
|
-
UR = 'ur',// "Urdu",
|
|
30
|
-
/** Ukrainian */
|
|
31
|
-
UK = 'uk',// "Ukrainian",
|
|
32
|
-
/** Uyghur */
|
|
33
|
-
UG = 'ug',// "Uyghur",
|
|
34
|
-
/** Tamazight */
|
|
35
|
-
TZM = 'tzm',// "Tamazight",
|
|
36
|
-
/** Tatar */
|
|
37
|
-
TT = 'tt',// "Tatar",
|
|
38
|
-
/** Turkish */
|
|
39
|
-
TR = 'tr',// "Turkish",
|
|
40
|
-
/** Setswana */
|
|
41
|
-
TN = 'tn',// "Setswana",
|
|
42
|
-
/** Turkmen */
|
|
43
|
-
TK = 'tk',// "Turkmen",
|
|
44
|
-
/** Thai */
|
|
45
|
-
TH = 'th',// "Thai",
|
|
46
|
-
/** Tajik */
|
|
47
|
-
TG = 'tg',// "Tajik",
|
|
48
|
-
/** Telugu */
|
|
49
|
-
TE = 'te',// "Telugu",
|
|
50
|
-
/** Tamil */
|
|
51
|
-
TA = 'ta',// "Tamil",
|
|
52
|
-
/** Syriac */
|
|
53
|
-
SYR = 'syr',// "Syriac",
|
|
54
|
-
/** Kiswahili */
|
|
55
|
-
SW = 'sw',// "Kiswahili",
|
|
56
|
-
/** Swedish */
|
|
57
|
-
SV = 'sv',// "Swedish",
|
|
58
|
-
/** Serbian */
|
|
59
|
-
SR = 'sr',// "Serbian",
|
|
60
|
-
/** Albanian */
|
|
61
|
-
SQ = 'sq',// "Albanian",
|
|
62
|
-
/** Sami */
|
|
63
|
-
SMS = 'sms',// "Sami",
|
|
64
|
-
/** Sami */
|
|
65
|
-
SMN = 'smn',// "Sami",
|
|
66
|
-
/** Sami */
|
|
67
|
-
SMJ = 'smj',// "Sami",
|
|
68
|
-
/** Sami */
|
|
69
|
-
SMA = 'sma',// "Sami",
|
|
70
|
-
/** Slovenian */
|
|
71
|
-
SL = 'sl',// "Slovenian",
|
|
72
|
-
/** Slovak */
|
|
73
|
-
SK = 'sk',// "Slovak",
|
|
74
|
-
/** Sinhala */
|
|
75
|
-
SI = 'si',// "Sinhala",
|
|
76
|
-
/** Sami */
|
|
77
|
-
SE = 'se',// "Sami",
|
|
78
|
-
/** Yakut */
|
|
79
|
-
SAH = 'sah',// "Yakut",
|
|
80
|
-
/** Sanskrit */
|
|
81
|
-
SA = 'sa',// "Sanskrit",
|
|
82
|
-
/** Kinyarwanda */
|
|
83
|
-
RW = 'rw',// "Kinyarwanda",
|
|
84
|
-
/** Russian */
|
|
85
|
-
RU = 'ru',// "Russian",
|
|
86
|
-
/** Romanian */
|
|
87
|
-
RO = 'ro',// "Romanian",
|
|
88
|
-
/** Romansh */
|
|
89
|
-
RM = 'rm',// "Romansh",
|
|
90
|
-
/** Quechua */
|
|
91
|
-
QUZ = 'quz',// "Quechua",
|
|
92
|
-
/** K */
|
|
93
|
-
QUT = 'qut',// "K'iche",
|
|
94
|
-
/** Portuguese */
|
|
95
|
-
PT = 'pt',// "Portuguese",
|
|
96
|
-
/** Pashto */
|
|
97
|
-
PS = 'ps',// "Pashto",
|
|
98
|
-
/** Dari */
|
|
99
|
-
PRS = 'prs',// "Dari",
|
|
100
|
-
/** Polish */
|
|
101
|
-
PL = 'pl',// "Polish",
|
|
102
|
-
/** Punjabi */
|
|
103
|
-
PA = 'pa',// "Punjabi",
|
|
104
|
-
/** Oriya */
|
|
105
|
-
OR = 'or',// "Oriya",
|
|
106
|
-
/** Occitan */
|
|
107
|
-
OC = 'oc',// "Occitan",
|
|
108
|
-
/** Sesotho sa Leboa */
|
|
109
|
-
NSO = 'nso',// "Sesotho sa Leboa",
|
|
110
|
-
/** Norwegian */
|
|
111
|
-
NO = 'no',// "Norwegian",
|
|
112
|
-
/** Norwegian, Nynorsk */
|
|
113
|
-
NN = 'nn',// "Norwegian, Nynorsk",
|
|
114
|
-
/** Dutch */
|
|
115
|
-
NL = 'nl',// "Dutch",
|
|
116
|
-
/** Nepali */
|
|
117
|
-
NE = 'ne',// "Nepali",
|
|
118
|
-
/** Norwegian, Bokmål */
|
|
119
|
-
NB = 'nb',// "Norwegian, Bokmål",
|
|
120
|
-
/** Maltese */
|
|
121
|
-
MT = 'mt',// "Maltese",
|
|
122
|
-
/** Malay */
|
|
123
|
-
MS = 'ms',// "Malay",
|
|
124
|
-
/** Marathi */
|
|
125
|
-
MR = 'mr',// "Marathi",
|
|
126
|
-
/** Mohawk */
|
|
127
|
-
MOH = 'moh',// "Mohawk",
|
|
128
|
-
/** Mongolian */
|
|
129
|
-
MN = 'mn',// "Mongolian",
|
|
130
|
-
/** Malayalam */
|
|
131
|
-
ML = 'ml',// "Malayalam",
|
|
132
|
-
/** Macedonian */
|
|
133
|
-
MK = 'mk',// "Macedonian",
|
|
134
|
-
/** Maori */
|
|
135
|
-
MI = 'mi',// "Maori",
|
|
136
|
-
/** Latvian */
|
|
137
|
-
LV = 'lv',// "Latvian",
|
|
138
|
-
/** Lithuanian */
|
|
139
|
-
LT = 'lt',// "Lithuanian",
|
|
140
|
-
/** Lao */
|
|
141
|
-
LO = 'lo',// "Lao",
|
|
142
|
-
/** Luxembourgish */
|
|
143
|
-
LB = 'lb',// "Luxembourgish",
|
|
144
|
-
/** Kyrgyz */
|
|
145
|
-
KY = 'ky',// "Kyrgyz",
|
|
146
|
-
/** Konkani */
|
|
147
|
-
KOK = 'kok',// "Konkani",
|
|
148
|
-
/** Korean */
|
|
149
|
-
KO = 'ko',// "Korean",
|
|
150
|
-
/** Kannada */
|
|
151
|
-
KN = 'kn',// "Kannada",
|
|
152
|
-
/** Khmer */
|
|
153
|
-
KM = 'km',// "Khmer",
|
|
154
|
-
/** Greenlandic */
|
|
155
|
-
KL = 'kl',// "Greenlandic",
|
|
156
|
-
/** Kazakh */
|
|
157
|
-
KK = 'kk',// "Kazakh",
|
|
158
|
-
/** Georgian */
|
|
159
|
-
KA = 'ka',// "Georgian",
|
|
160
|
-
/** Japanese */
|
|
161
|
-
JA = 'ja',// "Japanese",
|
|
162
|
-
/** Inuktitut */
|
|
163
|
-
IU = 'iu',// "Inuktitut",
|
|
164
|
-
/** Italian */
|
|
165
|
-
IT = 'it',// "Italian",
|
|
166
|
-
/** Icelandic */
|
|
167
|
-
IS = 'is',// "Icelandic",
|
|
168
|
-
/** Yi */
|
|
169
|
-
II = 'ii',// "Yi",
|
|
170
|
-
/** Igbo */
|
|
171
|
-
IG = 'ig',// "Igbo",
|
|
172
|
-
/** Indonesian */
|
|
173
|
-
ID = 'id',// "Indonesian",
|
|
174
|
-
/** Armenian */
|
|
175
|
-
HY = 'hy',// "Armenian",
|
|
176
|
-
/** Hungarian */
|
|
177
|
-
HU = 'hu',// "Hungarian",
|
|
178
|
-
/** Upper Sorbian */
|
|
179
|
-
HSB = 'hsb',// "Upper Sorbian",
|
|
180
|
-
/** Croatian */
|
|
181
|
-
HR = 'hr',// "Croatian",
|
|
182
|
-
/** Hindi */
|
|
183
|
-
HI = 'hi',// "Hindi",
|
|
184
|
-
/** Hebrew */
|
|
185
|
-
HE = 'he',// "Hebrew",
|
|
186
|
-
/** Hausa */
|
|
187
|
-
HA = 'ha',// "Hausa",
|
|
188
|
-
/** Gujarati */
|
|
189
|
-
GU = 'gu',// "Gujarati",
|
|
190
|
-
/** Alsatian */
|
|
191
|
-
GSW = 'gsw',// "Alsatian",
|
|
192
|
-
/** Galician */
|
|
193
|
-
GL = 'gl',// "Galician",
|
|
194
|
-
/** Scottish Gaelic */
|
|
195
|
-
GD = 'gd',// "Scottish Gaelic",
|
|
196
|
-
/** Irish */
|
|
197
|
-
GA = 'ga',// "Irish",
|
|
198
|
-
/** Frisian */
|
|
199
|
-
FY = 'fy',// "Frisian",
|
|
200
|
-
/** French */
|
|
201
|
-
FR = 'fr',// "French",
|
|
202
|
-
/** Faroese */
|
|
203
|
-
FO = 'fo',// "Faroese",
|
|
204
|
-
/** Filipino */
|
|
205
|
-
FIL = 'fil',// "Filipino",
|
|
206
|
-
/** Finnish */
|
|
207
|
-
FI = 'fi',// "Finnish",
|
|
208
|
-
/** Persian */
|
|
209
|
-
FA = 'fa',// "Persian",
|
|
210
|
-
/** Basque */
|
|
211
|
-
EU = 'eu',// "Basque",
|
|
212
|
-
/** Estonian */
|
|
213
|
-
ET = 'et',// "Estonian",
|
|
214
|
-
/** Spanish */
|
|
215
|
-
ES = 'es',// "Spanish",
|
|
216
|
-
/** English */
|
|
217
|
-
EN = 'en',// "English",
|
|
218
|
-
/** Greek */
|
|
219
|
-
EL = 'el',// "Greek",
|
|
220
|
-
/** Divehi */
|
|
221
|
-
DV = 'dv',// "Divehi",
|
|
222
|
-
/** Lower Sorbian */
|
|
223
|
-
DSB = 'dsb',// "Lower Sorbian",
|
|
224
|
-
/** German */
|
|
225
|
-
DE = 'de',// "German",
|
|
226
|
-
/** Danish */
|
|
227
|
-
DA = 'da',// "Danish",
|
|
228
|
-
/** Welsh */
|
|
229
|
-
CY = 'cy',// "Welsh",
|
|
230
|
-
/** Czech */
|
|
231
|
-
CS = 'cs',// "Czech",
|
|
232
|
-
/** Corsican */
|
|
233
|
-
CO = 'co',// "Corsican",
|
|
234
|
-
/** Catalan */
|
|
235
|
-
CA = 'ca',// "Catalan",
|
|
236
|
-
/** Bosnian */
|
|
237
|
-
BS = 'bs',// "Bosnian",
|
|
238
|
-
/** Breton */
|
|
239
|
-
BR = 'br',// "Breton",
|
|
240
|
-
/** Tibetan */
|
|
241
|
-
BO = 'bo',// "Tibetan",
|
|
242
|
-
/** Bengali */
|
|
243
|
-
BN = 'bn',// "Bengali",
|
|
244
|
-
/** Bulgarian */
|
|
245
|
-
BG = 'bg',// "Bulgarian",
|
|
246
|
-
/** Belarusian */
|
|
247
|
-
BE = 'be',// "Belarusian",
|
|
248
|
-
/** Bashkir */
|
|
249
|
-
BA = 'ba',// "Bashkir",
|
|
250
|
-
/** Azeri */
|
|
251
|
-
AZ = 'az',// "Azeri",
|
|
252
|
-
/** Assamese */
|
|
253
|
-
AS = 'as',// "Assamese",
|
|
254
|
-
/** Mapudungun */
|
|
255
|
-
ARN = 'arn',// "Mapudungun",
|
|
256
|
-
/** Arabic */
|
|
257
|
-
AR = 'ar',// "Arabic",
|
|
258
|
-
/** Amharic */
|
|
259
|
-
AM = 'am',// "Amharic",
|
|
260
|
-
/** Afrikaans */
|
|
261
|
-
AF = 'af'// "Afrikaans"
|
|
262
|
-
}
|
package/src/utils/mp4box.ts
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
declare module "mp4box" {
|
|
2
|
-
|
|
3
|
-
export interface MP4MediaTrack {
|
|
4
|
-
id: number
|
|
5
|
-
created: Date
|
|
6
|
-
modified: Date
|
|
7
|
-
movie_duration: number
|
|
8
|
-
layer: number
|
|
9
|
-
alternate_group: number
|
|
10
|
-
volume: number
|
|
11
|
-
track_width: number
|
|
12
|
-
track_height: number
|
|
13
|
-
timescale: number
|
|
14
|
-
duration: number
|
|
15
|
-
bitrate: number
|
|
16
|
-
codec: string
|
|
17
|
-
language: string
|
|
18
|
-
nb_samples: number
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export interface MP4VideoData {
|
|
22
|
-
width: number
|
|
23
|
-
height: number
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export interface MP4VideoTrack extends MP4MediaTrack {
|
|
27
|
-
video: MP4VideoData
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export interface MP4AudioData {
|
|
31
|
-
sample_rate: number
|
|
32
|
-
channel_count: number
|
|
33
|
-
sample_size: number
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export interface MP4AudioTrack extends MP4MediaTrack {
|
|
37
|
-
audio: MP4AudioData
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export type MP4Track = MP4VideoTrack | MP4AudioTrack
|
|
41
|
-
|
|
42
|
-
export interface MP4Info {
|
|
43
|
-
duration: number
|
|
44
|
-
timescale: number
|
|
45
|
-
fragment_duration: number
|
|
46
|
-
isFragmented: boolean
|
|
47
|
-
isProgressive: boolean
|
|
48
|
-
hasIOD: boolean
|
|
49
|
-
brands: string[]
|
|
50
|
-
created: Date
|
|
51
|
-
modified: Date
|
|
52
|
-
tracks: MP4Track[]
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export type MP4ArrayBuffer = ArrayBuffer & { fileStart: number }
|
|
56
|
-
|
|
57
|
-
export interface MP4File {
|
|
58
|
-
|
|
59
|
-
onMoovStart?: () => void
|
|
60
|
-
onReady?: (info: MP4Info) => void
|
|
61
|
-
onError?: (e: Error) => void
|
|
62
|
-
|
|
63
|
-
appendBuffer(data: MP4ArrayBuffer): number
|
|
64
|
-
start(): void
|
|
65
|
-
stop(): void
|
|
66
|
-
flush(): void
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export function createFile(): MP4File
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export { }
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState } from 'react'
|
|
2
|
-
|
|
3
|
-
export const useLocalStorage = <T,>(name: string, defaultValue?: T) => {
|
|
4
|
-
const [storageValue, setStorageValue] = useState(() => localStorage.getItem(name) ?? defaultValue)
|
|
5
|
-
|
|
6
|
-
const updateStorage = (newValue: string) => {
|
|
7
|
-
localStorage.setItem(name, newValue)
|
|
8
|
-
setStorageValue(newValue)
|
|
9
|
-
window.dispatchEvent(new Event('storage'))
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
useEffect(() => {
|
|
13
|
-
const syncLocalStorage = () => {
|
|
14
|
-
const item = localStorage.getItem(name)
|
|
15
|
-
setStorageValue(item ?? defaultValue)
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
window.addEventListener('storage', syncLocalStorage)
|
|
19
|
-
return () => {
|
|
20
|
-
window.removeEventListener('storage', syncLocalStorage)
|
|
21
|
-
}
|
|
22
|
-
}, [name])
|
|
23
|
-
|
|
24
|
-
return [storageValue, updateStorage] as const
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export default useLocalStorage
|
|
28
|
-
|
|
29
|
-
export type booleanType = 'true' | 'false' | undefined
|
|
30
|
-
|
package/src/utils/use-scrub.ts
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import type { MouseEventHandler, RefObject } from 'react'
|
|
2
|
-
|
|
3
|
-
import { useState, useEffect } from 'react'
|
|
4
|
-
|
|
5
|
-
export default ({ ref, defaultValue }: { ref: RefObject<HTMLElement>, defaultValue?: number }) => {
|
|
6
|
-
const [value, setValue] = useState(defaultValue)
|
|
7
|
-
const [scrubbing, setScrubbing] = useState(false)
|
|
8
|
-
|
|
9
|
-
const scrub: MouseEventHandler<HTMLDivElement> = (ev) => {
|
|
10
|
-
setScrubbing(true)
|
|
11
|
-
if (!ref.current) return
|
|
12
|
-
const { clientX: x } = ev
|
|
13
|
-
const { left, right } = ref.current.getBoundingClientRect()
|
|
14
|
-
setValue(Math.min(Math.max(((x - left) / (right - left)), 0), 1))
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
useEffect(() => {
|
|
18
|
-
if (!scrubbing) return
|
|
19
|
-
const mouseUp = () => setScrubbing(false)
|
|
20
|
-
const mouseMove = (ev: globalThis.MouseEvent) => {
|
|
21
|
-
if (!ref.current) return
|
|
22
|
-
const { clientX: x } = ev
|
|
23
|
-
const { left, right } = ref.current.getBoundingClientRect()
|
|
24
|
-
setValue(Math.min(Math.max(((x - left) / (right - left)), 0), 1))
|
|
25
|
-
}
|
|
26
|
-
document.addEventListener('mousemove', mouseMove)
|
|
27
|
-
document.addEventListener('mouseup', mouseUp)
|
|
28
|
-
return () => {
|
|
29
|
-
document.removeEventListener('mousemove', mouseMove)
|
|
30
|
-
document.removeEventListener('mouseup', mouseUp)
|
|
31
|
-
}
|
|
32
|
-
}, [scrubbing])
|
|
33
|
-
|
|
34
|
-
return {
|
|
35
|
-
value,
|
|
36
|
-
scrubbing,
|
|
37
|
-
scrub,
|
|
38
|
-
setValue
|
|
39
|
-
}
|
|
40
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
// Constants for logarithmic scaling
|
|
2
|
-
const MIN_VOLUME = 0.0001 // Avoid zero which would give -Infinity when taking log
|
|
3
|
-
const MAX_VOLUME = 1.0
|
|
4
|
-
|
|
5
|
-
// Defines how "curved" the logarithmic response is
|
|
6
|
-
// Higher values = more dramatic volume change at the low end
|
|
7
|
-
export const VOLUME_EXPONENT = 2.0
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Converts a linear slider value (0-1) to logarithmic volume scale
|
|
11
|
-
* Uses formula: volume = minVolume * (maxVolume/minVolume)^position
|
|
12
|
-
*
|
|
13
|
-
* @param linearValue Linear slider position (0-1)
|
|
14
|
-
* @returns Logarithmic volume value (0-1)
|
|
15
|
-
*/
|
|
16
|
-
export const linearToLogVolume = (linearValue: number): number => {
|
|
17
|
-
// Ensure value is within range
|
|
18
|
-
const normalizedLinear = Math.max(MIN_VOLUME, Math.min(MAX_VOLUME, linearValue))
|
|
19
|
-
|
|
20
|
-
// Calculate using the formula: volume = minVolume * (maxVolume/minVolume)^position
|
|
21
|
-
// We can also use a simpler formula: Math.pow(normalizedLinear, VOLUME_EXPONENT)
|
|
22
|
-
// Which gives a good perceptual curve with proper scaling
|
|
23
|
-
return Math.pow(normalizedLinear, VOLUME_EXPONENT)
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Converts a logarithmic volume (0-1) back to linear slider position (0-1)
|
|
28
|
-
* Inverse of the logarithmic formula
|
|
29
|
-
*
|
|
30
|
-
* @param logVolume Logarithmic volume (0-1)
|
|
31
|
-
* @returns Linear slider position (0-1)
|
|
32
|
-
*/
|
|
33
|
-
export const logToLinearVolume = (logVolume: number): number => {
|
|
34
|
-
// Ensure value is within range
|
|
35
|
-
const normalizedLog = Math.max(MIN_VOLUME, Math.min(MAX_VOLUME, logVolume))
|
|
36
|
-
|
|
37
|
-
// Inverse of our simplified formula
|
|
38
|
-
return Math.pow(normalizedLog, MAX_VOLUME/VOLUME_EXPONENT)
|
|
39
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState } from 'react'
|
|
2
|
-
|
|
3
|
-
const useWindowSize = () => {
|
|
4
|
-
const [windowHeight, setWindowHeight] = useState(window.innerHeight)
|
|
5
|
-
const [windowWidth, setWindowWidth] = useState(window.innerWidth)
|
|
6
|
-
useEffect(() => {
|
|
7
|
-
const handleResize = () => {
|
|
8
|
-
setWindowHeight(window.innerHeight)
|
|
9
|
-
setWindowWidth(window.innerWidth)
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
window.addEventListener('resize', handleResize)
|
|
13
|
-
|
|
14
|
-
return () => { window.removeEventListener('resize', handleResize) }
|
|
15
|
-
}, [])
|
|
16
|
-
return [windowHeight, windowWidth]
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export default useWindowSize
|
package/src/vite-env.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/// <reference types="vite/client" />
|
package/tsconfig.json
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ESNext",
|
|
4
|
-
"outDir": "build",
|
|
5
|
-
"lib": ["DOM", "DOM.Iterable", "ESNext"],
|
|
6
|
-
"allowJs": false,
|
|
7
|
-
"skipLibCheck": true,
|
|
8
|
-
"esModuleInterop": false,
|
|
9
|
-
"allowSyntheticDefaultImports": true,
|
|
10
|
-
"strict": true,
|
|
11
|
-
"forceConsistentCasingInFileNames": true,
|
|
12
|
-
"module": "ESNext",
|
|
13
|
-
"moduleResolution": "Node",
|
|
14
|
-
"resolveJsonModule": true,
|
|
15
|
-
"isolatedModules": true,
|
|
16
|
-
"noEmit": false,
|
|
17
|
-
"declaration": true,
|
|
18
|
-
"emitDeclarationOnly": true,
|
|
19
|
-
"jsx": "react-jsx",
|
|
20
|
-
"paths": {
|
|
21
|
-
"mp4box": ["./src/utils/mp4box.ts"]
|
|
22
|
-
},
|
|
23
|
-
"types": []
|
|
24
|
-
},
|
|
25
|
-
"include": ["src"],
|
|
26
|
-
"exclude": ["node_modules"],
|
|
27
|
-
"references": [{ "path": "./tsconfig.node.json" }]
|
|
28
|
-
}
|
package/tsconfig.node.json
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|