@playkit-js/playkit-js-ui 0.78.2 → 0.78.3-canary.0-e60bd00
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/dist/playkit-js-ui.d.ts +32 -20
- package/dist/playkit-ui.js +1 -1
- package/dist/playkit-ui.js.map +1 -1
- package/package.json +1 -1
- package/src/components/cvaa-overlay/_cvaa-overlay.scss +1 -0
- package/src/components/cvaa-overlay/custom-captions-window.tsx +13 -0
- package/src/components/seekbar/seekbar.tsx +3 -2
- package/src/reducers/seekbar.ts +35 -14
- package/src/types/reducers/seekbar.ts +1 -0
- package/translations/en.i18n.json +1 -0
package/package.json
CHANGED
|
@@ -100,6 +100,11 @@ class CustomCaptionsWindow extends Component<any, any> {
|
|
|
100
100
|
active: props.customTextStyle.backgroundColor.every((value, index) => value === standardColors[key][index])
|
|
101
101
|
}));
|
|
102
102
|
|
|
103
|
+
const fontAlignmentOption = player.TextStyle.FontAlignment.map(fontAlignment => ({
|
|
104
|
+
...fontAlignment,
|
|
105
|
+
active: props.customTextStyle.textAlign === fontAlignment.value
|
|
106
|
+
}));
|
|
107
|
+
|
|
103
108
|
return (
|
|
104
109
|
<div className={[style.overlayScreen, style.active].join(' ')}>
|
|
105
110
|
<form className={[style.form, style.customCaptionForm].join(' ')}>
|
|
@@ -111,6 +116,14 @@ class CustomCaptionsWindow extends Component<any, any> {
|
|
|
111
116
|
styleName="fontSize"
|
|
112
117
|
changeCustomStyle={props.changeCustomStyle}
|
|
113
118
|
/>
|
|
119
|
+
<DropDownCaptionsStyle
|
|
120
|
+
addAccessibleChild={props.addAccessibleChild}
|
|
121
|
+
labelId="cvaa.font_alignment_label"
|
|
122
|
+
options={fontAlignmentOption}
|
|
123
|
+
classNames={[style.formGroupRow, style.fontAlignment]}
|
|
124
|
+
styleName="textAlign"
|
|
125
|
+
changeCustomStyle={props.changeCustomStyle}
|
|
126
|
+
/>
|
|
114
127
|
<DropDownCaptionsStyle
|
|
115
128
|
addAccessibleChild={props.addAccessibleChild}
|
|
116
129
|
labelId="cvaa.font_color_label"
|
|
@@ -27,7 +27,8 @@ const mapStateToProps = state => ({
|
|
|
27
27
|
previewHoverActive: state.seekbar.previewHoverActive,
|
|
28
28
|
hidePreview: state.seekbar.hidePreview,
|
|
29
29
|
hideTimeBubble: state.seekbar.hideTimeBubble,
|
|
30
|
-
segments: state.seekbar.segments
|
|
30
|
+
segments: state.seekbar.segments,
|
|
31
|
+
seekbarClasses: state.seekbar.seekbarClasses
|
|
31
32
|
});
|
|
32
33
|
|
|
33
34
|
const COMPONENT_NAME = 'SeekBar';
|
|
@@ -547,7 +548,7 @@ class SeekBar extends Component<any, any> {
|
|
|
547
548
|
render(props: any, state: any): VNode<any> {
|
|
548
549
|
const virtualProgressWidth = `${(props.virtualTime / props.duration) * 100}%`;
|
|
549
550
|
const scrubberProgressPosition = `${(props.currentTime / props.duration) * this._seekBarElement?.clientWidth}px`;
|
|
550
|
-
const seekbarStyleClass = [style.seekBar];
|
|
551
|
+
const seekbarStyleClass = [style.seekBar, ...props.seekbarClasses];
|
|
551
552
|
if (props.adBreak) seekbarStyleClass.push(style.adBreak);
|
|
552
553
|
if (props.isDvr) seekbarStyleClass.push(style.live);
|
|
553
554
|
if (props.isMobile) seekbarStyleClass.push(style.hover);
|
package/src/reducers/seekbar.ts
CHANGED
|
@@ -1,21 +1,25 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
|
2
2
|
import {SeekbarState} from '../types/reducers/seekbar';
|
|
3
3
|
|
|
4
|
+
const entityName = 'seekbar';
|
|
5
|
+
|
|
4
6
|
export const types = {
|
|
5
|
-
UPDATE_SEEKBAR_DRAGGING_STATUS:
|
|
6
|
-
UPDATE_SEEKBAR_HOVER_ACTIVE:
|
|
7
|
-
UPDATE_SEEKBAR_PREVIEW_HOVER_ACTIVE:
|
|
8
|
-
UPDATE_SEEKBAR_CLIENT_RECT:
|
|
9
|
-
UPDATE_HIDE_SEEKBAR_PREVIEW:
|
|
10
|
-
UPDATE_HIDE_SEEKBAR_TIME_BUBBLE:
|
|
11
|
-
UPDATE_CURRENT_TIME:
|
|
12
|
-
UPDATE_VIRTUAL_TIME:
|
|
13
|
-
UPDATE_HOVERED_SEGMENT:
|
|
14
|
-
UPDATE_SEEKBAR_SEGMENTS:
|
|
15
|
-
UPDATE_SEGMENT_END_TIME:
|
|
7
|
+
UPDATE_SEEKBAR_DRAGGING_STATUS: `${entityName}/UPDATE_SEEKBAR_DRAGGING_STATUS`,
|
|
8
|
+
UPDATE_SEEKBAR_HOVER_ACTIVE: `${entityName}/UPDATE_SEEKBAR_HOVER_ACTIVE`,
|
|
9
|
+
UPDATE_SEEKBAR_PREVIEW_HOVER_ACTIVE: `${entityName}/UPDATE_SEEKBAR_PREVIEW_HOVER_ACTIVE`,
|
|
10
|
+
UPDATE_SEEKBAR_CLIENT_RECT: `${entityName}/UPDATE_SEEKBAR_CLIENT_RECT`,
|
|
11
|
+
UPDATE_HIDE_SEEKBAR_PREVIEW: `${entityName}/UPDATE_HIDE_SEEKBAR_PREVIEW`,
|
|
12
|
+
UPDATE_HIDE_SEEKBAR_TIME_BUBBLE: `${entityName}/UPDATE_HIDE_SEEKBAR_TIME_BUBBLE`,
|
|
13
|
+
UPDATE_CURRENT_TIME: `${entityName}/UPDATE_CURRENT_TIME`,
|
|
14
|
+
UPDATE_VIRTUAL_TIME: `${entityName}/UPDATE_VIRTUAL_TIME`,
|
|
15
|
+
UPDATE_HOVERED_SEGMENT: `${entityName}/UPDATE_HOVERED_SEGMENT`,
|
|
16
|
+
UPDATE_SEEKBAR_SEGMENTS: `${entityName}/UPDATE_SEEKBAR_SEGMENTS`,
|
|
17
|
+
UPDATE_SEGMENT_END_TIME: `${entityName}/UPDATE_SEGMENT_END_TIME`,
|
|
18
|
+
ADD_SEEKBAR_CLASS: `${entityName}/ADD_SEEKBAR_CLASS`,
|
|
19
|
+
REMOVE_SEEKBAR_CLASS: `${entityName}/REMOVE_SEEKBAR_CLASS`
|
|
16
20
|
};
|
|
17
21
|
|
|
18
|
-
export const initialState = {
|
|
22
|
+
export const initialState: SeekbarState = {
|
|
19
23
|
currentTime: 0,
|
|
20
24
|
virtualTime: 0,
|
|
21
25
|
draggingActive: false,
|
|
@@ -24,7 +28,8 @@ export const initialState = {
|
|
|
24
28
|
clientRect: {x: 0, y: 0, width: 0, height: 0, top: 0, right: 0, bottom: 0, left: 0},
|
|
25
29
|
hidePreview: false,
|
|
26
30
|
hideTimeBubble: false,
|
|
27
|
-
segments: []
|
|
31
|
+
segments: [],
|
|
32
|
+
seekbarClasses: []
|
|
28
33
|
};
|
|
29
34
|
|
|
30
35
|
export default (state: SeekbarState = initialState, action: any) => {
|
|
@@ -95,6 +100,20 @@ export default (state: SeekbarState = initialState, action: any) => {
|
|
|
95
100
|
segments: state.segments.map(segment => (segment.id === action.id ? {...segment, endTime: action.endTime} : segment))
|
|
96
101
|
};
|
|
97
102
|
|
|
103
|
+
case types.ADD_SEEKBAR_CLASS:
|
|
104
|
+
if (state.seekbarClasses.includes(action.className)) {
|
|
105
|
+
return state;
|
|
106
|
+
}
|
|
107
|
+
return {
|
|
108
|
+
...state,
|
|
109
|
+
seekbarClasses: [...state.seekbarClasses, action.className]
|
|
110
|
+
};
|
|
111
|
+
case types.REMOVE_SEEKBAR_CLASS:
|
|
112
|
+
return {
|
|
113
|
+
...state,
|
|
114
|
+
seekbarClasses: state.seekbarClasses.filter(c => c !== action.className)
|
|
115
|
+
};
|
|
116
|
+
|
|
98
117
|
default:
|
|
99
118
|
return state;
|
|
100
119
|
}
|
|
@@ -126,5 +145,7 @@ export const actions = {
|
|
|
126
145
|
updateVirtualTime: (virtualTime: number) => ({type: types.UPDATE_VIRTUAL_TIME, virtualTime}),
|
|
127
146
|
updateHoveredSegment: (id: string, isHovered: boolean) => ({type: types.UPDATE_HOVERED_SEGMENT, id, isHovered}),
|
|
128
147
|
updateSegmentEndTime: (id: string, endTime: number) => ({type: types.UPDATE_SEGMENT_END_TIME, id, endTime}),
|
|
129
|
-
updateSeekbarSegments: (segments: any[]) => ({type: types.UPDATE_SEEKBAR_SEGMENTS, segments})
|
|
148
|
+
updateSeekbarSegments: (segments: any[]) => ({type: types.UPDATE_SEEKBAR_SEGMENTS, segments}),
|
|
149
|
+
addSeekbarClass: (className: string) => ({type: types.ADD_SEEKBAR_CLASS, className}),
|
|
150
|
+
removeSeekbarClass: (className: string) => ({type: types.REMOVE_SEEKBAR_CLASS, className})
|
|
130
151
|
} as const;
|