@playkit-js/transcript 3.5.29 → 3.5.30-canary.0-ae564b8
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/package.json
CHANGED
|
@@ -20,6 +20,7 @@ export interface CaptionProps {
|
|
|
20
20
|
player?: any;
|
|
21
21
|
captionLabel?: string;
|
|
22
22
|
moveToSearch?: string;
|
|
23
|
+
navigationInstruction?: string
|
|
23
24
|
setTextToRead: (textToRead: string, delay?: number) => void;
|
|
24
25
|
}
|
|
25
26
|
|
|
@@ -37,7 +38,8 @@ interface ExtendedCaptionProps extends CaptionProps {
|
|
|
37
38
|
|
|
38
39
|
const translates = {
|
|
39
40
|
captionLabel: <Text id="transcript.caption_label">Jump to this point in video</Text>,
|
|
40
|
-
moveToSearch: <Text id="transcript.move_to_search">Click to jump to search result</Text
|
|
41
|
+
moveToSearch: <Text id="transcript.move_to_search">Click to jump to search result</Text>,
|
|
42
|
+
navigationInstruction: <Text id="transcript.navigation_instruction">Press Home to navigate to the beginning of the transcript. Press End to jump to the end of the transcript.</Text>
|
|
41
43
|
};
|
|
42
44
|
|
|
43
45
|
@withText(translates)
|
|
@@ -143,7 +145,7 @@ export class Caption extends Component<ExtendedCaptionProps> {
|
|
|
143
145
|
};
|
|
144
146
|
|
|
145
147
|
render() {
|
|
146
|
-
const {caption, highlighted, showTime, longerThanHour, indexMap, captionLabel, moveToSearch} = this.props;
|
|
148
|
+
const {caption, highlighted, showTime, longerThanHour, indexMap, captionLabel, moveToSearch, navigationInstruction} = this.props;
|
|
147
149
|
const {startTime, id} = caption;
|
|
148
150
|
const isHighlighted = Object.keys(highlighted).some(c => c === id);
|
|
149
151
|
const time = showTime ? secondsToTime(startTime, longerThanHour) : '';
|
|
@@ -151,7 +153,7 @@ export class Caption extends Component<ExtendedCaptionProps> {
|
|
|
151
153
|
const captionA11yProps: Record<string, any> = {
|
|
152
154
|
ariaCurrent: isHighlighted,
|
|
153
155
|
tabIndex: 0,
|
|
154
|
-
ariaLabel: `${time}${showTime ? ' ' : ''}${caption.text} ${indexMap ? moveToSearch : captionLabel}`,
|
|
156
|
+
ariaLabel: `${time}${showTime ? ' ' : ''}${caption.text} ${indexMap ? moveToSearch : captionLabel}. ${navigationInstruction}`,
|
|
155
157
|
role: 'button'
|
|
156
158
|
};
|
|
157
159
|
|
|
@@ -98,9 +98,9 @@ export class CaptionList extends Component<Props> {
|
|
|
98
98
|
|
|
99
99
|
private _handleKeyUp = (event: KeyboardEvent) => {
|
|
100
100
|
if (event.keyCode === END) {
|
|
101
|
-
this._lastCaptionRef?.
|
|
101
|
+
this._lastCaptionRef?.base.focus();
|
|
102
102
|
} else if (event.keyCode === HOME) {
|
|
103
|
-
this._firstCaptionRef?.
|
|
103
|
+
this._firstCaptionRef?.base.focus();
|
|
104
104
|
}
|
|
105
105
|
};
|
|
106
106
|
|
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
"caption_label": "Jump to this point in video",
|
|
26
26
|
"move_to_search": "Click to jump to search result",
|
|
27
27
|
"to_search_result": "Go to result",
|
|
28
|
-
"to_search_result_label": "Click to jump to this point in the video"
|
|
28
|
+
"to_search_result_label": "Click to jump to this point in the video",
|
|
29
|
+
"navigation_instruction": "Press Home to navigate to the beginning of the transcript. Press End to jump to the end of the transcript."
|
|
29
30
|
}
|
|
30
31
|
}
|
|
31
32
|
}
|