@playkit-js/transcript 3.4.5-canary.0-c7945a6 → 3.4.5
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/CHANGELOG.md +1 -6
- package/dist/playkit-transcript.js +1 -1
- package/dist/playkit-transcript.js.map +1 -1
- package/package.json +2 -2
- package/src/components/autoscroll-button/AutoScrollIcon.tsx +15 -0
- package/src/components/autoscroll-button/autoscroll-button.scss +5 -0
- package/src/components/autoscroll-button/autoscroll-button.tsx +12 -10
- package/src/components/caption/caption.scss +1 -1
- package/src/components/caption/caption.tsx +39 -16
- package/src/components/transcript/transcript.tsx +18 -35
- package/src/transcript-plugin.tsx +0 -1
- package/src/utils/utils.ts +1 -1
- package/translations/en.i18n.json +1 -3
- package/src/components/small-screen-slate/index.ts +0 -1
- package/src/components/small-screen-slate/small-screen-slate.scss +0 -28
- package/src/components/small-screen-slate/small-screen-slate.tsx +0 -70
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@playkit-js/transcript",
|
|
3
|
-
"version": "3.4.5
|
|
3
|
+
"version": "3.4.5",
|
|
4
4
|
"main": "dist/playkit-transcript.js",
|
|
5
5
|
"license": "AGPL-3.0",
|
|
6
6
|
"private": false,
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"html5 player"
|
|
75
75
|
],
|
|
76
76
|
"dependencies": {
|
|
77
|
-
"@playkit-js/common": "^1.2.
|
|
77
|
+
"@playkit-js/common": "^1.2.10",
|
|
78
78
|
"@playkit-js/playkit-js-ui": "^0.77.3",
|
|
79
79
|
"@playkit-js/ui-managers": "^1.3.11",
|
|
80
80
|
"stream-browserify": "^3.0.0"
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { h } from 'preact';
|
|
2
|
+
|
|
3
|
+
export const AutoScrollIcon = () => (
|
|
4
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
5
|
+
<path
|
|
6
|
+
d="M6.29289 15.2929C6.65338 14.9324 7.22061 14.9047 7.6129 15.2097L7.70711 15.2929L12 19.585L16.2929 15.2929C16.6534 14.9324 17.2206 14.9047 17.6129 15.2097L17.7071 15.2929C18.0676 15.6534 18.0953 16.2206 17.7903 16.6129L17.7071 16.7071L12.7071 21.7071C12.3466 22.0676 11.7794 22.0953 11.3871 21.7903L11.2929 21.7071L6.29289 16.7071C5.90237 16.3166 5.90237 15.6834 6.29289 15.2929Z"
|
|
7
|
+
fill="white"
|
|
8
|
+
/>
|
|
9
|
+
<path
|
|
10
|
+
d="M17.7071 8.70711C17.3466 9.06759 16.7794 9.09532 16.3871 8.7903L16.2929 8.70711L12 4.415L7.70711 8.70711C7.34662 9.06759 6.77939 9.09532 6.3871 8.79029L6.29289 8.70711C5.93241 8.34662 5.90468 7.77939 6.2097 7.3871L6.29289 7.29289L11.2929 2.29289C11.6534 1.93241 12.2206 1.90468 12.6129 2.2097L12.7071 2.29289L17.7071 7.29289C18.0976 7.68342 18.0976 8.31658 17.7071 8.70711Z"
|
|
11
|
+
fill="white"
|
|
12
|
+
/>
|
|
13
|
+
<rect x="10" y="10" width="4" height="4" rx="2" fill="white" />
|
|
14
|
+
</svg>
|
|
15
|
+
);
|
|
@@ -11,6 +11,11 @@
|
|
|
11
11
|
|
|
12
12
|
.autoscroll-button {
|
|
13
13
|
opacity: 0;
|
|
14
|
+
border-radius: $roundness-1;
|
|
15
|
+
border: none;
|
|
16
|
+
box-shadow: 0px 1px 0.75px rgba(0, 0, 0, 0.42), 0px 1px 0.5px rgba(0, 0, 0, 0.25), 0px 2px 3px rgba(0, 0, 0, 0.2);
|
|
17
|
+
background-color: $primary-darker-color;
|
|
18
|
+
cursor: pointer;
|
|
14
19
|
z-index: 1;
|
|
15
20
|
&.autoscroll-button-visible {
|
|
16
21
|
opacity: 1;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import {h} from 'preact';
|
|
2
2
|
import * as styles from './autoscroll-button.scss';
|
|
3
|
-
import {OnClick} from '@playkit-js/common/dist/hoc/a11y-wrapper';
|
|
4
|
-
import {
|
|
3
|
+
import {A11yWrapper, OnClick} from '@playkit-js/common/dist/hoc/a11y-wrapper';
|
|
4
|
+
import {AutoScrollIcon} from "./AutoScrollIcon";
|
|
5
5
|
|
|
6
6
|
const {withText, Text} = KalturaPlayer.ui.preacti18n;
|
|
7
|
+
const {Tooltip} = KalturaPlayer.ui.components;
|
|
7
8
|
|
|
8
9
|
interface AutoscrollButtonProps {
|
|
9
10
|
onClick: OnClick;
|
|
@@ -20,14 +21,15 @@ export const AutoscrollButton = withText(translates)(
|
|
|
20
21
|
({onClick, isAutoScrollEnabled, setAutoscrollButtonRef, autoScrollLabel}: AutoscrollButtonProps) => {
|
|
21
22
|
return (
|
|
22
23
|
<div className={styles.autoscrollRoot} tabIndex={isAutoScrollEnabled ? -1 : 1} aria-label={autoScrollLabel}>
|
|
23
|
-
<
|
|
24
|
-
onClick={onClick}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
<Tooltip label={autoScrollLabel} type="left">
|
|
25
|
+
<A11yWrapper onClick={onClick}>
|
|
26
|
+
<button
|
|
27
|
+
className={`${styles.autoscrollButton} ${isAutoScrollEnabled ? '' : styles.autoscrollButtonVisible}`}
|
|
28
|
+
ref={setAutoscrollButtonRef}>
|
|
29
|
+
<AutoScrollIcon/>
|
|
30
|
+
</button>
|
|
31
|
+
</A11yWrapper>
|
|
32
|
+
</Tooltip>
|
|
31
33
|
</div>
|
|
32
34
|
);
|
|
33
35
|
}
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
margin-bottom: 9px;
|
|
8
8
|
margin-left: 8px;
|
|
9
9
|
color: $tone-1-color;
|
|
10
|
-
cursor: pointer;
|
|
11
10
|
.caption-time {
|
|
12
11
|
flex-shrink: 1;
|
|
13
12
|
min-width: 48px;
|
|
@@ -49,6 +48,7 @@
|
|
|
49
48
|
user-select: text;
|
|
50
49
|
-ms-user-select: text;
|
|
51
50
|
border-radius: 2px;
|
|
51
|
+
cursor: pointer;
|
|
52
52
|
&::selection {
|
|
53
53
|
background-color: $primary-brighter-color;
|
|
54
54
|
padding: 0 2px;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {Component, h} from 'preact';
|
|
2
2
|
import {A11yWrapper, OnClickEvent} from '@playkit-js/common/dist/hoc/a11y-wrapper';
|
|
3
|
-
import {
|
|
3
|
+
import {secontsToTime} from '../../utils';
|
|
4
4
|
import {CuePointData} from '../../types';
|
|
5
5
|
import * as styles from './caption.scss';
|
|
6
6
|
|
|
@@ -24,9 +24,15 @@ interface ExtendedCaptionProps extends CaptionProps {
|
|
|
24
24
|
isAutoScrollEnabled: boolean;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
interface CaptionState {
|
|
28
|
+
focused: boolean;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export class Caption extends Component<ExtendedCaptionProps, CaptionState> {
|
|
28
32
|
private _hotspotRef: HTMLElement | null = null;
|
|
29
33
|
|
|
34
|
+
state = {focused: false};
|
|
35
|
+
|
|
30
36
|
componentDidUpdate() {
|
|
31
37
|
if (this._hotspotRef && this.props.shouldScroll) {
|
|
32
38
|
this.props.scrollTo(this._hotspotRef);
|
|
@@ -35,12 +41,12 @@ export class Caption extends Component<ExtendedCaptionProps> {
|
|
|
35
41
|
}
|
|
36
42
|
}
|
|
37
43
|
|
|
38
|
-
shouldComponentUpdate(nextProps: ExtendedCaptionProps) {
|
|
39
|
-
const {indexMap, highlighted, isAutoScrollEnabled, activeSearchIndex, longerThanHour} = this.props;
|
|
44
|
+
shouldComponentUpdate(nextProps: ExtendedCaptionProps, nextState: CaptionState) {
|
|
45
|
+
const {indexMap, highlighted, isAutoScrollEnabled, activeSearchIndex, longerThanHour, caption} = this.props;
|
|
40
46
|
if (longerThanHour !== nextProps.longerThanHour) {
|
|
41
47
|
return true;
|
|
42
48
|
}
|
|
43
|
-
if (highlighted !== nextProps.highlighted) {
|
|
49
|
+
if (highlighted !== nextProps.highlighted || this.state.focused !== nextState.focused) {
|
|
44
50
|
return true;
|
|
45
51
|
}
|
|
46
52
|
if (highlighted && isAutoScrollEnabled !== nextProps.isAutoScrollEnabled) {
|
|
@@ -55,7 +61,16 @@ export class Caption extends Component<ExtendedCaptionProps> {
|
|
|
55
61
|
return false;
|
|
56
62
|
}
|
|
57
63
|
|
|
58
|
-
private
|
|
64
|
+
private _handleKeyDown = (event: OnClickEvent, byKeyboard?: boolean) => {
|
|
65
|
+
if (byKeyboard) {
|
|
66
|
+
event.preventDefault();
|
|
67
|
+
this._gotoCurrentTime();
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
private _handleClick = (event: MouseEvent) => {
|
|
72
|
+
event.stopPropagation();
|
|
73
|
+
this._hotspotRef?.focus();
|
|
59
74
|
this._gotoCurrentTime();
|
|
60
75
|
};
|
|
61
76
|
|
|
@@ -98,34 +113,42 @@ export class Caption extends Component<ExtendedCaptionProps> {
|
|
|
98
113
|
);
|
|
99
114
|
};
|
|
100
115
|
|
|
116
|
+
private _handleFocus = () => {
|
|
117
|
+
this.setState({
|
|
118
|
+
focused: true
|
|
119
|
+
});
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
private _handleBlur = () => {
|
|
123
|
+
this.setState({
|
|
124
|
+
focused: false
|
|
125
|
+
});
|
|
126
|
+
};
|
|
127
|
+
|
|
101
128
|
render() {
|
|
102
129
|
const {caption, highlighted, showTime, longerThanHour} = this.props;
|
|
103
130
|
const {startTime, id} = caption;
|
|
104
131
|
const isHighlighted = Object.keys(highlighted)[0] === id;
|
|
105
|
-
const time = showTime ? secondsToTime(startTime, longerThanHour) : '';
|
|
106
132
|
|
|
107
133
|
const captionA11yProps: Record<string, any> = {
|
|
108
134
|
ariaCurrent: isHighlighted,
|
|
135
|
+
onFocus: this._handleFocus,
|
|
136
|
+
onBlur: this._handleBlur,
|
|
109
137
|
tabIndex: 0,
|
|
110
|
-
|
|
111
|
-
role: 'button'
|
|
138
|
+
ariaHidden: !(isHighlighted || this.state.focused)
|
|
112
139
|
};
|
|
113
140
|
|
|
114
141
|
return (
|
|
115
|
-
<A11yWrapper onClick={this.
|
|
142
|
+
<A11yWrapper onClick={this._handleKeyDown} role={isHighlighted ? 'text' : 'listitem'}>
|
|
116
143
|
<div
|
|
117
144
|
className={styles.caption}
|
|
118
145
|
ref={node => {
|
|
119
146
|
this._hotspotRef = node;
|
|
120
147
|
}}
|
|
121
148
|
{...captionA11yProps}>
|
|
122
|
-
{showTime && (
|
|
123
|
-
<div className={styles.captionTime} aria-hidden="true">
|
|
124
|
-
{time}
|
|
125
|
-
</div>
|
|
126
|
-
)}
|
|
149
|
+
{showTime && <div className={styles.captionTime}>{secontsToTime(startTime, longerThanHour)}</div>}
|
|
127
150
|
<div
|
|
128
|
-
|
|
151
|
+
onClick={this._handleClick}
|
|
129
152
|
className={`${styles.captionContent} ${isHighlighted ? styles.highlighted : ''} ${showTime ? '' : styles.withoutTime}`}>
|
|
130
153
|
{this._renderText(caption.text)}
|
|
131
154
|
</div>
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import {h, Component} from 'preact';
|
|
2
|
-
import {ui} from '@playkit-js/kaltura-player-js';
|
|
3
2
|
import {debounce} from '../../utils';
|
|
4
3
|
import * as styles from './transcript.scss';
|
|
5
4
|
import {Spinner} from '../spinner';
|
|
@@ -9,16 +8,12 @@ import {HighlightedMap, CuePointData} from '../../types';
|
|
|
9
8
|
import {ErrorIcon} from './error-icon';
|
|
10
9
|
import {AutoscrollButton} from '../autoscroll-button';
|
|
11
10
|
import {TranscriptMenu} from '../transcript-menu';
|
|
12
|
-
|
|
11
|
+
|
|
13
12
|
import {Button, ButtonType, ButtonSize} from '@playkit-js/common/dist/components/button';
|
|
14
13
|
import {OnClickEvent, OnClick} from '@playkit-js/common/dist/hoc/a11y-wrapper';
|
|
15
14
|
|
|
16
|
-
const {ENTER, SPACE, TAB, ESC} = ui.utils.KeyMap;
|
|
17
|
-
const {withText, Text} = ui.preacti18n;
|
|
18
|
-
|
|
19
|
-
const {SidePanelModes} = ui;
|
|
20
|
-
const {PLAYER_BREAK_POINTS} = ui.Components;
|
|
21
|
-
const {connect} = ui.redux;
|
|
15
|
+
const {ENTER, SPACE, TAB, ESC} = KalturaPlayer.ui.utils.KeyMap;
|
|
16
|
+
const {withText, Text} = KalturaPlayer.ui.preacti18n;
|
|
22
17
|
|
|
23
18
|
const translates = {
|
|
24
19
|
skipTranscript: <Text id="transcript.skip_transcript">Skip transcript</Text>,
|
|
@@ -50,8 +45,6 @@ export interface TranscriptProps {
|
|
|
50
45
|
onDownload: () => void;
|
|
51
46
|
printDisabled: boolean;
|
|
52
47
|
onPrint: () => void;
|
|
53
|
-
smallScreen?: boolean;
|
|
54
|
-
expandMode?: string;
|
|
55
48
|
}
|
|
56
49
|
|
|
57
50
|
interface TranscriptState {
|
|
@@ -74,12 +67,6 @@ const initialSearch = {
|
|
|
74
67
|
|
|
75
68
|
const SEARCHBAR_HEIGHT = 38; // height of search bar with margins
|
|
76
69
|
|
|
77
|
-
const mapStateToProps = (state: any, ownProps: Pick<TranscriptProps, 'expandMode'>) => ({
|
|
78
|
-
smallScreen: ownProps.expandMode === SidePanelModes.ALONGSIDE && state.shell.playerClientRect?.width < PLAYER_BREAK_POINTS.SMALL
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
// @ts-ignore
|
|
82
|
-
@connect(mapStateToProps)
|
|
83
70
|
@withText(translates)
|
|
84
71
|
export class Transcript extends Component<TranscriptProps, TranscriptState> {
|
|
85
72
|
private _transcriptListRef: HTMLElement | null = null;
|
|
@@ -377,7 +364,7 @@ export class Transcript extends Component<TranscriptProps, TranscriptState> {
|
|
|
377
364
|
};
|
|
378
365
|
|
|
379
366
|
render(props: TranscriptProps) {
|
|
380
|
-
const {isLoading, kitchenSinkActive, hasError
|
|
367
|
+
const {isLoading, kitchenSinkActive, hasError} = props;
|
|
381
368
|
const renderTranscriptButtons = !(isLoading || hasError);
|
|
382
369
|
return (
|
|
383
370
|
<div
|
|
@@ -387,25 +374,21 @@ export class Transcript extends Component<TranscriptProps, TranscriptState> {
|
|
|
387
374
|
}}
|
|
388
375
|
onKeyUp={this._handleEsc}
|
|
389
376
|
data-testid="transcript_root">
|
|
390
|
-
{
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
{
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
}}
|
|
403
|
-
data-testid="transcript_list">
|
|
404
|
-
{isLoading ? this._renderLoading() : this._renderTranscript()}
|
|
405
|
-
</div>
|
|
406
|
-
{renderTranscriptButtons && this._renderScrollToButton()}
|
|
377
|
+
<div className={styles.globalContainer}>
|
|
378
|
+
{this._renderHeader()}
|
|
379
|
+
|
|
380
|
+
{renderTranscriptButtons && this._renderSkipTranscriptButton()}
|
|
381
|
+
<div
|
|
382
|
+
className={styles.body}
|
|
383
|
+
onScroll={this._onScroll}
|
|
384
|
+
ref={node => {
|
|
385
|
+
this._transcriptListRef = node;
|
|
386
|
+
}}
|
|
387
|
+
data-testid="transcript_list">
|
|
388
|
+
{isLoading ? this._renderLoading() : this._renderTranscript()}
|
|
407
389
|
</div>
|
|
408
|
-
|
|
390
|
+
{renderTranscriptButtons && this._renderScrollToButton()}
|
|
391
|
+
</div>
|
|
409
392
|
</div>
|
|
410
393
|
);
|
|
411
394
|
}
|
|
@@ -228,7 +228,6 @@ export class TranscriptPlugin extends KalturaPlayer.core.BasePlugin {
|
|
|
228
228
|
highlightedMap={this._activeCuePointsMap}
|
|
229
229
|
onSeek={this._seekTo}
|
|
230
230
|
onItemClicked={this._seekTo}
|
|
231
|
-
expandMode={this.config.expandMode}
|
|
232
231
|
captions={this._data}
|
|
233
232
|
isLoading={this._isLoading}
|
|
234
233
|
hasError={this._hasError}
|
package/src/utils/utils.ts
CHANGED
|
@@ -32,7 +32,7 @@ const makeHoursString = (seconds: number): string => {
|
|
|
32
32
|
return '';
|
|
33
33
|
};
|
|
34
34
|
|
|
35
|
-
export const
|
|
35
|
+
export const secontsToTime = (seconds: number, longerThanHour: boolean): string => {
|
|
36
36
|
const date = new Date(0);
|
|
37
37
|
date.setSeconds(seconds);
|
|
38
38
|
return `${longerThanHour ? makeHoursString(seconds) : ''}${pad(date.getUTCMinutes())}:${pad(date.getUTCSeconds())}`;
|
|
@@ -14,9 +14,7 @@
|
|
|
14
14
|
"auto_scroll": "Resume AutoScroll",
|
|
15
15
|
"whoops": "Whoops!",
|
|
16
16
|
"load_failed": "Failed to load transcript",
|
|
17
|
-
"skip_transcript": "Skip transcript"
|
|
18
|
-
"smallScreenText": "To see the transcript, go to full screen",
|
|
19
|
-
"smallScreenMobileText": "To see the transcript, rotate the phone"
|
|
17
|
+
"skip_transcript": "Skip transcript"
|
|
20
18
|
}
|
|
21
19
|
}
|
|
22
20
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./small-screen-slate";
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
.smallScreenWrapper {
|
|
2
|
-
position: relative;
|
|
3
|
-
width: 100%;
|
|
4
|
-
height: 100%;
|
|
5
|
-
margin-top: -8px;
|
|
6
|
-
margin-right: -2px;
|
|
7
|
-
display: flex;
|
|
8
|
-
align-items: center;
|
|
9
|
-
.closeButton {
|
|
10
|
-
position: absolute;
|
|
11
|
-
right: 6px;
|
|
12
|
-
top: 0px;
|
|
13
|
-
}
|
|
14
|
-
.contentWrapper {
|
|
15
|
-
display: flex;
|
|
16
|
-
width: 100%;
|
|
17
|
-
flex-direction: column;
|
|
18
|
-
justify-content: center;
|
|
19
|
-
align-items: center;
|
|
20
|
-
.textContent {
|
|
21
|
-
margin-top: 8px;
|
|
22
|
-
font-size: 18px;
|
|
23
|
-
font-style: normal;
|
|
24
|
-
font-weight: 700;
|
|
25
|
-
line-height: 20px;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import {h, Component} from 'preact';
|
|
2
|
-
import {OnClick} from '@playkit-js/common/dist/hoc/a11y-wrapper';
|
|
3
|
-
import {Button, ButtonType, ButtonSize} from '@playkit-js/common/dist/components/button';
|
|
4
|
-
import {Icon, IconSize} from '@playkit-js/common/dist/icon';
|
|
5
|
-
import {ui} from '@playkit-js/kaltura-player-js';
|
|
6
|
-
// @ts-ignore
|
|
7
|
-
const {withPlayer} = ui.Components;
|
|
8
|
-
const {connect} = ui.redux;
|
|
9
|
-
const {withText, Text} = ui.preacti18n;
|
|
10
|
-
import * as styles from './small-screen-slate.scss';
|
|
11
|
-
|
|
12
|
-
const mapStateToProps = (state: any) => ({
|
|
13
|
-
isMobile: state.shell.isMobile
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
interface SmallScreenSlateProps {
|
|
17
|
-
isMobile?: boolean;
|
|
18
|
-
toggledWithEnter?: boolean;
|
|
19
|
-
smallScreenText?: string;
|
|
20
|
-
smallScreenMobileText?: string;
|
|
21
|
-
hideTranscript?: string;
|
|
22
|
-
player?: any;
|
|
23
|
-
onClose: OnClick;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const translates = {
|
|
27
|
-
smallScreenText: <Text id="transcript.small_screen">To see the transcript, go to full screen</Text>,
|
|
28
|
-
smallScreenMobileText: <Text id="transcript.small_screen_mobile">To see the transcript, rotate the phone</Text>,
|
|
29
|
-
hideTranscript: <Text id="transcript.hide_plugin">Hide Transcript</Text>
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
@withText(translates)
|
|
33
|
-
@withPlayer
|
|
34
|
-
// @ts-ignore
|
|
35
|
-
@connect(mapStateToProps)
|
|
36
|
-
export class SmallScreenSlate extends Component<SmallScreenSlateProps> {
|
|
37
|
-
render() {
|
|
38
|
-
const {isMobile, smallScreenMobileText, smallScreenText, onClose, toggledWithEnter, player, hideTranscript} = this.props;
|
|
39
|
-
return (
|
|
40
|
-
<div className={styles.smallScreenWrapper} data-testid="transcript_smallScreenWrapper">
|
|
41
|
-
<Button
|
|
42
|
-
icon={'close'}
|
|
43
|
-
onClick={onClose}
|
|
44
|
-
type={ButtonType.borderless}
|
|
45
|
-
focusOnMount={toggledWithEnter}
|
|
46
|
-
className={styles.closeButton}
|
|
47
|
-
ariaLabel={hideTranscript}
|
|
48
|
-
testId="transcript_smallScreenClose"
|
|
49
|
-
/>
|
|
50
|
-
<div className={styles.contentWrapper}>
|
|
51
|
-
{isMobile ? (
|
|
52
|
-
<Icon name={'screenRotation'} size={IconSize.large} />
|
|
53
|
-
) : (
|
|
54
|
-
<Button
|
|
55
|
-
icon={'expand'}
|
|
56
|
-
onClick={() => player?.enterFullscreen()}
|
|
57
|
-
type={ButtonType.borderless}
|
|
58
|
-
size={ButtonSize.medium}
|
|
59
|
-
ariaLabel={smallScreenText}
|
|
60
|
-
testId="transcript_smallScreenFullscreen"
|
|
61
|
-
/>
|
|
62
|
-
)}
|
|
63
|
-
<div className={styles.textContent} data-testid="transcript_smallScreenTextContent">
|
|
64
|
-
{isMobile ? smallScreenMobileText : smallScreenText}
|
|
65
|
-
</div>
|
|
66
|
-
</div>
|
|
67
|
-
</div>
|
|
68
|
-
);
|
|
69
|
-
}
|
|
70
|
-
}
|