@orangelogic/design-system 4.32.0 → 4.33.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/library/package.json +1 -1
- package/library/packages/events/src/cx-video-segment.d.ts +41 -0
- package/library/packages/events/src/events.d.ts +1 -0
- package/library/packages/hybrid/video-advanced/src/react/components/ControlBarTimeControls/ControlBarTimeControls.d.ts +3 -1
- package/library/packages/hybrid/video-advanced/src/react/components/SegmentPlayerControls/ChapterTrack.d.ts +13 -0
- package/library/packages/hybrid/video-advanced/src/react/components/SegmentPlayerControls/SegmentPlayerControls.d.ts +37 -0
- package/library/packages/hybrid/video-advanced/src/react/components/SegmentPlayerControls/SegmentPlayerControls.styles.d.ts +2 -0
- package/library/packages/hybrid/video-advanced/src/react/constants.d.ts +7 -0
- package/library/packages/hybrid/video-advanced/src/react/context/annotationCommentContext.d.ts +1 -0
- package/library/packages/hybrid/video-advanced/src/react/context.d.ts +2 -1
- package/library/packages/hybrid/video-advanced/src/react/hooks/useControlBar.d.ts +2 -2
- package/library/packages/hybrid/video-advanced/src/react/plugins/Chapters/Select.d.ts +3 -1
- package/library/packages/hybrid/video-advanced/src/react/plugins/PlaybackSlider/PlaybackSlider.d.ts +4 -1
- package/library/packages/hybrid/video-advanced/src/react/plugins/SettingsMenu/RewindMenu.d.ts +1 -0
- package/library/packages/hybrid/video-advanced/src/react/plugins/SettingsMenu/SettingsMenu.d.ts +4 -1
- package/library/packages/hybrid/video-advanced/src/react/type.d.ts +86 -1
- package/library/packages/hybrid/video-advanced/src/react/utils/frameUtils.d.ts +7 -0
- package/library/packages/hybrid/video-advanced/src/react/utils/segmentTime.d.ts +8 -0
- package/library/packages/hybrid/video-advanced/src/react/utils/useMenuKeyboardBoundary.d.ts +2 -0
- package/library/packages/hybrid/video-advanced/src/video-advanced/video-advanced.d.ts +45 -2
- package/library/packages/organisms/src/content-builder/styleController.d.ts +1 -1
- package/library/packages/tools/src/tiptap/utils/md/schema.d.ts +1 -1
- package/library/packages/types/src/video-advanced.d.ts +29 -0
- package/library/react-web-component.d.ts +34 -2
- package/package.json +1 -1
package/library/package.json
CHANGED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export type CxVideoSegmentClickEvent = CustomEvent<{
|
|
2
|
+
id: string;
|
|
3
|
+
}>;
|
|
4
|
+
export type CxVideoSegmentsUnderPlayheadEvent = CustomEvent<{
|
|
5
|
+
ids: string[];
|
|
6
|
+
}>;
|
|
7
|
+
export type CxVideoSegmentCreateEvent = CustomEvent<{
|
|
8
|
+
startPosition: number;
|
|
9
|
+
stopPosition: number;
|
|
10
|
+
}>;
|
|
11
|
+
export type CxVideoSegmentPanelChangeEvent = CustomEvent<{
|
|
12
|
+
open: boolean;
|
|
13
|
+
}>;
|
|
14
|
+
export type CxVideoSegmentVisibilityChangeEvent = CustomEvent<{
|
|
15
|
+
visible: boolean;
|
|
16
|
+
}>;
|
|
17
|
+
export type CxVideoSegmentTimecodeFormattedEvent = CustomEvent<{
|
|
18
|
+
format: string;
|
|
19
|
+
seconds: number;
|
|
20
|
+
text: string;
|
|
21
|
+
}>;
|
|
22
|
+
export type CxVideoSegmentTimecodeParsedEvent = CustomEvent<{
|
|
23
|
+
format: string;
|
|
24
|
+
input: string;
|
|
25
|
+
seconds: number | null;
|
|
26
|
+
}>;
|
|
27
|
+
export type CxVideoTimeFormatChangeEvent = CustomEvent<{
|
|
28
|
+
format: string;
|
|
29
|
+
}>;
|
|
30
|
+
declare global {
|
|
31
|
+
interface GlobalEventHandlersEventMap {
|
|
32
|
+
'cx-video-segment-click': CxVideoSegmentClickEvent;
|
|
33
|
+
'cx-video-segment-create': CxVideoSegmentCreateEvent;
|
|
34
|
+
'cx-video-segment-panel-change': CxVideoSegmentPanelChangeEvent;
|
|
35
|
+
'cx-video-segment-timecode-formatted': CxVideoSegmentTimecodeFormattedEvent;
|
|
36
|
+
'cx-video-segment-timecode-parsed': CxVideoSegmentTimecodeParsedEvent;
|
|
37
|
+
'cx-video-segment-visibility-change': CxVideoSegmentVisibilityChangeEvent;
|
|
38
|
+
'cx-video-segments-under-playhead': CxVideoSegmentsUnderPlayheadEvent;
|
|
39
|
+
'cx-video-time-format-change': CxVideoTimeFormatChangeEvent;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -259,6 +259,7 @@ export * from './cx-video-prev-frame';
|
|
|
259
259
|
export * from './cx-video-seeked';
|
|
260
260
|
export * from './cx-video-segment-change';
|
|
261
261
|
export * from './cx-video-media';
|
|
262
|
+
export * from './cx-video-segment';
|
|
262
263
|
export * from './cx-video-time-update';
|
|
263
264
|
export * from './cx-view-and-sort-action-click';
|
|
264
265
|
export * from './cx-view-logs';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { EDIT_MODE, TIMECODE_MODE, VIDEO_STATUS_ENUM } from '../../constants';
|
|
2
2
|
import { Chapter } from '../../plugins/Chapters';
|
|
3
3
|
import { ExtendedQualityLevelList, ExtendedTextTrackList, Timecode } from '../../type';
|
|
4
|
-
|
|
4
|
+
import { SegmentPlayback } from '../SegmentPlayerControls/SegmentPlayerControls';
|
|
5
|
+
export type Props = {
|
|
5
6
|
activatePremiumFeatures: boolean;
|
|
6
7
|
changePlaybackSpeed: (speed: number) => void;
|
|
7
8
|
changeQualityLevel: (levelIndex: number) => void;
|
|
@@ -28,6 +29,7 @@ type Props = {
|
|
|
28
29
|
playbackSpeed: number;
|
|
29
30
|
playbackSpeedOptions: number[];
|
|
30
31
|
qualityLevelList: ExtendedQualityLevelList;
|
|
32
|
+
segmentPlayback?: SegmentPlayback;
|
|
31
33
|
showTimeline: boolean;
|
|
32
34
|
showTranscription: boolean;
|
|
33
35
|
textTrackList: ExtendedTextTrackList | null;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Chapter } from '../../plugins/Chapters';
|
|
2
|
+
import { SegmentPlayback } from './SegmentPlayerControls';
|
|
3
|
+
/** Reuse the legacy chapter renderer; the native range owns seeking and keyboard input. */
|
|
4
|
+
export default function ChapterTrack({ chapters, clipEnd, clipStart, currentTime, duration, hoverTime, hoveredChapterId, player, }: {
|
|
5
|
+
chapters: Chapter[];
|
|
6
|
+
clipEnd?: number;
|
|
7
|
+
clipStart?: number;
|
|
8
|
+
currentTime: number;
|
|
9
|
+
duration: number;
|
|
10
|
+
hoverTime: number | null;
|
|
11
|
+
hoveredChapterId: string | null;
|
|
12
|
+
player: SegmentPlayback['player'];
|
|
13
|
+
}): import('react/jsx-runtime').JSX.Element;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ReactNode, RefObject } from 'react';
|
|
2
|
+
import { TIMECODE_MODE } from '../../constants';
|
|
3
|
+
import { TimelineHandle } from '../../plugins/Timeline';
|
|
4
|
+
import { Context, SelectedTimeSegment } from '../../type';
|
|
5
|
+
import { Props as ControlProps } from '../ControlBarTimeControls/ControlBarTimeControls';
|
|
6
|
+
export interface SegmentPlayback {
|
|
7
|
+
ctx: Context;
|
|
8
|
+
currentTime: number;
|
|
9
|
+
duration: number;
|
|
10
|
+
focusVideo: () => void;
|
|
11
|
+
fractionalSegmentInput: boolean;
|
|
12
|
+
hover: (seconds: number | null, track: HTMLElement) => void;
|
|
13
|
+
isPlayingSegment: boolean;
|
|
14
|
+
pause: () => void;
|
|
15
|
+
paused: boolean;
|
|
16
|
+
playSegment: () => void;
|
|
17
|
+
player: {
|
|
18
|
+
buffered: () => TimeRanges;
|
|
19
|
+
currentTime: () => number;
|
|
20
|
+
muted: (value?: boolean) => boolean;
|
|
21
|
+
off: (event: string, handler: () => void) => void;
|
|
22
|
+
on: (event: string, handler: () => void) => void;
|
|
23
|
+
requestPictureInPicture?: () => void;
|
|
24
|
+
volume: (value?: number) => number;
|
|
25
|
+
} | null;
|
|
26
|
+
seek: (seconds: number) => void;
|
|
27
|
+
segmentEditOnMouseUp: boolean;
|
|
28
|
+
selectedTimeSegments: SelectedTimeSegment[];
|
|
29
|
+
thumbnail: (mode: TIMECODE_MODE) => ReactNode;
|
|
30
|
+
timelineRef: RefObject<TimelineHandle | null>;
|
|
31
|
+
toggleFullscreen: () => void;
|
|
32
|
+
togglePlay: () => void;
|
|
33
|
+
}
|
|
34
|
+
declare const SegmentPlayerControls: import('react').ForwardRefExoticComponent<ControlProps & {
|
|
35
|
+
playback: SegmentPlayback;
|
|
36
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
37
|
+
export default SegmentPlayerControls;
|
|
@@ -50,6 +50,13 @@ export declare const _1_EXP_3 = 1000;
|
|
|
50
50
|
export declare const _36_EXP_8 = 3600000000;
|
|
51
51
|
export declare const _6_EXP_7 = 60000000;
|
|
52
52
|
export declare const MINUTE_TO_SECOND = 60;
|
|
53
|
+
/**
|
|
54
|
+
* NTSC rate = whole rate × 1000/1001 (30 → 29.97…).
|
|
55
|
+
* @see https://en.wikipedia.org/wiki/NTSC#History
|
|
56
|
+
*/
|
|
57
|
+
export declare const NTSC_RATE_FACTOR: number;
|
|
58
|
+
/** Max gap to count a rate as NTSC; 2-decimal rounding (29.97) is off by ≤ 0.005. */
|
|
59
|
+
export declare const NTSC_FRAME_RATE_TOLERANCE = 0.01;
|
|
53
60
|
export declare const AUTOPLAY_TIMEOUT = 500;
|
|
54
61
|
export declare const INACTIVITY_TIMEOUT = 5000;
|
|
55
62
|
export declare const REWIND_INTERVAL = 50;
|
package/library/packages/hybrid/video-advanced/src/react/context/annotationCommentContext.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ interface IAnnotationCommentContext {
|
|
|
9
9
|
enableAnnotation: boolean | null;
|
|
10
10
|
enableComment: boolean | null;
|
|
11
11
|
enableCommentTimelineMarkers: boolean;
|
|
12
|
+
hideCommentButton: boolean;
|
|
12
13
|
isCommentAnchorActive: boolean;
|
|
13
14
|
setActiveTimelineCommentId: (id: string | null) => void;
|
|
14
15
|
setAnnotationLayerElement: (annotationLayer: HTMLElement | null) => void;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { VideoPlayerVariant } from '../../../../types/src/video-advanced';
|
|
1
2
|
import { Dispatch, SetStateAction } from 'react';
|
|
2
3
|
import { TIMECODE_MODE } from './constants';
|
|
3
4
|
import { ExtendedSubClip, Timecode } from './type';
|
|
@@ -21,6 +22,6 @@ export declare const VideoReactContext: import('react').Context<{
|
|
|
21
22
|
subClips: ExtendedSubClip[];
|
|
22
23
|
timecodeMode: TIMECODE_MODE;
|
|
23
24
|
totalDuration: number;
|
|
24
|
-
|
|
25
|
+
variant: VideoPlayerVariant;
|
|
25
26
|
videoID: string;
|
|
26
27
|
}>;
|
|
@@ -4,7 +4,7 @@ interface IUseControlBarProps {
|
|
|
4
4
|
videoRef: RefObject<HTMLDivElement | null>;
|
|
5
5
|
}
|
|
6
6
|
declare function useControlBar({ isVideoMounted, videoRef }: IUseControlBarProps): {
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
controlsHost: HTMLDivElement | null;
|
|
8
|
+
loopHost: HTMLDivElement | null;
|
|
9
9
|
};
|
|
10
10
|
export default useControlBar;
|
|
@@ -9,13 +9,15 @@ type ChapterSelectPropstype = {
|
|
|
9
9
|
chaptersList: Chapter[];
|
|
10
10
|
frameRate: number;
|
|
11
11
|
isFullscreen: boolean;
|
|
12
|
+
menuItem?: boolean;
|
|
12
13
|
onHoverChapter: (chap: Chapter | null) => void;
|
|
13
14
|
onSaveChapters: (chaptersList: Chapter[]) => void;
|
|
14
15
|
onSelectChapter: (chap: Chapter) => void;
|
|
15
16
|
timecode: Timecode;
|
|
16
17
|
timecodeMode: TIMECODE_MODE;
|
|
18
|
+
toolbar?: boolean;
|
|
17
19
|
videoDuration: number;
|
|
18
20
|
videoRect: DOMRectReadOnly | null | undefined;
|
|
19
21
|
};
|
|
20
|
-
declare const _default: import('react').MemoExoticComponent<({ chaptersList, frameRate, isFullscreen, onHoverChapter, onSaveChapters, onSelectChapter, timecode, timecodeMode, videoDuration, videoRect, }: ChapterSelectPropstype) => import('react/jsx-runtime').JSX.Element>;
|
|
22
|
+
declare const _default: import('react').MemoExoticComponent<({ chaptersList, frameRate, isFullscreen, menuItem, onHoverChapter, onSaveChapters, onSelectChapter, timecode, timecodeMode, toolbar, videoDuration, videoRect, }: ChapterSelectPropstype) => import('react/jsx-runtime').JSX.Element>;
|
|
21
23
|
export default _default;
|
package/library/packages/hybrid/video-advanced/src/react/plugins/PlaybackSlider/PlaybackSlider.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
declare const _default: import('react').MemoExoticComponent<({ changePlaybackSpeed, disabledForward, disabledRewind, isFullscreen, playbackSpeed, }: {
|
|
1
|
+
declare const _default: import('react').MemoExoticComponent<({ changePlaybackSpeed, disabledForward, disabledRewind, isFullscreen, modern, playbackSpeed, playbackSpeedOptions, premium, }: {
|
|
2
2
|
changePlaybackSpeed: (speed: number) => void;
|
|
3
3
|
disabledForward: boolean;
|
|
4
4
|
disabledRewind: boolean;
|
|
5
5
|
isFullscreen: boolean;
|
|
6
|
+
modern?: boolean;
|
|
6
7
|
playbackSpeed: number;
|
|
8
|
+
playbackSpeedOptions?: number[];
|
|
9
|
+
premium?: boolean;
|
|
7
10
|
}) => import('react/jsx-runtime').JSX.Element>;
|
|
8
11
|
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function RewindMenu(): import('react/jsx-runtime').JSX.Element;
|
package/library/packages/hybrid/video-advanced/src/react/plugins/SettingsMenu/SettingsMenu.d.ts
CHANGED
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
import { FunctionComponent } from 'react';
|
|
1
|
+
import { FunctionComponent, ReactNode } from 'react';
|
|
2
2
|
import { EDIT_MODE } from '../../constants';
|
|
3
3
|
import { ExtendedQualityLevelList } from '../../type';
|
|
4
4
|
interface ISettingsMenuProps {
|
|
5
5
|
changePlaybackSpeed: (speed: number) => void;
|
|
6
6
|
changeQualityLevel: (levelIndex: number) => void;
|
|
7
7
|
editMode: EDIT_MODE;
|
|
8
|
+
extraItems?: ReactNode;
|
|
9
|
+
modern?: boolean;
|
|
8
10
|
onToggleTimeline: (show: boolean) => void;
|
|
9
11
|
openShortcutsModal: () => void;
|
|
10
12
|
playbackSpeed: number;
|
|
11
13
|
playbackSpeedOptions: number[];
|
|
12
14
|
qualityLevelList: ExtendedQualityLevelList;
|
|
13
15
|
showTimeline: boolean;
|
|
16
|
+
timelineItems?: ReactNode;
|
|
14
17
|
}
|
|
15
18
|
declare const SettingsMenu: FunctionComponent<ISettingsMenuProps>;
|
|
16
19
|
export default SettingsMenu;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { VideoPlayerVariant, VideoSegmentUIConfig } from '../../../../types/src/video-advanced';
|
|
1
2
|
import { CSSProperties } from 'react';
|
|
2
3
|
import { QualityLevel, QualityLevelList } from 'videojs-contrib-quality-levels';
|
|
3
4
|
import { EDIT_MODE } from './constants';
|
|
@@ -122,7 +123,8 @@ export type Context = {
|
|
|
122
123
|
*/
|
|
123
124
|
collabUI?: boolean;
|
|
124
125
|
darkMode: boolean;
|
|
125
|
-
|
|
126
|
+
hideCommentButton?: boolean;
|
|
127
|
+
variant?: VideoPlayerVariant;
|
|
126
128
|
};
|
|
127
129
|
extractCurrentFrameEvent: {
|
|
128
130
|
onFired: (handler: () => void) => () => void;
|
|
@@ -130,6 +132,7 @@ export type Context = {
|
|
|
130
132
|
fetchCortexApi: (relativeUrl: string, init: any, params: any) => any;
|
|
131
133
|
fireEvent: (eventName: string, args: any) => void;
|
|
132
134
|
onClosed?: (cleanup: () => void) => void;
|
|
135
|
+
segmentUI?: VideoContextItem<VideoSegmentUIConfig>;
|
|
133
136
|
videoContext: {
|
|
134
137
|
activatePremiumFeatures: VideoContextItem<boolean>;
|
|
135
138
|
activeCaptionID: VideoContextItem<string>;
|
|
@@ -137,6 +140,10 @@ export type Context = {
|
|
|
137
140
|
* comment id selected on the timeline (collab / marker UI)
|
|
138
141
|
*/
|
|
139
142
|
activeTimelineCommentId: VideoContextItem<string | null>;
|
|
143
|
+
/**
|
|
144
|
+
* timeline segment id selected on the modern timeline
|
|
145
|
+
*/
|
|
146
|
+
activeTimelineSegmentId: VideoContextItem<string | null>;
|
|
140
147
|
alwaysShowControls: VideoContextItem<boolean>;
|
|
141
148
|
autoPlay: VideoContextItem<boolean>;
|
|
142
149
|
canAddSubClip: VideoContextItem<boolean>;
|
|
@@ -194,6 +201,10 @@ export type Context = {
|
|
|
194
201
|
*/
|
|
195
202
|
showCommentSidebar: VideoContextItem<boolean>;
|
|
196
203
|
showExport: VideoContextItem<boolean>;
|
|
204
|
+
/**
|
|
205
|
+
* whether the consumer-owned segment panel is open
|
|
206
|
+
*/
|
|
207
|
+
showSegmentSidebar: VideoContextItem<boolean>;
|
|
197
208
|
showTranscription: VideoContextItem<boolean>;
|
|
198
209
|
smallMode: VideoContextItem<boolean>;
|
|
199
210
|
sourceMIME: VideoContextItem<string>;
|
|
@@ -396,10 +407,84 @@ export type Context = {
|
|
|
396
407
|
stopPosition: number;
|
|
397
408
|
}) => void) => () => void;
|
|
398
409
|
};
|
|
410
|
+
segmentClickEvent: {
|
|
411
|
+
fire: (args: {
|
|
412
|
+
id: string;
|
|
413
|
+
}) => void;
|
|
414
|
+
onFired: (handler: (args: {
|
|
415
|
+
id: string;
|
|
416
|
+
}) => void) => () => void;
|
|
417
|
+
};
|
|
418
|
+
segmentCreateEvent: {
|
|
419
|
+
fire: (detail: {
|
|
420
|
+
startPosition: number;
|
|
421
|
+
stopPosition: number;
|
|
422
|
+
}) => void;
|
|
423
|
+
onFired: (handler: (detail: {
|
|
424
|
+
startPosition: number;
|
|
425
|
+
stopPosition: number;
|
|
426
|
+
}) => void) => () => void;
|
|
427
|
+
};
|
|
428
|
+
segmentPanelChangeEvent: {
|
|
429
|
+
fire: (args: {
|
|
430
|
+
open: boolean;
|
|
431
|
+
}) => void;
|
|
432
|
+
onFired: (handler: (args: {
|
|
433
|
+
open: boolean;
|
|
434
|
+
}) => void) => () => void;
|
|
435
|
+
};
|
|
436
|
+
segmentTimecodeFormattedEvent: {
|
|
437
|
+
fire: (detail: {
|
|
438
|
+
format: string;
|
|
439
|
+
seconds: number;
|
|
440
|
+
text: string;
|
|
441
|
+
}) => void;
|
|
442
|
+
onFired: (handler: (detail: {
|
|
443
|
+
format: string;
|
|
444
|
+
seconds: number;
|
|
445
|
+
text: string;
|
|
446
|
+
}) => void) => () => void;
|
|
447
|
+
};
|
|
448
|
+
segmentTimecodeParsedEvent: {
|
|
449
|
+
fire: (detail: {
|
|
450
|
+
format: string;
|
|
451
|
+
input: string;
|
|
452
|
+
seconds: number | null;
|
|
453
|
+
}) => void;
|
|
454
|
+
onFired: (handler: (detail: {
|
|
455
|
+
format: string;
|
|
456
|
+
input: string;
|
|
457
|
+
seconds: number | null;
|
|
458
|
+
}) => void) => () => void;
|
|
459
|
+
};
|
|
460
|
+
segmentVisibilityChangeEvent: {
|
|
461
|
+
fire: (args: {
|
|
462
|
+
visible: boolean;
|
|
463
|
+
}) => void;
|
|
464
|
+
onFired: (handler: (args: {
|
|
465
|
+
visible: boolean;
|
|
466
|
+
}) => void) => () => void;
|
|
467
|
+
};
|
|
468
|
+
segmentsUnderPlayheadEvent: {
|
|
469
|
+
fire: (args: {
|
|
470
|
+
ids: string[];
|
|
471
|
+
}) => void;
|
|
472
|
+
onFired: (handler: (args: {
|
|
473
|
+
ids: string[];
|
|
474
|
+
}) => void) => () => void;
|
|
475
|
+
};
|
|
399
476
|
setTimeEvent: {
|
|
400
477
|
fire: (time: number) => void;
|
|
401
478
|
onFired: (handler: (time: number) => void) => () => void;
|
|
402
479
|
};
|
|
480
|
+
timeFormatChangeEvent: {
|
|
481
|
+
fire: (args: {
|
|
482
|
+
format: string;
|
|
483
|
+
}) => void;
|
|
484
|
+
onFired: (handler: (args: {
|
|
485
|
+
format: string;
|
|
486
|
+
}) => void) => () => void;
|
|
487
|
+
};
|
|
403
488
|
timeUpdateEvent: {
|
|
404
489
|
fire: (detail?: {
|
|
405
490
|
currentTime: number;
|
|
@@ -31,3 +31,10 @@ export declare function isValidFrameIndex(frameIndex: number, timestampsLength:
|
|
|
31
31
|
* @returns The timestamp if valid, null otherwise
|
|
32
32
|
*/
|
|
33
33
|
export declare function getCurrentFrameTimestamp(timestamps: number[], frameIndex: number): number | null;
|
|
34
|
+
/**
|
|
35
|
+
* Gets the time to seek to for a frame: a quarter frame in, since a seek to its exact start can land on the previous frame.
|
|
36
|
+
* @param frameStart - Start of the frame
|
|
37
|
+
* @param frameDuration - Duration of a single frame, in the unit of frameStart
|
|
38
|
+
* @returns The time to seek to
|
|
39
|
+
*/
|
|
40
|
+
export declare function getFrameSeekTime(frameStart: number, frameDuration: number): number;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TIMECODE_MODE } from '../constants';
|
|
2
|
+
/** Strict input grammar. Returns seconds, or null without seeking on invalid input. */
|
|
3
|
+
export declare function parseSegmentTime(input: string, mode: TIMECODE_MODE, frameRate: number, dropFrame: boolean): number | null;
|
|
4
|
+
export declare function formatSegmentTime(seconds: number, mode: TIMECODE_MODE, frameRate: number, dropFrame: boolean): string;
|
|
5
|
+
/** Clamps to the last frame and rounds to the nearest frame start, unless `roundToFrame` is false. */
|
|
6
|
+
export declare function clampSegmentTime(seconds: number, duration: number, frameRate: number, roundToFrame?: boolean): number;
|
|
7
|
+
/** Keeps the opposite edge fixed. Null means no valid frame exists at that boundary. */
|
|
8
|
+
export declare function clampSegmentEdge(seconds: number, opposite: number, from: boolean, duration: number, frameRate: number, roundToFrame?: boolean): number | null;
|
|
@@ -20,6 +20,7 @@ import { default as CxTabPanel } from '../../../../atoms/src/components/tab-pane
|
|
|
20
20
|
import { default as CxTooltip } from '../../../../atoms/src/components/tooltip/tooltip.ts';
|
|
21
21
|
import { default as CxTypography } from '../../../../atoms/src/components/typography/typography.ts';
|
|
22
22
|
import { default as CortexElement } from '../../../../base/src/cortex-element.ts';
|
|
23
|
+
import { VideoTimelineSegment, VideoPlayerVariant } from '../../../../types/src/video-advanced';
|
|
23
24
|
import { CSSResultGroup, PropertyValues } from 'lit';
|
|
24
25
|
import { EDIT_MODE } from '../react/constants';
|
|
25
26
|
import { Chapter } from '../react/plugins/Chapters';
|
|
@@ -28,6 +29,14 @@ import { default as CxVideoChaptersManager } from '../video-chapters-manager/vid
|
|
|
28
29
|
import { default as CxVideoEditor } from '../video-editor/video-editor';
|
|
29
30
|
/**
|
|
30
31
|
* @summary Video player with frame-accurate seeking, editor, annotations, and transcription.
|
|
32
|
+
* @event {{ id: string }} cx-video-segment-click - A timeline segment was selected; playback seeks to its start.
|
|
33
|
+
* @event {{ ids: string[] }} cx-video-segments-under-playhead - Matching segment IDs, ordered by start then input order.
|
|
34
|
+
* @event {{ startPosition: number; stopPosition: number }} cx-video-segment-create - A handle starts a draft; bounds use seconds.
|
|
35
|
+
* @event {{ open: boolean }} cx-video-segment-panel-change - Requests the consumer-owned segment panel.
|
|
36
|
+
* @event {{ visible: boolean }} cx-video-segment-visibility-change - Segment timeline visibility changed for this session.
|
|
37
|
+
* @event {{ format: string }} cx-video-time-format-change - User selected Standard, Frame, or SMPTE for this session.
|
|
38
|
+
* @event {{ format: string; input: string; seconds: number | null }} cx-video-segment-timecode-parsed - parseTimecode() result; seconds is null for invalid input.
|
|
39
|
+
* @event {{ format: string; seconds: number; text: string }} cx-video-segment-timecode-formatted - formatTimecode() result.
|
|
31
40
|
*
|
|
32
41
|
* @event cx-video-time-update - Fired on video time update.
|
|
33
42
|
* @event cx-video-seeked - Fired when the video has been seeked.
|
|
@@ -42,7 +51,7 @@ import { default as CxVideoEditor } from '../video-editor/video-editor';
|
|
|
42
51
|
* @event {{ id: string }} cx-video-comment-mouseleave - Fired when leaving a comment marker.
|
|
43
52
|
* @event {{ name: string; data: unknown }} cx-video-event - Generic player event bridge.
|
|
44
53
|
* @event {{ layer: HTMLElement | null }} cx-video-annotation-layer-change - Fired when the player (re)mounts its annotation layer div; hosts mount annotators into this element.
|
|
45
|
-
* @event {{ key: 'editMode' | 'enableAnnotation' | 'enableComment' | 'isCommentAnchorActive' | 'showCommentSidebar' | 'startPosition' | 'stopPosition'; value: boolean | number | string | null }} cx-video-context-change - Fired when the player UI changes one of these context values (toggles, or the segment selection); hosts sync their context cells from it.
|
|
54
|
+
* @event {{ key: 'activeTimelineSegmentId' | 'editMode' | 'enableAnnotation' | 'enableComment' | 'isCommentAnchorActive' | 'showCommentSidebar' | 'showSegmentSidebar' | 'startPosition' | 'stopPosition'; value: boolean | number | string | null }} cx-video-context-change - Fired when the player UI changes one of these context values (toggles, or the segment selection); hosts sync their context cells from it.
|
|
46
55
|
* @event cx-video-closed - Fired when the player is torn down.
|
|
47
56
|
* @event cx-video-editor-undo - Fired when the editor undo action is requested.
|
|
48
57
|
* @event cx-video-editor-redo - Fired when the editor redo action is requested.
|
|
@@ -90,6 +99,23 @@ export default class CxVideoAdvanced extends CortexElement {
|
|
|
90
99
|
static readonly styles: CSSResultGroup;
|
|
91
100
|
private readonly _extractFrameHandlers;
|
|
92
101
|
private readonly _ctx;
|
|
102
|
+
private segmentSession;
|
|
103
|
+
/** Source-asset markers after Type filtering, never after list search. @defaultValue [] */
|
|
104
|
+
timelineSegments: VideoTimelineSegment[];
|
|
105
|
+
/** Selected marker ID is retained even when the consumer filters it out. @defaultValue null */
|
|
106
|
+
activeTimelineSegmentId: string | null;
|
|
107
|
+
/** Consumer-owned panel visibility. Closing it cancels the segment draft. @defaultValue false */
|
|
108
|
+
showSegmentSidebar: boolean;
|
|
109
|
+
/** Account-specific display label; API terminology remains segments. @defaultValue 'Subclips' */
|
|
110
|
+
segmentLabel: string;
|
|
111
|
+
/** Show Subclips controls in the new UI. @defaultValue false */
|
|
112
|
+
enableSubclips: boolean;
|
|
113
|
+
/** Show the timeline handles that start a new segment; enable only for users allowed to create segments. @defaultValue false */
|
|
114
|
+
enableSegmentCreation: boolean;
|
|
115
|
+
/** Workspace configuration: hide segment markers by default. @defaultValue false */
|
|
116
|
+
noSegmentTimelineMarkers: boolean;
|
|
117
|
+
/** Explicit source metadata: SMPTE drop-frame numbering at 29.97/59.94 fps. @defaultValue false */
|
|
118
|
+
dropFrame: boolean;
|
|
93
119
|
private readonly ctxOutputUnsubscribes;
|
|
94
120
|
/** Required. Cortex API fetch function forwarded to the React player. */
|
|
95
121
|
fetchCortexApi: Context['fetchCortexApi'];
|
|
@@ -144,7 +170,10 @@ export default class CxVideoAdvanced extends CortexElement {
|
|
|
144
170
|
smallMode: boolean;
|
|
145
171
|
collabUI: boolean | undefined;
|
|
146
172
|
darkMode: boolean;
|
|
147
|
-
|
|
173
|
+
/** Hide the comment sidebar toolbar button while keeping the other collab controls. @defaultValue false */
|
|
174
|
+
hideCommentButton: boolean;
|
|
175
|
+
/** Player layout. Classic enables chapter editing and selected ranges; modern uses the redesigned controls. @defaultValue 'default' */
|
|
176
|
+
variant: VideoPlayerVariant;
|
|
148
177
|
annotationLayer: HTMLElement | null;
|
|
149
178
|
captionsURI: Caption;
|
|
150
179
|
chaptersList: Chapter[];
|
|
@@ -158,6 +187,20 @@ export default class CxVideoAdvanced extends CortexElement {
|
|
|
158
187
|
connectedCallback(): void;
|
|
159
188
|
disconnectedCallback(): void;
|
|
160
189
|
protected willUpdate(changed: PropertyValues): void;
|
|
190
|
+
/** Call when reopening the same asset in a reused instance. Resets transient UI choices. */
|
|
191
|
+
resetSegmentSession(): void;
|
|
192
|
+
/** Shares the player's strict input grammar with consumer-owned From/To fields. Also emits cx-video-segment-timecode-parsed. */
|
|
193
|
+
parseTimecode(input: string, format?: string): number | null;
|
|
194
|
+
/** Formats seconds for consumer-owned fields using the player's timecode rules. Also emits cx-video-segment-timecode-formatted. */
|
|
195
|
+
formatTimecode(seconds: number, format?: string): string;
|
|
196
|
+
/** Updates the draft's in-point without moving its out-point. */
|
|
197
|
+
setSegmentStart(seconds: number): void;
|
|
198
|
+
/** Updates the draft's out-point without moving its in-point. */
|
|
199
|
+
setSegmentEnd(seconds: number): void;
|
|
200
|
+
private updateSegmentEdge;
|
|
201
|
+
/** Consumer calls only after saving successfully. Failed saves leave the draft intact. */
|
|
202
|
+
completeSegmentCreation(): void;
|
|
203
|
+
private segmentConfig;
|
|
161
204
|
play(): void;
|
|
162
205
|
pause(): void;
|
|
163
206
|
setTime(time: number): void;
|
|
@@ -16,12 +16,12 @@ export default class StyleController {
|
|
|
16
16
|
name?: string | undefined;
|
|
17
17
|
value?: any;
|
|
18
18
|
id: string;
|
|
19
|
+
text?: string | undefined;
|
|
19
20
|
unit?: string | undefined;
|
|
20
21
|
attributes?: Record<string, any> | undefined;
|
|
21
22
|
default?: any;
|
|
22
23
|
max?: number | undefined;
|
|
23
24
|
min?: number | undefined;
|
|
24
|
-
text?: string | undefined;
|
|
25
25
|
placeholder?: string;
|
|
26
26
|
category?: (string | import('grapesjs').BlockCategoryProperties) | undefined;
|
|
27
27
|
step?: number | undefined;
|
|
@@ -9,4 +9,4 @@ import { Schema } from '@tiptap/pm/model';
|
|
|
9
9
|
* Constructs the model cannot represent are not dropped: `html_block` and `html_inline` hold their
|
|
10
10
|
* source verbatim and are replayed on the way out.
|
|
11
11
|
*/
|
|
12
|
-
export declare const markdownSchema: Schema<"image" | "
|
|
12
|
+
export declare const markdownSchema: Schema<"image" | "text" | "blockquote" | "table" | "heading" | "paragraph" | "frontmatter" | "doc" | "bullet_list" | "code_block" | "horizontal_rule" | "list_item" | "ordered_list" | "table_row" | "table_cell" | "table_header" | "hard_break" | "html_block" | "html_inline", "code" | "link" | "strike" | "em" | "strong">;
|
|
@@ -1,10 +1,39 @@
|
|
|
1
|
+
export declare enum VideoPlayerVariant {
|
|
2
|
+
Classic = "classic",
|
|
3
|
+
Default = "default",
|
|
4
|
+
Modern = "modern"
|
|
5
|
+
}
|
|
1
6
|
export declare enum VideoContextOutputKey {
|
|
7
|
+
ActiveTimelineSegmentId = "activeTimelineSegmentId",
|
|
2
8
|
AnnotationLayer = "annotationLayer",
|
|
3
9
|
EditMode = "editMode",
|
|
4
10
|
EnableAnnotation = "enableAnnotation",
|
|
5
11
|
EnableComment = "enableComment",
|
|
6
12
|
IsCommentAnchorActive = "isCommentAnchorActive",
|
|
7
13
|
ShowCommentSidebar = "showCommentSidebar",
|
|
14
|
+
ShowSegmentSidebar = "showSegmentSidebar",
|
|
8
15
|
StartPosition = "startPosition",
|
|
9
16
|
StopPosition = "stopPosition"
|
|
10
17
|
}
|
|
18
|
+
/** Segments on the source asset, independent of video-editor clips. Times are seconds. */
|
|
19
|
+
export interface VideoTimelineSegment {
|
|
20
|
+
color?: string;
|
|
21
|
+
end: number;
|
|
22
|
+
id: string;
|
|
23
|
+
label: string;
|
|
24
|
+
start: number;
|
|
25
|
+
typeId?: string;
|
|
26
|
+
}
|
|
27
|
+
/** Consumer-owned inputs; visibility/format choices are local to a view session. */
|
|
28
|
+
export interface VideoSegmentUIConfig {
|
|
29
|
+
activeId: string | null;
|
|
30
|
+
dropFrame: boolean;
|
|
31
|
+
enableSegmentCreation?: boolean;
|
|
32
|
+
enableSubclips?: boolean;
|
|
33
|
+
enabled: boolean;
|
|
34
|
+
label: string;
|
|
35
|
+
panelOpen: boolean;
|
|
36
|
+
segments: VideoTimelineSegment[];
|
|
37
|
+
session: number;
|
|
38
|
+
timecodeMode: string;
|
|
39
|
+
}
|
|
@@ -11276,6 +11276,34 @@
|
|
|
11276
11276
|
*/
|
|
11277
11277
|
interface CxVideoAdvancedAttributes extends HTMLAttributes<CxVideoAdvanced> {
|
|
11278
11278
|
|
|
11279
|
+
/**
|
|
11280
|
+
* Selected marker ID is retained even when the consumer filters it out. @defaultValue null
|
|
11281
|
+
*/
|
|
11282
|
+
activeTimelineSegmentId?: string;
|
|
11283
|
+
/**
|
|
11284
|
+
* Consumer-owned panel visibility. Closing it cancels the segment draft. @defaultValue false
|
|
11285
|
+
*/
|
|
11286
|
+
showSegmentSidebar?: boolean;
|
|
11287
|
+
/**
|
|
11288
|
+
* Account-specific display label; API terminology remains segments. @defaultValue 'Subclips'
|
|
11289
|
+
*/
|
|
11290
|
+
segmentLabel?: string;
|
|
11291
|
+
/**
|
|
11292
|
+
* Show Subclips controls in the new UI. @defaultValue false
|
|
11293
|
+
*/
|
|
11294
|
+
enableSubclips?: boolean;
|
|
11295
|
+
/**
|
|
11296
|
+
* Show the timeline handles that start a new segment; enable only for users allowed to create segments. @defaultValue false
|
|
11297
|
+
*/
|
|
11298
|
+
enableSegmentCreation?: boolean;
|
|
11299
|
+
/**
|
|
11300
|
+
* Workspace configuration: hide segment markers by default. @defaultValue false
|
|
11301
|
+
*/
|
|
11302
|
+
noSegmentTimelineMarkers?: boolean;
|
|
11303
|
+
/**
|
|
11304
|
+
* Explicit source metadata: SMPTE drop-frame numbering at 29.97/59.94 fps. @defaultValue false
|
|
11305
|
+
*/
|
|
11306
|
+
dropFrame?: boolean;
|
|
11279
11307
|
/**
|
|
11280
11308
|
* — strings —
|
|
11281
11309
|
*/
|
|
@@ -11449,9 +11477,13 @@
|
|
|
11449
11477
|
*/
|
|
11450
11478
|
darkMode?: boolean;
|
|
11451
11479
|
/**
|
|
11452
|
-
*
|
|
11480
|
+
* Hide the comment sidebar toolbar button while keeping the other collab controls. @defaultValue false
|
|
11481
|
+
*/
|
|
11482
|
+
hideCommentButton?: boolean;
|
|
11483
|
+
/**
|
|
11484
|
+
* Player layout. Classic enables chapter editing and selected ranges; modern uses the redesigned controls. @defaultValue 'default'
|
|
11453
11485
|
*/
|
|
11454
|
-
|
|
11486
|
+
variant?: "classic" | "default" | "modern";
|
|
11455
11487
|
/**
|
|
11456
11488
|
*
|
|
11457
11489
|
*/
|