/
uiconfig.ts
103 lines (100 loc) · 3.82 KB
/
uiconfig.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
import { ErrorMessageMap, ErrorMessageTranslator } from './components/errormessageoverlay';
export interface UIRecommendationConfig {
title: string;
url: string;
thumbnail?: string;
duration?: number;
}
/**
* Marks a position on the playback timeline, e.g. a chapter or an ad break.
*/
export interface TimelineMarker {
/**
* The time in the playback timeline (e.g. {@link SeekBar}) that should be marked.
*/
time: number;
/**
* Optional duration that makes the marker mark an interval instead of a single moment in time.
*/
duration?: number;
/**
* Optional title text of the marked position, e.g. a chapter name.
* Will be rendered in the {@link SeekBarLabel} attached to a {@link SeekBar}.
*/
title?: string;
/**
* Url to timeline marker image
* Prefered small image sizes (~50px) with aspect ratio of 1:1
* Best performing with SVG format
*/
imageUrl?: string;
/**
* Optional CSS classes that are applied to the marker on a {@link SeekBar} and can be used to
* differentiate different types of markers by their style (e.g. different color of chapter markers
* and ad break markers).
* The CSS classes are also propagated to a connected {@link SeekBarLabel}.
*
* Multiple classes can be added to allow grouping of markers into types (e.g. chapter markers,
* ad break markers) by a shared class and still identify and style each marker with distinct
* classes (e.g. `['marker-type-chapter', 'chapter-number-1']`).
*/
cssClasses?: string[];
}
export interface UIConfig {
/**
* Specifies the container in the DOM into which the UI will be added. Can be a CSS selector string or a
* HTMLElement object. By default, the player container will be used ({@link PlayerAPI#getContainer}).
*/
container?: string | HTMLElement;
metadata?: {
title?: string;
description?: string;
markers?: TimelineMarker[];
};
// TODO move recommendations into metadata in next major release
recommendations?: UIRecommendationConfig[];
/**
* Specifies if the UI variants should be resolved and switched automatically upon certain player events. The default
* is `true`. Should be set to `false` if purely manual switching through {@link UIManager.resolveUiVariant} is
* desired. A hybrid approach can be used by setting this to `true` (or leaving the default) and overriding
* automatic switches through a {@link UIManager.onUiVariantResolve} event handler.
*/
autoUiVariantResolve?: boolean;
/**
* Specifies if the `PlaybackSpeedSelectBox` should be displayed within the `SettingsPanel`
* Default: true
*/
playbackSpeedSelectionEnabled?: boolean;
/**
* Specifies if the player controls including `SettingsPanel` should auto hide when still hovered. This
* configuration does not apply to mobile platforms. On mobile platforms the `SettingsPanel` is by default
* configured to not auto-hide and the behaviour cannot be changed using this configuration.
* Default: false
*/
disableAutoHideWhenHovered?: boolean;
/**
* Specifies the seekbar snapping range in percentage
* Default: 1
*/
seekbarSnappingRange?: number;
/**
* Provide customized errorMessages
* For an example have a look at {@link ErrorMessageOverlayConfig.messages}
*/
errorMessages?: ErrorMessageMap | ErrorMessageTranslator;
/**
* Toggles the seek preview feature.
* Default: true
*/
enableSeekPreview?: boolean;
/**
* Specifies if the player should enter fullscreen by clicking on the `PlaybackToggleButton`,
* `HugePlaybackToggleButton`, or `PlaybackToggleOverlay` when attempting the initial playback start.
* Default: false
*/
enterFullscreenOnInitialPlayback?: boolean;
/**
* Forces subtitle-labels back into their respective container if they overflow and are therefore cropped.
*/
forceSubtitlesIntoViewContainer?: boolean;
}