@lobehub/ui 6.0.0-beta.1 → 6.0.0-beta.3
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 +3 -1
- package/es/Accordion/style.d.mts +1 -1
- package/es/ActionIcon/type.d.mts +1 -0
- package/es/Alert/type.d.mts +1 -0
- package/es/AutoComplete/style.d.mts +2 -1
- package/es/AutoComplete/type.d.mts +1 -0
- package/es/Button/type.d.mts +1 -0
- package/es/Checkbox/type.d.mts +1 -0
- package/es/ColorSwatches/type.d.mts +1 -0
- package/es/Drawer/atoms.d.mts +1 -0
- package/es/Drawer/constants.d.mts +1 -0
- package/es/FileTypeIcon/type.d.mts +1 -0
- package/es/Form/type.d.mts +1 -0
- package/es/GroupAvatar/type.d.mts +1 -0
- package/es/Highlighter/const.d.mts +1 -0
- package/es/Input/style.d.mts +1 -0
- package/es/Input/type.d.mts +1 -0
- package/es/Markdown/plugins/remarkColor.d.mts +1 -0
- package/es/Markdown/plugins/remarkGfmPlus.d.mts +1 -0
- package/es/Markdown/plugins/remarkVideo.d.mts +1 -0
- package/es/Mermaid/const.d.mts +1 -0
- package/es/Modal/atoms.d.mts +1 -0
- package/es/Modal/constants.d.mts +1 -0
- package/es/Modal/type.d.mts +1 -0
- package/es/Radio/type.d.mts +1 -0
- package/es/Segmented/atoms.d.mts +1 -0
- package/es/Slider/type.d.mts +1 -0
- package/es/Switch/atoms.d.mts +1 -0
- package/es/Text/style.d.mts +2 -1
- package/es/ToggleGroup/atoms.d.mts +1 -0
- package/es/Video/Video.mjs +46 -0
- package/es/Video/Video.mjs.map +1 -0
- package/es/Video/context.mjs +14 -0
- package/es/Video/context.mjs.map +1 -0
- package/es/Video/index.d.mts +23 -39
- package/es/Video/index.mjs +21 -111
- package/es/Video/index.mjs.map +1 -1
- package/es/Video/parts/Caption.d.mts +9 -0
- package/es/Video/parts/Caption.mjs +34 -0
- package/es/Video/parts/Caption.mjs.map +1 -0
- package/es/Video/parts/CenterPlay.d.mts +8 -0
- package/es/Video/parts/CenterPlay.mjs +34 -0
- package/es/Video/parts/CenterPlay.mjs.map +1 -0
- package/es/Video/parts/Controls.d.mts +9 -0
- package/es/Video/parts/Controls.mjs +123 -0
- package/es/Video/parts/Controls.mjs.map +1 -0
- package/es/Video/parts/Frame.d.mts +9 -0
- package/es/Video/parts/Frame.mjs +94 -0
- package/es/Video/parts/Frame.mjs.map +1 -0
- package/es/Video/parts/HoverPreview.mjs +93 -0
- package/es/Video/parts/HoverPreview.mjs.map +1 -0
- package/es/Video/parts/LoadError.d.mts +8 -0
- package/es/Video/parts/LoadError.mjs +47 -0
- package/es/Video/parts/LoadError.mjs.map +1 -0
- package/es/Video/parts/PlayPauseIcon.mjs +48 -0
- package/es/Video/parts/PlayPauseIcon.mjs.map +1 -0
- package/es/Video/parts/RateMenu.mjs +48 -0
- package/es/Video/parts/RateMenu.mjs.map +1 -0
- package/es/Video/parts/Root.d.mts +9 -0
- package/es/Video/parts/Root.mjs +110 -0
- package/es/Video/parts/Root.mjs.map +1 -0
- package/es/Video/parts/SectionList.d.mts +9 -0
- package/es/Video/parts/SectionList.mjs +32 -0
- package/es/Video/parts/SectionList.mjs.map +1 -0
- package/es/Video/parts/SectionMenu.mjs +63 -0
- package/es/Video/parts/SectionMenu.mjs.map +1 -0
- package/es/Video/parts/Timeline.d.mts +9 -0
- package/es/Video/parts/Timeline.mjs +169 -0
- package/es/Video/parts/Timeline.mjs.map +1 -0
- package/es/Video/store.mjs +241 -0
- package/es/Video/store.mjs.map +1 -0
- package/es/Video/style.mjs +393 -23
- package/es/Video/style.mjs.map +1 -1
- package/es/Video/time.mjs +60 -0
- package/es/Video/time.mjs.map +1 -0
- package/es/Video/type.d.mts +125 -0
- package/es/Video/useControlsIdle.mjs +39 -0
- package/es/Video/useControlsIdle.mjs.map +1 -0
- package/es/Video/useFullscreen.mjs +17 -0
- package/es/Video/useFullscreen.mjs.map +1 -0
- package/es/Video/useKeyboard.mjs +60 -0
- package/es/Video/useKeyboard.mjs.map +1 -0
- package/es/Video/useVideo.d.mts +9 -0
- package/es/Video/useVideo.mjs +17 -0
- package/es/Video/useVideo.mjs.map +1 -0
- package/es/color/types.d.mts +1 -0
- package/es/hooks/useMarkdown/utils.d.mts +1 -0
- package/es/i18n/resources/en/index.d.mts +3 -2
- package/es/i18n/resources/en/index.mjs +4 -2
- package/es/i18n/resources/en/index.mjs.map +1 -1
- package/es/i18n/resources/en/video.d.mts +23 -0
- package/es/i18n/resources/en/video.mjs +24 -0
- package/es/i18n/resources/en/video.mjs.map +1 -0
- package/es/i18n/resources/zhCn/index.d.mts +3 -2
- package/es/i18n/resources/zhCn/index.mjs +4 -2
- package/es/i18n/resources/zhCn/index.mjs.map +1 -1
- package/es/i18n/resources/zhCn/video.d.mts +23 -0
- package/es/i18n/resources/zhCn/video.mjs +24 -0
- package/es/i18n/resources/zhCn/video.mjs.map +1 -0
- package/es/i18n/types.d.mts +3 -1
- package/es/index.d.mts +4 -2
- package/es/index.mjs +2 -1
- package/es/internal/menu/itemInterface.d.mts +1 -0
- package/es/internal/menu/renderUtils.d.mts +1 -0
- package/es/mdx/mdxComponents/Video.d.mts +2 -1
- package/es/mdx/mdxComponents/Video.mjs +5 -3
- package/es/mdx/mdxComponents/Video.mjs.map +1 -1
- package/es/node_modules/.pnpm/@types_mdx@2.0.14/node_modules/@types/mdx/types.d.mts +1 -0
- package/es/node_modules/.pnpm/eslint@10.12.0_jiti@2.6.1_supports-color@10.2.2/node_modules/eslint/lib/types/index.d.mts +1 -0
- package/es/style.css +263 -23
- package/es/styles/createGlobalStyle.d.mts +1 -0
- package/es/styles/theme/generateColorPalette.d.mts +1 -0
- package/es/styles/theme/scope.d.mts +1 -0
- package/es/types/customToken.d.mts +1 -0
- package/package.json +5 -5
- package/es/Video/marker.stylex.mjs +0 -9
- package/es/Video/marker.stylex.mjs.map +0 -1
package/es/Video/style.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.mjs","names":[],"sources":["../../src/Video/style.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\n\nimport { cssVar } from '@/styles/stylex/cssVar.stylex';\n\nimport { videoMarker } from './marker.stylex';\n\nexport const maskHoverCls = 'lobe-video-mask';\n\nexport const styles = stylex.create({\n filled: {\n borderColor: cssVar.colorBorderSecondary,\n borderStyle: 'solid',\n borderWidth: 1,\n backgroundColor: cssVar.colorFillTertiary,\n },\n mask: {\n inset: 0,\n transition: 'opacity 0.2s ease',\n backgroundColor: cssVar.colorBgMask,\n opacity: { default: 0, [stylex.when.ancestor(':hover', videoMarker)]: 1 },\n pointerEvents: 'none',\n position: 'absolute',\n zIndex: 1,\n height: '100%',\n width: '100%',\n },\n root: {\n borderRadius: cssVar.borderRadius,\n overflow: 'hidden',\n backgroundColor: cssVar.colorFillTertiary,\n marginBlockEnd: '1em',\n marginBlockStart: 0,\n position: 'relative',\n height: 'auto',\n maxHeight: 'var(--video-max-height, 100%)',\n maxWidth: 'var(--video-max-width, 100%)',\n minHeight: 'var(--video-min-height, unset)',\n minWidth: 'var(--video-min-width, unset)',\n width: '100%',\n },\n video: {\n cursor: 'pointer',\n width: '100%',\n },\n});\n"],"mappings":";AAKA,MAAa,eAAe;AAC5B,MAAa,SAAS;CACpB,QAAQ;EACN,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,MAAM;EACJ,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,MAAM;EACJ,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;EACP,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,OAAO;EACL,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;AACF"}
|
|
1
|
+
{"version":3,"file":"style.mjs","names":[],"sources":["../../src/Video/style.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\n\nimport { cssVar } from '@/styles/stylex/cssVar.stylex';\n\nconst reducedMotion = '@media (prefers-reduced-motion: reduce)';\nconst chromeBar = '#151515';\n\nconst labelFromBelow = stylex.keyframes({\n from: { opacity: 0, transform: 'translateY(70%)' },\n to: { opacity: 1, transform: 'none' },\n});\nconst labelFromAbove = stylex.keyframes({\n from: { opacity: 0, transform: 'translateY(-70%)' },\n to: { opacity: 1, transform: 'none' },\n});\n\n// The chrome stays dark in both themes: it sits on the black letterbox and\n// must not flash white around a dark recording.\nexport const styles = stylex.create({\n barButton: {\n padding: 0,\n borderRadius: 6,\n borderStyle: 'none',\n flex: 'none',\n outline: { 'default': 'none', ':focus-visible': '2px solid rgb(255 255 255 / 60%)' },\n alignItems: 'center',\n backgroundColor: {\n 'default': 'transparent',\n ':hover': 'rgb(255 255 255 / 12%)',\n },\n color: 'inherit',\n cursor: 'pointer',\n display: 'inline-flex',\n fontFamily: 'inherit',\n fontSize: 12,\n justifyContent: 'center',\n height: 28,\n minWidth: 28,\n },\n barButtonActive: {\n backgroundColor: 'rgb(255 255 255 / 18%)',\n },\n caption: {\n borderRadius: 8,\n paddingBlock: 8,\n paddingInline: 12,\n transition: { default: 'inset-block-end 200ms ease', [reducedMotion]: 'none' },\n backgroundColor: 'rgb(0 0 0 / 78%)',\n color: '#fff',\n fontSize: 13,\n insetBlockEnd: 16,\n insetInlineStart: 16,\n lineHeight: 1.5,\n position: 'absolute',\n zIndex: 2,\n maxWidth: '70%',\n },\n captionItem: {\n marginBlockStart: { 'default': 8, ':first-child': 0 },\n },\n captionRaised: {\n insetBlockEnd: 76,\n },\n captionTitle: {\n gap: 6,\n alignItems: 'center',\n display: 'flex',\n fontWeight: 600,\n },\n centerPlay: {\n borderRadius: '50%',\n borderStyle: 'none',\n alignItems: 'center',\n backgroundColor: 'rgb(0 0 0 / 55%)',\n color: '#fff',\n cursor: 'pointer',\n display: 'flex',\n insetBlockStart: '50%',\n insetInlineStart: '50%',\n justifyContent: 'center',\n position: 'absolute',\n transform: 'translate(-50%, -50%)',\n zIndex: 2,\n height: 56,\n width: 56,\n },\n chip: {\n borderRadius: 6,\n borderStyle: 'none',\n gap: 2,\n overflow: 'hidden',\n alignItems: 'center',\n backgroundColor: { 'default': 'rgb(255 255 255 / 10%)', ':hover': 'rgb(255 255 255 / 16%)' },\n color: 'inherit',\n cursor: 'pointer',\n display: 'inline-flex',\n fontFamily: 'inherit',\n fontSize: 12,\n paddingInlineEnd: 4,\n paddingInlineStart: 8,\n height: 24,\n maxWidth: '40%',\n minWidth: 0,\n },\n chipLabelBackward: {\n animationDuration: { default: '220ms', [reducedMotion]: '0s' },\n animationName: labelFromAbove,\n animationTimingFunction: 'cubic-bezier(0.2, 0, 0, 1)',\n },\n chipLabelForward: {\n animationDuration: { default: '220ms', [reducedMotion]: '0s' },\n animationName: labelFromBelow,\n animationTimingFunction: 'cubic-bezier(0.2, 0, 0, 1)',\n },\n chipText: {\n overflow: 'hidden',\n display: 'block',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n },\n controls: {\n paddingInline: 12,\n color: '#fff',\n paddingBlockEnd: 6,\n },\n controlsBelow: {\n backgroundColor: chromeBar,\n paddingBlockStart: 6,\n },\n controlsHidden: {\n opacity: 0,\n pointerEvents: 'none',\n },\n controlsOverlay: {\n insetInline: 0,\n transition: { default: 'opacity 200ms ease', [reducedMotion]: 'none' },\n backgroundImage: 'linear-gradient(to bottom, rgb(0 0 0 / 0%), rgb(0 0 0 / 72%))',\n insetBlockEnd: 0,\n paddingBlockStart: 40,\n position: 'absolute',\n zIndex: 3,\n },\n disabled: {\n opacity: 0.4,\n pointerEvents: 'none',\n },\n dot: {\n borderRadius: '50%',\n flex: 'none',\n height: 6,\n width: 6,\n },\n error: {\n inset: 0,\n gap: 10,\n alignItems: 'center',\n backgroundColor: '#000',\n color: '#ccc',\n display: 'flex',\n flexDirection: 'column',\n fontSize: 13,\n justifyContent: 'center',\n position: 'absolute',\n zIndex: 4,\n },\n errorActions: {\n gap: 8,\n display: 'flex',\n },\n errorButton: {\n borderColor: 'rgb(255 255 255 / 20%)',\n borderRadius: 6,\n borderStyle: 'solid',\n borderWidth: 1,\n gap: 6,\n paddingInline: 10,\n textDecoration: 'none',\n alignItems: 'center',\n backgroundColor: { 'default': 'rgb(255 255 255 / 8%)', ':hover': 'rgb(255 255 255 / 14%)' },\n color: '#fff',\n cursor: 'pointer',\n display: 'inline-flex',\n fontFamily: 'inherit',\n fontSize: 12,\n height: 28,\n },\n frame: {\n overflow: 'hidden',\n backgroundColor: '#000',\n position: 'relative',\n width: '100%',\n },\n frameNo: {\n color: '#8a8a8a',\n fontFamily: cssVar.fontFamilyCode,\n fontVariantNumeric: 'tabular-nums',\n whiteSpace: 'nowrap',\n },\n hairline: {\n backgroundColor: 'rgb(0 0 0 / 55%)',\n insetBlockStart: 8,\n pointerEvents: 'none',\n position: 'absolute',\n height: 4,\n width: 1,\n },\n head: {\n borderRadius: '50%',\n backgroundColor: '#fff',\n insetBlockStart: 4,\n marginInlineStart: -6,\n pointerEvents: 'none',\n position: 'absolute',\n height: 12,\n width: 12,\n },\n marker: {\n padding: 0,\n borderColor: 'rgb(0 0 0 / 60%)',\n borderRadius: '50%',\n borderStyle: 'solid',\n borderWidth: 1.5,\n outline: { 'default': 'none', ':focus-visible': '2px solid #fff' },\n transition: { default: 'transform 120ms ease', [reducedMotion]: 'none' },\n cursor: 'pointer',\n insetBlockStart: -2,\n marginInlineStart: -5,\n position: 'absolute',\n transform: { 'default': null, ':hover': 'scale(1.3)' },\n zIndex: 1,\n height: 10,\n width: 10,\n },\n preview: {\n gap: 4,\n alignItems: 'center',\n display: 'flex',\n flexDirection: 'column',\n insetBlockEnd: 24,\n marginInlineStart: -88,\n pointerEvents: 'none',\n position: 'absolute',\n zIndex: 2,\n width: 176,\n },\n previewCanvas: {\n borderColor: '#333',\n borderRadius: 8,\n borderStyle: 'solid',\n borderWidth: 1,\n backgroundColor: '#000',\n display: 'block',\n height: 99,\n width: 176,\n },\n previewLabel: {\n borderRadius: 6,\n overflow: 'hidden',\n paddingBlock: 3,\n paddingInline: 8,\n backgroundColor: 'rgb(0 0 0 / 82%)',\n fontSize: 12,\n lineHeight: 1.4,\n textAlign: 'center',\n textOverflow: 'ellipsis',\n maxWidth: 176,\n },\n previewTime: {\n color: '#ddd',\n fontFamily: cssVar.fontFamilyCode,\n fontSize: 11,\n },\n previewTitle: {\n fontWeight: 600,\n whiteSpace: 'nowrap',\n },\n root: {\n borderRadius: cssVar.borderRadiusLG,\n outline: 'none',\n overflow: 'hidden',\n backgroundColor: '#000',\n boxShadow: { 'default': null, ':focus-visible': `0 0 0 2px ${cssVar.colorPrimaryBorder}` },\n color: '#fff',\n lineHeight: 1,\n position: 'relative',\n maxWidth: '100%',\n },\n rateButton: {\n paddingInline: 6,\n fontFamily: cssVar.fontFamilyCode,\n },\n row: {\n gap: 4,\n alignItems: 'center',\n display: 'flex',\n fontSize: 12,\n height: 32,\n },\n sectionChip: {\n borderColor: 'rgb(255 255 255 / 14%)',\n borderRadius: 6,\n borderStyle: 'solid',\n borderWidth: 1,\n gap: 6,\n outline: { 'default': 'none', ':focus-visible': '2px solid rgb(255 255 255 / 60%)' },\n paddingInline: 8,\n alignItems: 'center',\n backgroundColor: { 'default': 'transparent', ':hover': 'rgb(255 255 255 / 8%)' },\n color: { 'default': '#bbb', ':hover': '#fff' },\n cursor: 'pointer',\n display: 'inline-flex',\n fontFamily: 'inherit',\n fontSize: 12,\n height: 24,\n },\n sectionChipActive: {\n backgroundColor: 'rgb(255 255 255 / 16%)',\n color: '#fff',\n },\n sectionChipTime: {\n fontFamily: cssVar.fontFamilyCode,\n opacity: 0.7,\n },\n sectionList: {\n gap: 6,\n paddingBlock: 8,\n paddingInline: 12,\n backgroundColor: '#151515',\n display: 'flex',\n flexWrap: 'wrap',\n },\n segment: {\n borderRadius: 2,\n overflow: 'hidden',\n transition: {\n default: 'height 120ms ease, inset-block-start 120ms ease',\n [reducedMotion]: 'none',\n },\n backgroundColor: 'rgb(255 255 255 / 24%)',\n insetBlockStart: 8,\n position: 'absolute',\n height: 4,\n },\n segmentFill: {\n insetBlock: 0,\n insetInlineStart: 0,\n position: 'absolute',\n },\n segmentHovered: {\n insetBlockStart: 6,\n height: 8,\n },\n spacer: {\n flex: '1',\n },\n surface: {\n inset: 0,\n cursor: 'pointer',\n position: 'absolute',\n },\n time: {\n color: '#ddd',\n fontFamily: cssVar.fontFamilyCode,\n fontVariantNumeric: 'tabular-nums',\n whiteSpace: 'nowrap',\n },\n track: {\n outline: 'none',\n cursor: 'pointer',\n position: 'relative',\n touchAction: 'none',\n height: 20,\n },\n video: {\n display: 'block',\n objectFit: 'contain',\n height: '100%',\n width: '100%',\n },\n});\n\nexport const markerColor = (color?: string) => {\n switch (color) {\n case undefined:\n case 'info': {\n return cssVar.colorInfo;\n }\n case 'success': {\n return cssVar.colorSuccess;\n }\n case 'warning': {\n return cssVar.colorWarning;\n }\n case 'error': {\n return cssVar.colorError;\n }\n default: {\n return color;\n }\n }\n};\n"],"mappings":"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"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
const pad = (value) => String(value).padStart(2, "0");
|
|
2
|
+
const formatTime = (seconds) => {
|
|
3
|
+
const total = Number.isFinite(seconds) && seconds > 0 ? Math.floor(seconds) : 0;
|
|
4
|
+
const hours = Math.floor(total / 3600);
|
|
5
|
+
const minutes = Math.floor(total % 3600 / 60);
|
|
6
|
+
const rest = total % 60;
|
|
7
|
+
return hours > 0 ? `${hours}:${pad(minutes)}:${pad(rest)}` : `${minutes}:${pad(rest)}`;
|
|
8
|
+
};
|
|
9
|
+
const frameOf = (seconds, fps) => Math.floor(seconds * fps + 1e-6);
|
|
10
|
+
const steppedTime = (current, frames, duration, fps) => Math.min(Math.max((frameOf(current, fps) + frames + .5) / fps, 0), duration);
|
|
11
|
+
const sortSections = (sections) => [...sections].sort((a, b) => a.start - b.start);
|
|
12
|
+
const sectionAt = (sorted, time) => sorted.findLast((section) => section.start <= time + .01);
|
|
13
|
+
const markersAt = (markers, time, fps) => {
|
|
14
|
+
let latest;
|
|
15
|
+
for (const marker of markers) {
|
|
16
|
+
if (marker.content === void 0 || marker.content === null) continue;
|
|
17
|
+
if (time >= marker.time - .5 / fps && time < marker.time + 2 && (latest === void 0 || marker.time > latest)) latest = marker.time;
|
|
18
|
+
}
|
|
19
|
+
if (latest === void 0) return [];
|
|
20
|
+
return markers.filter((marker) => marker.time === latest && marker.content !== void 0 && marker.content !== null);
|
|
21
|
+
};
|
|
22
|
+
const mergeSegments = (sorted, duration, trackPx, minPx = 12) => {
|
|
23
|
+
if (!(duration > 0)) return {
|
|
24
|
+
hairlines: [],
|
|
25
|
+
segments: []
|
|
26
|
+
};
|
|
27
|
+
const bounds = [
|
|
28
|
+
0,
|
|
29
|
+
...[...new Set(sorted.map((s) => s.start).filter((start) => start > 0 && start < duration))],
|
|
30
|
+
duration
|
|
31
|
+
];
|
|
32
|
+
const segments = [];
|
|
33
|
+
const hairlines = [];
|
|
34
|
+
const minSeconds = trackPx > 0 ? minPx / trackPx * duration : 0;
|
|
35
|
+
let carry = false;
|
|
36
|
+
for (let i = 0; i < bounds.length - 1; i++) {
|
|
37
|
+
const raw = {
|
|
38
|
+
end: bounds[i + 1],
|
|
39
|
+
start: bounds[i]
|
|
40
|
+
};
|
|
41
|
+
const narrow = raw.end - raw.start < minSeconds;
|
|
42
|
+
const last = segments.at(-1);
|
|
43
|
+
if (last && (narrow || carry)) {
|
|
44
|
+
last.end = raw.end;
|
|
45
|
+
hairlines.push(raw.start);
|
|
46
|
+
carry = false;
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
segments.push(raw);
|
|
50
|
+
carry = narrow;
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
hairlines,
|
|
54
|
+
segments
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
//#endregion
|
|
58
|
+
export { formatTime, frameOf, markersAt, mergeSegments, sectionAt, sortSections, steppedTime };
|
|
59
|
+
|
|
60
|
+
//# sourceMappingURL=time.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"time.mjs","names":[],"sources":["../../src/Video/time.ts"],"sourcesContent":["import type { VideoMarker, VideoSection } from './type';\n\nexport const CAPTION_SECONDS = 2;\nexport const MIN_SEGMENT_PX = 12;\n\nconst pad = (value: number) => String(value).padStart(2, '0');\n\nexport const formatTime = (seconds: number) => {\n const total = Number.isFinite(seconds) && seconds > 0 ? Math.floor(seconds) : 0;\n const hours = Math.floor(total / 3600);\n const minutes = Math.floor((total % 3600) / 60);\n const rest = total % 60;\n return hours > 0 ? `${hours}:${pad(minutes)}:${pad(rest)}` : `${minutes}:${pad(rest)}`;\n};\n\n// The epsilon absorbs float error at exact frame boundaries.\nexport const frameOf = (seconds: number, fps: number) => Math.floor(seconds * fps + 1e-6);\n\n// Landing on frame centres means repeated steps never skip a frame or show one twice.\nexport const steppedTime = (current: number, frames: number, duration: number, fps: number) =>\n Math.min(Math.max((frameOf(current, fps) + frames + 0.5) / fps, 0), duration);\n\nexport const sortSections = (sections: VideoSection[]) =>\n [...sections].sort((a, b) => a.start - b.start);\n\nexport const sectionAt = (sorted: VideoSection[], time: number) =>\n sorted.findLast((section) => section.start <= time + 0.01);\n\nexport const markersAt = (markers: VideoMarker[], time: number, fps: number): VideoMarker[] => {\n let latest: number | undefined;\n for (const marker of markers) {\n if (marker.content === undefined || marker.content === null) continue;\n const onScreen = time >= marker.time - 0.5 / fps && time < marker.time + CAPTION_SECONDS;\n if (onScreen && (latest === undefined || marker.time > latest)) latest = marker.time;\n }\n if (latest === undefined) return [];\n return markers.filter(\n (marker) => marker.time === latest && marker.content !== undefined && marker.content !== null,\n );\n};\n\nexport interface Segment {\n end: number;\n start: number;\n}\n\nexport const mergeSegments = (\n sorted: VideoSection[],\n duration: number,\n trackPx: number,\n minPx = MIN_SEGMENT_PX,\n): { hairlines: number[]; segments: Segment[] } => {\n if (!(duration > 0)) return { hairlines: [], segments: [] };\n\n const cuts = [\n ...new Set(sorted.map((s) => s.start).filter((start) => start > 0 && start < duration)),\n ];\n const bounds = [0, ...cuts, duration];\n const segments: Segment[] = [];\n const hairlines: number[] = [];\n const minSeconds = trackPx > 0 ? (minPx / trackPx) * duration : 0;\n let carry = false;\n\n for (let i = 0; i < bounds.length - 1; i++) {\n const raw = { end: bounds[i + 1], start: bounds[i] };\n const narrow = raw.end - raw.start < minSeconds;\n const last = segments.at(-1);\n if (last && (narrow || carry)) {\n last.end = raw.end;\n hairlines.push(raw.start);\n carry = false;\n continue;\n }\n segments.push(raw);\n carry = narrow;\n }\n\n return { hairlines, segments };\n};\n"],"mappings":"AAKA,MAAM,OAAO,UAAkB,OAAO,KAAK,CAAC,CAAC,SAAS,GAAG,GAAG;AAE5D,MAAa,cAAc,YAAoB;CAC7C,MAAM,QAAQ,OAAO,SAAS,OAAO,KAAK,UAAU,IAAI,KAAK,MAAM,OAAO,IAAI;CAC9E,MAAM,QAAQ,KAAK,MAAM,QAAQ,IAAI;CACrC,MAAM,UAAU,KAAK,MAAO,QAAQ,OAAQ,EAAE;CAC9C,MAAM,OAAO,QAAQ;CACrB,OAAO,QAAQ,IAAI,GAAG,MAAM,GAAG,IAAI,OAAO,EAAE,GAAG,IAAI,IAAI,MAAM,GAAG,QAAQ,GAAG,IAAI,IAAI;AACrF;AAGA,MAAa,WAAW,SAAiB,QAAgB,KAAK,MAAM,UAAU,MAAM,IAAI;AAGxF,MAAa,eAAe,SAAiB,QAAgB,UAAkB,QAC7E,KAAK,IAAI,KAAK,KAAK,QAAQ,SAAS,GAAG,IAAI,SAAS,MAAO,KAAK,CAAC,GAAG,QAAQ;AAE9E,MAAa,gBAAgB,aAC3B,CAAC,GAAG,QAAQ,CAAC,CAAC,MAAM,GAAG,MAAM,EAAE,QAAQ,EAAE,KAAK;AAEhD,MAAa,aAAa,QAAwB,SAChD,OAAO,UAAU,YAAY,QAAQ,SAAS,OAAO,GAAI;AAE3D,MAAa,aAAa,SAAwB,MAAc,QAA+B;CAC7F,IAAI;CACJ,KAAK,MAAM,UAAU,SAAS;EAC5B,IAAI,OAAO,YAAY,KAAA,KAAa,OAAO,YAAY,MAAM;EAE7D,IADiB,QAAQ,OAAO,OAAO,KAAM,OAAO,OAAO,OAAO,OAAA,MACjD,WAAW,KAAA,KAAa,OAAO,OAAO,SAAS,SAAS,OAAO;CAClF;CACA,IAAI,WAAW,KAAA,GAAW,OAAO,CAAC;CAClC,OAAO,QAAQ,QACZ,WAAW,OAAO,SAAS,UAAU,OAAO,YAAY,KAAA,KAAa,OAAO,YAAY,IAC3F;AACF;AAOA,MAAa,iBACX,QACA,UACA,SACA,QAAA,OACiD;CACjD,IAAI,EAAE,WAAW,IAAI,OAAO;EAAE,WAAW,CAAC;EAAG,UAAU,CAAC;CAAE;CAK1D,MAAM,SAAS;EAAC;EAAG,GAAG,CAFpB,GAAG,IAAI,IAAI,OAAO,KAAK,MAAM,EAAE,KAAK,CAAC,CAAC,QAAQ,UAAU,QAAQ,KAAK,QAAQ,QAAQ,CAAC,CAE/D;EAAG;CAAQ;CACpC,MAAM,WAAsB,CAAC;CAC7B,MAAM,YAAsB,CAAC;CAC7B,MAAM,aAAa,UAAU,IAAK,QAAQ,UAAW,WAAW;CAChE,IAAI,QAAQ;CAEZ,KAAK,IAAI,IAAI,GAAG,IAAI,OAAO,SAAS,GAAG,KAAK;EAC1C,MAAM,MAAM;GAAE,KAAK,OAAO,IAAI;GAAI,OAAO,OAAO;EAAG;EACnD,MAAM,SAAS,IAAI,MAAM,IAAI,QAAQ;EACrC,MAAM,OAAO,SAAS,GAAG,EAAE;EAC3B,IAAI,SAAS,UAAU,QAAQ;GAC7B,KAAK,MAAM,IAAI;GACf,UAAU,KAAK,IAAI,KAAK;GACxB,QAAQ;GACR;EACF;EACA,SAAS,KAAK,GAAG;EACjB,QAAQ;CACV;CAEA,OAAO;EAAE;EAAW;CAAS;AAC/B"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { CSSProperties, Key, ReactEventHandler, ReactNode, Ref } from "react";
|
|
2
|
+
//#region src/Video/type.d.ts
|
|
3
|
+
export interface VideoSection {
|
|
4
|
+
start: number;
|
|
5
|
+
title: string;
|
|
6
|
+
}
|
|
7
|
+
export type VideoMarkerColor = 'success' | 'warning' | 'error' | 'info' | (string & {});
|
|
8
|
+
export interface VideoMarker {
|
|
9
|
+
color?: VideoMarkerColor;
|
|
10
|
+
content?: ReactNode;
|
|
11
|
+
key?: Key;
|
|
12
|
+
label?: ReactNode;
|
|
13
|
+
time: number;
|
|
14
|
+
}
|
|
15
|
+
export type VideoStatus = 'loading' | 'ready' | 'error';
|
|
16
|
+
export interface VideoState {
|
|
17
|
+
activeMarkers: VideoMarker[];
|
|
18
|
+
activeSection?: VideoSection;
|
|
19
|
+
captions: boolean;
|
|
20
|
+
duration: number;
|
|
21
|
+
muted: boolean;
|
|
22
|
+
paused: boolean;
|
|
23
|
+
rate: number;
|
|
24
|
+
size?: {
|
|
25
|
+
height: number;
|
|
26
|
+
width: number;
|
|
27
|
+
};
|
|
28
|
+
status: VideoStatus;
|
|
29
|
+
time: number;
|
|
30
|
+
}
|
|
31
|
+
export interface VideoPlayer {
|
|
32
|
+
getState: () => VideoState;
|
|
33
|
+
pause: () => void;
|
|
34
|
+
play: () => Promise<void>;
|
|
35
|
+
requestFullscreen: () => Promise<void>;
|
|
36
|
+
readonly root: HTMLDivElement | null;
|
|
37
|
+
seek: (seconds: number) => void;
|
|
38
|
+
setCaptions: (captions: boolean) => void;
|
|
39
|
+
setMuted: (muted: boolean) => void;
|
|
40
|
+
setRate: (rate: number) => void;
|
|
41
|
+
step: (frames: number) => void;
|
|
42
|
+
subscribe: (listener: (state: VideoState) => void) => () => void;
|
|
43
|
+
toggle: () => void;
|
|
44
|
+
toggleMute: () => void;
|
|
45
|
+
readonly video: HTMLVideoElement | null;
|
|
46
|
+
}
|
|
47
|
+
export interface VideoMediaProps {
|
|
48
|
+
autoPlay?: boolean;
|
|
49
|
+
loop?: boolean;
|
|
50
|
+
onEnded?: ReactEventHandler<HTMLVideoElement>;
|
|
51
|
+
onError?: ReactEventHandler<HTMLVideoElement>;
|
|
52
|
+
onPause?: ReactEventHandler<HTMLVideoElement>;
|
|
53
|
+
onPlay?: ReactEventHandler<HTMLVideoElement>;
|
|
54
|
+
onTimeUpdate?: ReactEventHandler<HTMLVideoElement>;
|
|
55
|
+
poster?: string;
|
|
56
|
+
preload?: HTMLVideoElement['preload'];
|
|
57
|
+
src: string;
|
|
58
|
+
}
|
|
59
|
+
export interface VideoRootProps extends VideoMediaProps {
|
|
60
|
+
captions?: boolean;
|
|
61
|
+
children?: ReactNode;
|
|
62
|
+
className?: string;
|
|
63
|
+
defaultPlaybackRate?: number;
|
|
64
|
+
fps?: number;
|
|
65
|
+
height?: number | string;
|
|
66
|
+
markers?: VideoMarker[];
|
|
67
|
+
maxHeight?: number;
|
|
68
|
+
muted?: boolean;
|
|
69
|
+
onMarkerClick?: (marker: VideoMarker) => void;
|
|
70
|
+
onMutedChange?: (muted: boolean) => void;
|
|
71
|
+
onRateChange?: (rate: number) => void;
|
|
72
|
+
onRetry?: () => Promise<unknown> | void;
|
|
73
|
+
playbackRates?: number[];
|
|
74
|
+
player?: VideoPlayer;
|
|
75
|
+
ref?: Ref<VideoPlayer>;
|
|
76
|
+
sections?: VideoSection[];
|
|
77
|
+
style?: CSSProperties;
|
|
78
|
+
width?: number | string;
|
|
79
|
+
}
|
|
80
|
+
export interface VideoTimelineProps {
|
|
81
|
+
children?: ReactNode;
|
|
82
|
+
className?: string;
|
|
83
|
+
style?: CSSProperties;
|
|
84
|
+
thumbnails?: boolean;
|
|
85
|
+
}
|
|
86
|
+
export interface VideoControlsProps {
|
|
87
|
+
children?: ReactNode;
|
|
88
|
+
className?: string;
|
|
89
|
+
extra?: ReactNode;
|
|
90
|
+
frameStep?: boolean;
|
|
91
|
+
style?: CSSProperties;
|
|
92
|
+
}
|
|
93
|
+
export interface VideoCaptionProps {
|
|
94
|
+
action?: (marker: VideoMarker) => ReactNode;
|
|
95
|
+
className?: string;
|
|
96
|
+
style?: CSSProperties;
|
|
97
|
+
}
|
|
98
|
+
export interface VideoFrameProps {
|
|
99
|
+
children?: ReactNode;
|
|
100
|
+
className?: string;
|
|
101
|
+
style?: CSSProperties;
|
|
102
|
+
}
|
|
103
|
+
export interface VideoSectionListProps {
|
|
104
|
+
className?: string;
|
|
105
|
+
style?: CSSProperties;
|
|
106
|
+
}
|
|
107
|
+
export interface VideoProps extends Omit<VideoRootProps, 'children'> {
|
|
108
|
+
classNames?: {
|
|
109
|
+
controls?: string;
|
|
110
|
+
frame?: string;
|
|
111
|
+
root?: string;
|
|
112
|
+
timeline?: string;
|
|
113
|
+
};
|
|
114
|
+
frameStep?: boolean;
|
|
115
|
+
overlay?: (state: VideoState) => ReactNode;
|
|
116
|
+
styles?: {
|
|
117
|
+
controls?: CSSProperties;
|
|
118
|
+
frame?: CSSProperties;
|
|
119
|
+
root?: CSSProperties;
|
|
120
|
+
timeline?: CSSProperties;
|
|
121
|
+
};
|
|
122
|
+
thumbnails?: boolean;
|
|
123
|
+
}
|
|
124
|
+
//#endregion
|
|
125
|
+
//# sourceMappingURL=type.d.mts.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
3
|
+
//#region src/Video/useControlsIdle.ts
|
|
4
|
+
const IDLE_HIDE_MS = 2e3;
|
|
5
|
+
const useControlsIdle = (forceVisible) => {
|
|
6
|
+
const [active, setActive] = useState(false);
|
|
7
|
+
const [focused, setFocused] = useState(false);
|
|
8
|
+
const [held, setHeld] = useState(false);
|
|
9
|
+
const timer = useRef(void 0);
|
|
10
|
+
const clear = useCallback(() => {
|
|
11
|
+
if (timer.current === void 0) return;
|
|
12
|
+
window.clearTimeout(timer.current);
|
|
13
|
+
timer.current = void 0;
|
|
14
|
+
}, []);
|
|
15
|
+
const wake = useCallback(() => {
|
|
16
|
+
setActive(true);
|
|
17
|
+
clear();
|
|
18
|
+
timer.current = window.setTimeout(() => {
|
|
19
|
+
timer.current = void 0;
|
|
20
|
+
setActive(false);
|
|
21
|
+
}, IDLE_HIDE_MS);
|
|
22
|
+
}, [clear]);
|
|
23
|
+
const sleep = useCallback(() => {
|
|
24
|
+
clear();
|
|
25
|
+
setActive(false);
|
|
26
|
+
}, [clear]);
|
|
27
|
+
useEffect(() => clear, [clear]);
|
|
28
|
+
return {
|
|
29
|
+
hold: setHeld,
|
|
30
|
+
setFocused,
|
|
31
|
+
sleep,
|
|
32
|
+
visible: forceVisible || active || focused || held,
|
|
33
|
+
wake
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
//#endregion
|
|
37
|
+
export { useControlsIdle };
|
|
38
|
+
|
|
39
|
+
//# sourceMappingURL=useControlsIdle.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useControlsIdle.mjs","names":[],"sources":["../../src/Video/useControlsIdle.ts"],"sourcesContent":["'use client';\n\nimport { useCallback, useEffect, useRef, useState } from 'react';\n\nconst IDLE_HIDE_MS = 2000;\n\nexport const useControlsIdle = (forceVisible: boolean) => {\n const [active, setActive] = useState(false);\n const [focused, setFocused] = useState(false);\n const [held, setHeld] = useState(false);\n const timer = useRef<number | undefined>(undefined);\n\n const clear = useCallback(() => {\n if (timer.current === undefined) return;\n window.clearTimeout(timer.current);\n timer.current = undefined;\n }, []);\n\n const wake = useCallback(() => {\n setActive(true);\n clear();\n timer.current = window.setTimeout(() => {\n timer.current = undefined;\n setActive(false);\n }, IDLE_HIDE_MS);\n }, [clear]);\n\n const sleep = useCallback(() => {\n clear();\n setActive(false);\n }, [clear]);\n\n useEffect(() => clear, [clear]);\n\n return {\n hold: setHeld,\n setFocused,\n sleep,\n visible: forceVisible || active || focused || held,\n wake,\n };\n};\n"],"mappings":";;;AAIA,MAAM,eAAe;AAErB,MAAa,mBAAmB,iBAA0B;CACxD,MAAM,CAAC,QAAQ,aAAa,SAAS,KAAK;CAC1C,MAAM,CAAC,SAAS,cAAc,SAAS,KAAK;CAC5C,MAAM,CAAC,MAAM,WAAW,SAAS,KAAK;CACtC,MAAM,QAAQ,OAA2B,KAAA,CAAS;CAElD,MAAM,QAAQ,kBAAkB;EAC9B,IAAI,MAAM,YAAY,KAAA,GAAW;EACjC,OAAO,aAAa,MAAM,OAAO;EACjC,MAAM,UAAU,KAAA;CAClB,GAAG,CAAC,CAAC;CAEL,MAAM,OAAO,kBAAkB;EAC7B,UAAU,IAAI;EACd,MAAM;EACN,MAAM,UAAU,OAAO,iBAAiB;GACtC,MAAM,UAAU,KAAA;GAChB,UAAU,KAAK;EACjB,GAAG,YAAY;CACjB,GAAG,CAAC,KAAK,CAAC;CAEV,MAAM,QAAQ,kBAAkB;EAC9B,MAAM;EACN,UAAU,KAAK;CACjB,GAAG,CAAC,KAAK,CAAC;CAEV,gBAAgB,OAAO,CAAC,KAAK,CAAC;CAE9B,OAAO;EACL,MAAM;EACN;EACA;EACA,SAAS,gBAAgB,UAAU,WAAW;EAC9C;CACF;AACF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
|
+
//#region src/Video/useFullscreen.ts
|
|
4
|
+
const useFullscreen = (store) => {
|
|
5
|
+
const [fullscreen, setFullscreen] = useState(false);
|
|
6
|
+
useEffect(() => {
|
|
7
|
+
const sync = () => setFullscreen(Boolean(store.root) && document.fullscreenElement === store.root);
|
|
8
|
+
sync();
|
|
9
|
+
document.addEventListener("fullscreenchange", sync);
|
|
10
|
+
return () => document.removeEventListener("fullscreenchange", sync);
|
|
11
|
+
}, [store]);
|
|
12
|
+
return fullscreen;
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { useFullscreen };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=useFullscreen.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFullscreen.mjs","names":[],"sources":["../../src/Video/useFullscreen.ts"],"sourcesContent":["'use client';\n\nimport { useEffect, useState } from 'react';\n\nimport type { VideoStore } from './store';\n\nexport const useFullscreen = (store: VideoStore) => {\n const [fullscreen, setFullscreen] = useState(false);\n useEffect(() => {\n const sync = () =>\n setFullscreen(Boolean(store.root) && document.fullscreenElement === store.root);\n sync();\n document.addEventListener('fullscreenchange', sync);\n return () => document.removeEventListener('fullscreenchange', sync);\n }, [store]);\n return fullscreen;\n};\n"],"mappings":";;;AAMA,MAAa,iBAAiB,UAAsB;CAClD,MAAM,CAAC,YAAY,iBAAiB,SAAS,KAAK;CAClD,gBAAgB;EACd,MAAM,aACJ,cAAc,QAAQ,MAAM,IAAI,KAAK,SAAS,sBAAsB,MAAM,IAAI;EAChF,KAAK;EACL,SAAS,iBAAiB,oBAAoB,IAAI;EAClD,aAAa,SAAS,oBAAoB,oBAAoB,IAAI;CACpE,GAAG,CAAC,KAAK,CAAC;CACV,OAAO;AACT"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
//#region src/Video/useKeyboard.ts
|
|
2
|
+
const DEFAULT_PLAYBACK_RATES = [
|
|
3
|
+
.5,
|
|
4
|
+
1,
|
|
5
|
+
1.5,
|
|
6
|
+
2
|
|
7
|
+
];
|
|
8
|
+
const nextRate = (rates, current, direction) => {
|
|
9
|
+
const index = rates.indexOf(current);
|
|
10
|
+
const from = index === -1 ? rates.findIndex((rate) => rate >= current) : index;
|
|
11
|
+
return rates[Math.min(Math.max((from === -1 ? rates.length - 1 : from) + direction, 0), rates.length - 1)];
|
|
12
|
+
};
|
|
13
|
+
const handleVideoKey = (event, store, rates = DEFAULT_PLAYBACK_RATES) => {
|
|
14
|
+
if (event.altKey || event.ctrlKey || event.metaKey) return false;
|
|
15
|
+
const target = event.target;
|
|
16
|
+
const host = event.currentTarget;
|
|
17
|
+
if (host instanceof Node && target instanceof Node && host !== target && !host.contains(target)) return false;
|
|
18
|
+
if (target?.isContentEditable || target?.closest?.("input, textarea, select, [role=\"menuitem\"], [contenteditable]:not([contenteditable=\"false\"])")) return false;
|
|
19
|
+
if (target instanceof HTMLButtonElement && (event.key === " " || event.key === "Enter")) return false;
|
|
20
|
+
const state = store.getState();
|
|
21
|
+
if (state.status !== "ready") return false;
|
|
22
|
+
switch (event.key.toLowerCase()) {
|
|
23
|
+
case " ":
|
|
24
|
+
case "k":
|
|
25
|
+
store.toggle();
|
|
26
|
+
return true;
|
|
27
|
+
case ",":
|
|
28
|
+
store.step(-1);
|
|
29
|
+
return true;
|
|
30
|
+
case ".":
|
|
31
|
+
store.step(1);
|
|
32
|
+
return true;
|
|
33
|
+
case "arrowleft":
|
|
34
|
+
store.seek(state.time - (event.shiftKey ? 5 : 1));
|
|
35
|
+
return true;
|
|
36
|
+
case "arrowright":
|
|
37
|
+
store.seek(state.time + (event.shiftKey ? 5 : 1));
|
|
38
|
+
return true;
|
|
39
|
+
case "j":
|
|
40
|
+
store.setRate(nextRate(rates, state.rate, -1));
|
|
41
|
+
return true;
|
|
42
|
+
case "l":
|
|
43
|
+
store.setRate(nextRate(rates, state.rate, 1));
|
|
44
|
+
return true;
|
|
45
|
+
case "m":
|
|
46
|
+
store.toggleMute();
|
|
47
|
+
return true;
|
|
48
|
+
case "c":
|
|
49
|
+
store.setCaptions(!state.captions);
|
|
50
|
+
return true;
|
|
51
|
+
case "f":
|
|
52
|
+
store.toggleFullscreen();
|
|
53
|
+
return true;
|
|
54
|
+
default: return false;
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
//#endregion
|
|
58
|
+
export { DEFAULT_PLAYBACK_RATES, handleVideoKey };
|
|
59
|
+
|
|
60
|
+
//# sourceMappingURL=useKeyboard.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useKeyboard.mjs","names":[],"sources":["../../src/Video/useKeyboard.ts"],"sourcesContent":["import type { KeyboardEvent as ReactKeyboardEvent } from 'react';\n\nimport type { VideoStore } from './store';\n\nexport const DEFAULT_PLAYBACK_RATES = [0.5, 1, 1.5, 2];\n\nconst nextRate = (rates: number[], current: number, direction: 1 | -1) => {\n const index = rates.indexOf(current);\n const from = index === -1 ? rates.findIndex((rate) => rate >= current) : index;\n const next = Math.min(\n Math.max((from === -1 ? rates.length - 1 : from) + direction, 0),\n rates.length - 1,\n );\n return rates[next];\n};\n\nexport const handleVideoKey = (\n event: KeyboardEvent | ReactKeyboardEvent,\n store: VideoStore,\n rates: number[] = DEFAULT_PLAYBACK_RATES,\n) => {\n if (event.altKey || event.ctrlKey || event.metaKey) return false;\n const target = event.target as HTMLElement | null;\n // Portalled content (menus) bubbles through React to Root without being inside it.\n const host = event.currentTarget as Node | null;\n if (host instanceof Node && target instanceof Node && host !== target && !host.contains(target))\n return false;\n if (\n target?.isContentEditable ||\n target?.closest?.(\n 'input, textarea, select, [role=\"menuitem\"], [contenteditable]:not([contenteditable=\"false\"])',\n )\n )\n return false;\n if (target instanceof HTMLButtonElement && (event.key === ' ' || event.key === 'Enter'))\n return false;\n const state = store.getState();\n if (state.status !== 'ready') return false;\n\n switch (event.key.toLowerCase()) {\n case ' ':\n case 'k': {\n store.toggle();\n return true;\n }\n case ',': {\n store.step(-1);\n return true;\n }\n case '.': {\n store.step(1);\n return true;\n }\n case 'arrowleft': {\n store.seek(state.time - (event.shiftKey ? 5 : 1));\n return true;\n }\n case 'arrowright': {\n store.seek(state.time + (event.shiftKey ? 5 : 1));\n return true;\n }\n case 'j': {\n store.setRate(nextRate(rates, state.rate, -1));\n return true;\n }\n case 'l': {\n store.setRate(nextRate(rates, state.rate, 1));\n return true;\n }\n case 'm': {\n store.toggleMute();\n return true;\n }\n case 'c': {\n store.setCaptions(!state.captions);\n return true;\n }\n case 'f': {\n store.toggleFullscreen();\n return true;\n }\n default: {\n return false;\n }\n }\n};\n"],"mappings":";AAIA,MAAa,yBAAyB;CAAC;CAAK;CAAG;CAAK;AAAC;AAErD,MAAM,YAAY,OAAiB,SAAiB,cAAsB;CACxE,MAAM,QAAQ,MAAM,QAAQ,OAAO;CACnC,MAAM,OAAO,UAAU,KAAK,MAAM,WAAW,SAAS,QAAQ,OAAO,IAAI;CAKzE,OAAO,MAJM,KAAK,IAChB,KAAK,KAAK,SAAS,KAAK,MAAM,SAAS,IAAI,QAAQ,WAAW,CAAC,GAC/D,MAAM,SAAS,CAED;AAClB;AAEA,MAAa,kBACX,OACA,OACA,QAAkB,2BACf;CACH,IAAI,MAAM,UAAU,MAAM,WAAW,MAAM,SAAS,OAAO;CAC3D,MAAM,SAAS,MAAM;CAErB,MAAM,OAAO,MAAM;CACnB,IAAI,gBAAgB,QAAQ,kBAAkB,QAAQ,SAAS,UAAU,CAAC,KAAK,SAAS,MAAM,GAC5F,OAAO;CACT,IACE,QAAQ,qBACR,QAAQ,UACN,kGACF,GAEA,OAAO;CACT,IAAI,kBAAkB,sBAAsB,MAAM,QAAQ,OAAO,MAAM,QAAQ,UAC7E,OAAO;CACT,MAAM,QAAQ,MAAM,SAAS;CAC7B,IAAI,MAAM,WAAW,SAAS,OAAO;CAErC,QAAQ,MAAM,IAAI,YAAY,GAA9B;EACE,KAAK;EACL,KAAK;GACH,MAAM,OAAO;GACb,OAAO;EAET,KAAK;GACH,MAAM,KAAK,EAAE;GACb,OAAO;EAET,KAAK;GACH,MAAM,KAAK,CAAC;GACZ,OAAO;EAET,KAAK;GACH,MAAM,KAAK,MAAM,QAAQ,MAAM,WAAW,IAAI,EAAE;GAChD,OAAO;EAET,KAAK;GACH,MAAM,KAAK,MAAM,QAAQ,MAAM,WAAW,IAAI,EAAE;GAChD,OAAO;EAET,KAAK;GACH,MAAM,QAAQ,SAAS,OAAO,MAAM,MAAM,EAAE,CAAC;GAC7C,OAAO;EAET,KAAK;GACH,MAAM,QAAQ,SAAS,OAAO,MAAM,MAAM,CAAC,CAAC;GAC5C,OAAO;EAET,KAAK;GACH,MAAM,WAAW;GACjB,OAAO;EAET,KAAK;GACH,MAAM,YAAY,CAAC,MAAM,QAAQ;GACjC,OAAO;EAET,KAAK;GACH,MAAM,iBAAiB;GACvB,OAAO;EAET,SACE,OAAO;CAEX;AACF"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { VideoPlayer, VideoState } from "./type.mjs";
|
|
2
|
+
//#region src/Video/useVideo.d.ts
|
|
3
|
+
export declare function useVideoState(player: VideoPlayer): VideoState;
|
|
4
|
+
export declare function useVideoState<T>(player: VideoPlayer, selector: (state: VideoState) => T): T;
|
|
5
|
+
export declare function useVideo(): VideoState;
|
|
6
|
+
export declare function useVideo<T>(selector: (state: VideoState) => T): T;
|
|
7
|
+
export declare const useVideoPlayer: () => VideoPlayer;
|
|
8
|
+
//#endregion
|
|
9
|
+
//# sourceMappingURL=useVideo.d.mts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useVideoContext } from "./context.mjs";
|
|
3
|
+
import { createVideoStore } from "./store.mjs";
|
|
4
|
+
import { useState, useSyncExternalStore } from "react";
|
|
5
|
+
//#region src/Video/useVideo.ts
|
|
6
|
+
const identity = (state) => state;
|
|
7
|
+
function useVideoState(player, selector = identity) {
|
|
8
|
+
return useSyncExternalStore(player.subscribe, () => selector(player.getState()), () => selector(player.getState()));
|
|
9
|
+
}
|
|
10
|
+
function useVideo(selector = identity) {
|
|
11
|
+
return useVideoState(useVideoContext().store, selector);
|
|
12
|
+
}
|
|
13
|
+
const useVideoPlayer = () => useState(createVideoStore)[0];
|
|
14
|
+
//#endregion
|
|
15
|
+
export { useVideo, useVideoPlayer, useVideoState };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=useVideo.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useVideo.mjs","names":[],"sources":["../../src/Video/useVideo.ts"],"sourcesContent":["'use client';\n\nimport { useState, useSyncExternalStore } from 'react';\n\nimport { useVideoContext } from './context';\nimport { createVideoStore } from './store';\nimport type { VideoPlayer, VideoState } from './type';\n\nconst identity = (state: VideoState) => state as unknown;\n\nexport function useVideoState(player: VideoPlayer): VideoState;\nexport function useVideoState<T>(player: VideoPlayer, selector: (state: VideoState) => T): T;\nexport function useVideoState(\n player: VideoPlayer,\n selector: (state: VideoState) => unknown = identity,\n) {\n return useSyncExternalStore(\n player.subscribe,\n () => selector(player.getState()),\n () => selector(player.getState()),\n );\n}\n\nexport function useVideo(): VideoState;\nexport function useVideo<T>(selector: (state: VideoState) => T): T;\nexport function useVideo(selector: (state: VideoState) => unknown = identity) {\n return useVideoState(useVideoContext().store, selector);\n}\n\nexport const useVideoPlayer = (): VideoPlayer => useState(createVideoStore)[0];\n"],"mappings":";;;;;AAQA,MAAM,YAAY,UAAsB;AAIxC,SAAgB,cACd,QACA,WAA2C,UAC3C;CACA,OAAO,qBACL,OAAO,iBACD,SAAS,OAAO,SAAS,CAAC,SAC1B,SAAS,OAAO,SAAS,CAAC,CAClC;AACF;AAIA,SAAgB,SAAS,WAA2C,UAAU;CAC5E,OAAO,cAAc,gBAAgB,CAAC,CAAC,OAAO,QAAQ;AACxD;AAEA,MAAa,uBAAoC,SAAS,gBAAgB,CAAC,CAAC"}
|
package/es/color/types.d.mts
CHANGED
|
@@ -11,9 +11,10 @@ import _default$9 from "./image.mjs";
|
|
|
11
11
|
import _default$10 from "./messageModal.mjs";
|
|
12
12
|
import _default$11 from "./qrCode.mjs";
|
|
13
13
|
import _default$12 from "./sideNav.mjs";
|
|
14
|
+
import _default$13 from "./video.mjs";
|
|
14
15
|
declare namespace index_d_exports {
|
|
15
|
-
export { _default as burger, _default$1 as chat, _default$2 as colorPicker, _default$3 as common, _default$4 as datePicker, _default$5 as editableMessage, _default$6 as emojiPicker, _default$7 as form, _default$8 as hotkey, _default$9 as image, _default$10 as messageModal, _default$11 as qrCode, _default$12 as sideNav };
|
|
16
|
+
export { _default as burger, _default$1 as chat, _default$2 as colorPicker, _default$3 as common, _default$4 as datePicker, _default$5 as editableMessage, _default$6 as emojiPicker, _default$7 as form, _default$8 as hotkey, _default$9 as image, _default$10 as messageModal, _default$11 as qrCode, _default$12 as sideNav, _default$13 as video };
|
|
16
17
|
}
|
|
17
18
|
//#endregion
|
|
18
|
-
export { _default as burger, _default$1 as chat, _default$2 as colorPicker, _default$3 as common, _default$4 as datePicker, _default$5 as editableMessage, _default$6 as emojiPicker, _default$7 as form, _default$8 as hotkey, _default$9 as image, index_d_exports, _default$10 as messageModal, _default$11 as qrCode, _default$12 as sideNav };
|
|
19
|
+
export { _default as burger, _default$1 as chat, _default$2 as colorPicker, _default$3 as common, _default$4 as datePicker, _default$5 as editableMessage, _default$6 as emojiPicker, _default$7 as form, _default$8 as hotkey, _default$9 as image, index_d_exports, _default$10 as messageModal, _default$11 as qrCode, _default$12 as sideNav, _default$13 as video };
|
|
19
20
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -7,6 +7,7 @@ import emojiPicker_default from "./emojiPicker.mjs";
|
|
|
7
7
|
import form_default from "./form.mjs";
|
|
8
8
|
import hotkey_default from "./hotkey.mjs";
|
|
9
9
|
import image_default from "./image.mjs";
|
|
10
|
+
import video_default from "./video.mjs";
|
|
10
11
|
import qrCode_default from "./qrCode.mjs";
|
|
11
12
|
import chat_default from "./chat.mjs";
|
|
12
13
|
import messageModal_default from "./messageModal.mjs";
|
|
@@ -26,9 +27,10 @@ var en_exports = /* @__PURE__ */ __exportAll({
|
|
|
26
27
|
image: () => image_default,
|
|
27
28
|
messageModal: () => messageModal_default,
|
|
28
29
|
qrCode: () => qrCode_default,
|
|
29
|
-
sideNav: () => sideNav_default
|
|
30
|
+
sideNav: () => sideNav_default,
|
|
31
|
+
video: () => video_default
|
|
30
32
|
});
|
|
31
33
|
//#endregion
|
|
32
|
-
export { burger_default as burger, chat_default as chat, colorPicker_default as colorPicker, common_default as common, datePicker_default as datePicker, editableMessage_default as editableMessage, emojiPicker_default as emojiPicker, en_exports, form_default as form, hotkey_default as hotkey, image_default as image, messageModal_default as messageModal, qrCode_default as qrCode, sideNav_default as sideNav };
|
|
34
|
+
export { burger_default as burger, chat_default as chat, colorPicker_default as colorPicker, common_default as common, datePicker_default as datePicker, editableMessage_default as editableMessage, emojiPicker_default as emojiPicker, en_exports, form_default as form, hotkey_default as hotkey, image_default as image, messageModal_default as messageModal, qrCode_default as qrCode, sideNav_default as sideNav, video_default as video };
|
|
33
35
|
|
|
34
36
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/i18n/resources/en/index.ts"],"sourcesContent":["export { default as burger } from './burger';\nexport { default as chat } from './chat';\nexport { default as colorPicker } from './colorPicker';\nexport { default as common } from './common';\nexport { default as datePicker } from './datePicker';\nexport { default as editableMessage } from './editableMessage';\nexport { default as emojiPicker } from './emojiPicker';\nexport { default as form } from './form';\nexport { default as hotkey } from './hotkey';\nexport { default as image } from './image';\nexport { default as messageModal } from './messageModal';\nexport { default as qrCode } from './qrCode';\nexport { default as sideNav } from './sideNav';\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/i18n/resources/en/index.ts"],"sourcesContent":["export { default as burger } from './burger';\nexport { default as chat } from './chat';\nexport { default as colorPicker } from './colorPicker';\nexport { default as common } from './common';\nexport { default as datePicker } from './datePicker';\nexport { default as editableMessage } from './editableMessage';\nexport { default as emojiPicker } from './emojiPicker';\nexport { default as form } from './form';\nexport { default as hotkey } from './hotkey';\nexport { default as image } from './image';\nexport { default as messageModal } from './messageModal';\nexport { default as qrCode } from './qrCode';\nexport { default as sideNav } from './sideNav';\nexport { default as video } from './video';\n"],"mappings":""}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//#region src/i18n/resources/en/video.d.ts
|
|
2
|
+
declare const _default: {
|
|
3
|
+
readonly 'video.captionsHide': "Hide captions";
|
|
4
|
+
readonly 'video.captionsShow': "Show captions";
|
|
5
|
+
readonly 'video.download': "Download";
|
|
6
|
+
readonly 'video.exitFullscreen': "Exit fullscreen";
|
|
7
|
+
readonly 'video.frame': "Frame";
|
|
8
|
+
readonly 'video.fullscreen': "Fullscreen";
|
|
9
|
+
readonly 'video.loadFailed': "This video could not be loaded";
|
|
10
|
+
readonly 'video.mute': "Mute";
|
|
11
|
+
readonly 'video.nextFrame': "Next frame";
|
|
12
|
+
readonly 'video.pause': "Pause";
|
|
13
|
+
readonly 'video.play': "Play";
|
|
14
|
+
readonly 'video.previousFrame': "Previous frame";
|
|
15
|
+
readonly 'video.reload': "Reload";
|
|
16
|
+
readonly 'video.sections': "Sections";
|
|
17
|
+
readonly 'video.seek': "Seek";
|
|
18
|
+
readonly 'video.speed': "Playback speed";
|
|
19
|
+
readonly 'video.unmute': "Unmute";
|
|
20
|
+
};
|
|
21
|
+
//#endregion
|
|
22
|
+
export { _default as default };
|
|
23
|
+
//# sourceMappingURL=video.d.mts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//#region src/i18n/resources/en/video.ts
|
|
2
|
+
var video_default = {
|
|
3
|
+
"video.captionsHide": "Hide captions",
|
|
4
|
+
"video.captionsShow": "Show captions",
|
|
5
|
+
"video.download": "Download",
|
|
6
|
+
"video.exitFullscreen": "Exit fullscreen",
|
|
7
|
+
"video.frame": "Frame",
|
|
8
|
+
"video.fullscreen": "Fullscreen",
|
|
9
|
+
"video.loadFailed": "This video could not be loaded",
|
|
10
|
+
"video.mute": "Mute",
|
|
11
|
+
"video.nextFrame": "Next frame",
|
|
12
|
+
"video.pause": "Pause",
|
|
13
|
+
"video.play": "Play",
|
|
14
|
+
"video.previousFrame": "Previous frame",
|
|
15
|
+
"video.reload": "Reload",
|
|
16
|
+
"video.sections": "Sections",
|
|
17
|
+
"video.seek": "Seek",
|
|
18
|
+
"video.speed": "Playback speed",
|
|
19
|
+
"video.unmute": "Unmute"
|
|
20
|
+
};
|
|
21
|
+
//#endregion
|
|
22
|
+
export { video_default as default };
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=video.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"video.mjs","names":[],"sources":["../../../../src/i18n/resources/en/video.ts"],"sourcesContent":["export default {\n 'video.captionsHide': 'Hide captions',\n 'video.captionsShow': 'Show captions',\n 'video.download': 'Download',\n 'video.exitFullscreen': 'Exit fullscreen',\n 'video.frame': 'Frame',\n 'video.fullscreen': 'Fullscreen',\n 'video.loadFailed': 'This video could not be loaded',\n 'video.mute': 'Mute',\n 'video.nextFrame': 'Next frame',\n 'video.pause': 'Pause',\n 'video.play': 'Play',\n 'video.previousFrame': 'Previous frame',\n 'video.reload': 'Reload',\n 'video.sections': 'Sections',\n 'video.seek': 'Seek',\n 'video.speed': 'Playback speed',\n 'video.unmute': 'Unmute',\n} as const;\n"],"mappings":";AAAA,IAAA,gBAAe;CACb,sBAAsB;CACtB,sBAAsB;CACtB,kBAAkB;CAClB,wBAAwB;CACxB,eAAe;CACf,oBAAoB;CACpB,oBAAoB;CACpB,cAAc;CACd,mBAAmB;CACnB,eAAe;CACf,cAAc;CACd,uBAAuB;CACvB,gBAAgB;CAChB,kBAAkB;CAClB,cAAc;CACd,eAAe;CACf,gBAAgB;AAClB"}
|
|
@@ -11,9 +11,10 @@ import _default$9 from "./image.mjs";
|
|
|
11
11
|
import _default$10 from "./messageModal.mjs";
|
|
12
12
|
import _default$11 from "./qrCode.mjs";
|
|
13
13
|
import _default$12 from "./sideNav.mjs";
|
|
14
|
+
import _default$13 from "./video.mjs";
|
|
14
15
|
declare namespace index_d_exports {
|
|
15
|
-
export { _default as burger, _default$1 as chat, _default$2 as colorPicker, _default$3 as common, _default$4 as datePicker, _default$5 as editableMessage, _default$6 as emojiPicker, _default$7 as form, _default$8 as hotkey, _default$9 as image, _default$10 as messageModal, _default$11 as qrCode, _default$12 as sideNav };
|
|
16
|
+
export { _default as burger, _default$1 as chat, _default$2 as colorPicker, _default$3 as common, _default$4 as datePicker, _default$5 as editableMessage, _default$6 as emojiPicker, _default$7 as form, _default$8 as hotkey, _default$9 as image, _default$10 as messageModal, _default$11 as qrCode, _default$12 as sideNav, _default$13 as video };
|
|
16
17
|
}
|
|
17
18
|
//#endregion
|
|
18
|
-
export { _default as burger, _default$1 as chat, _default$2 as colorPicker, _default$3 as common, _default$4 as datePicker, _default$5 as editableMessage, _default$6 as emojiPicker, _default$7 as form, _default$8 as hotkey, _default$9 as image, index_d_exports, _default$10 as messageModal, _default$11 as qrCode, _default$12 as sideNav };
|
|
19
|
+
export { _default as burger, _default$1 as chat, _default$2 as colorPicker, _default$3 as common, _default$4 as datePicker, _default$5 as editableMessage, _default$6 as emojiPicker, _default$7 as form, _default$8 as hotkey, _default$9 as image, index_d_exports, _default$10 as messageModal, _default$11 as qrCode, _default$12 as sideNav, _default$13 as video };
|
|
19
20
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -12,6 +12,7 @@ import image_default from "./image.mjs";
|
|
|
12
12
|
import messageModal_default from "./messageModal.mjs";
|
|
13
13
|
import qrCode_default from "./qrCode.mjs";
|
|
14
14
|
import sideNav_default from "./sideNav.mjs";
|
|
15
|
+
import video_default from "./video.mjs";
|
|
15
16
|
//#region src/i18n/resources/zhCn/index.ts
|
|
16
17
|
var zhCn_exports = /* @__PURE__ */ __exportAll({
|
|
17
18
|
burger: () => burger_default,
|
|
@@ -26,9 +27,10 @@ var zhCn_exports = /* @__PURE__ */ __exportAll({
|
|
|
26
27
|
image: () => image_default,
|
|
27
28
|
messageModal: () => messageModal_default,
|
|
28
29
|
qrCode: () => qrCode_default,
|
|
29
|
-
sideNav: () => sideNav_default
|
|
30
|
+
sideNav: () => sideNav_default,
|
|
31
|
+
video: () => video_default
|
|
30
32
|
});
|
|
31
33
|
//#endregion
|
|
32
|
-
export { burger_default as burger, chat_default as chat, colorPicker_default as colorPicker, common_default as common, datePicker_default as datePicker, editableMessage_default as editableMessage, emojiPicker_default as emojiPicker, form_default as form, hotkey_default as hotkey, image_default as image, messageModal_default as messageModal, qrCode_default as qrCode, sideNav_default as sideNav, zhCn_exports };
|
|
34
|
+
export { burger_default as burger, chat_default as chat, colorPicker_default as colorPicker, common_default as common, datePicker_default as datePicker, editableMessage_default as editableMessage, emojiPicker_default as emojiPicker, form_default as form, hotkey_default as hotkey, image_default as image, messageModal_default as messageModal, qrCode_default as qrCode, sideNav_default as sideNav, video_default as video, zhCn_exports };
|
|
33
35
|
|
|
34
36
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/i18n/resources/zhCn/index.ts"],"sourcesContent":["export { default as burger } from './burger';\nexport { default as chat } from './chat';\nexport { default as colorPicker } from './colorPicker';\nexport { default as common } from './common';\nexport { default as datePicker } from './datePicker';\nexport { default as editableMessage } from './editableMessage';\nexport { default as emojiPicker } from './emojiPicker';\nexport { default as form } from './form';\nexport { default as hotkey } from './hotkey';\nexport { default as image } from './image';\nexport { default as messageModal } from './messageModal';\nexport { default as qrCode } from './qrCode';\nexport { default as sideNav } from './sideNav';\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/i18n/resources/zhCn/index.ts"],"sourcesContent":["export { default as burger } from './burger';\nexport { default as chat } from './chat';\nexport { default as colorPicker } from './colorPicker';\nexport { default as common } from './common';\nexport { default as datePicker } from './datePicker';\nexport { default as editableMessage } from './editableMessage';\nexport { default as emojiPicker } from './emojiPicker';\nexport { default as form } from './form';\nexport { default as hotkey } from './hotkey';\nexport { default as image } from './image';\nexport { default as messageModal } from './messageModal';\nexport { default as qrCode } from './qrCode';\nexport { default as sideNav } from './sideNav';\nexport { default as video } from './video';\n"],"mappings":""}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//#region src/i18n/resources/zhCn/video.d.ts
|
|
2
|
+
declare const _default: {
|
|
3
|
+
readonly 'video.captionsHide': "隐藏字幕";
|
|
4
|
+
readonly 'video.captionsShow': "显示字幕";
|
|
5
|
+
readonly 'video.download': "下载";
|
|
6
|
+
readonly 'video.exitFullscreen': "退出全屏";
|
|
7
|
+
readonly 'video.frame': "帧";
|
|
8
|
+
readonly 'video.fullscreen': "全屏";
|
|
9
|
+
readonly 'video.loadFailed': "视频加载失败";
|
|
10
|
+
readonly 'video.mute': "静音";
|
|
11
|
+
readonly 'video.nextFrame': "下一帧";
|
|
12
|
+
readonly 'video.pause': "暂停";
|
|
13
|
+
readonly 'video.play': "播放";
|
|
14
|
+
readonly 'video.previousFrame': "上一帧";
|
|
15
|
+
readonly 'video.reload': "重新加载";
|
|
16
|
+
readonly 'video.sections': "章节";
|
|
17
|
+
readonly 'video.seek': "进度";
|
|
18
|
+
readonly 'video.speed': "播放速度";
|
|
19
|
+
readonly 'video.unmute': "取消静音";
|
|
20
|
+
};
|
|
21
|
+
//#endregion
|
|
22
|
+
export { _default as default };
|
|
23
|
+
//# sourceMappingURL=video.d.mts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//#region src/i18n/resources/zhCn/video.ts
|
|
2
|
+
var video_default = {
|
|
3
|
+
"video.captionsHide": "隐藏字幕",
|
|
4
|
+
"video.captionsShow": "显示字幕",
|
|
5
|
+
"video.download": "下载",
|
|
6
|
+
"video.exitFullscreen": "退出全屏",
|
|
7
|
+
"video.frame": "帧",
|
|
8
|
+
"video.fullscreen": "全屏",
|
|
9
|
+
"video.loadFailed": "视频加载失败",
|
|
10
|
+
"video.mute": "静音",
|
|
11
|
+
"video.nextFrame": "下一帧",
|
|
12
|
+
"video.pause": "暂停",
|
|
13
|
+
"video.play": "播放",
|
|
14
|
+
"video.previousFrame": "上一帧",
|
|
15
|
+
"video.reload": "重新加载",
|
|
16
|
+
"video.sections": "章节",
|
|
17
|
+
"video.seek": "进度",
|
|
18
|
+
"video.speed": "播放速度",
|
|
19
|
+
"video.unmute": "取消静音"
|
|
20
|
+
};
|
|
21
|
+
//#endregion
|
|
22
|
+
export { video_default as default };
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=video.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"video.mjs","names":[],"sources":["../../../../src/i18n/resources/zhCn/video.ts"],"sourcesContent":["export default {\n 'video.captionsHide': '隐藏字幕',\n 'video.captionsShow': '显示字幕',\n 'video.download': '下载',\n 'video.exitFullscreen': '退出全屏',\n 'video.frame': '帧',\n 'video.fullscreen': '全屏',\n 'video.loadFailed': '视频加载失败',\n 'video.mute': '静音',\n 'video.nextFrame': '下一帧',\n 'video.pause': '暂停',\n 'video.play': '播放',\n 'video.previousFrame': '上一帧',\n 'video.reload': '重新加载',\n 'video.sections': '章节',\n 'video.seek': '进度',\n 'video.speed': '播放速度',\n 'video.unmute': '取消静音',\n} as const;\n"],"mappings":";AAAA,IAAA,gBAAe;CACb,sBAAsB;CACtB,sBAAsB;CACtB,kBAAkB;CAClB,wBAAwB;CACxB,eAAe;CACf,oBAAoB;CACpB,oBAAoB;CACpB,cAAc;CACd,mBAAmB;CACnB,eAAe;CACf,cAAc;CACd,uBAAuB;CACvB,gBAAgB;CAChB,kBAAkB;CAClB,cAAc;CACd,eAAe;CACf,gBAAgB;AAClB"}
|