@playkit-js/transcript 3.7.13-canary.0-1df2d96 → 3.7.13-canary.0-8ca264e
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 -1
- package/README.md +0 -1
- package/dist/playkit-transcript.js +1 -1
- package/dist/playkit-transcript.js.map +1 -1
- package/package.json +1 -1
- package/src/components/caption/caption.tsx +2 -5
- package/src/components/caption-list/captionList.tsx +0 -2
- package/src/components/transcript/transcript.tsx +2 -4
- package/src/transcript-plugin.tsx +2 -5
- package/src/types/transcript-config.ts +0 -1
package/package.json
CHANGED
|
@@ -25,7 +25,6 @@ export interface CaptionProps {
|
|
|
25
25
|
navigationInstruction?: string;
|
|
26
26
|
timeLabel?: string;
|
|
27
27
|
setTextToRead: (textToRead: string, delay?: number) => void;
|
|
28
|
-
protectCaptionCopy: boolean;
|
|
29
28
|
}
|
|
30
29
|
|
|
31
30
|
interface ExtendedCaptionProps extends CaptionProps {
|
|
@@ -133,15 +132,13 @@ export class Caption extends Component<ExtendedCaptionProps> {
|
|
|
133
132
|
};
|
|
134
133
|
|
|
135
134
|
private _renderText = (text: string) => {
|
|
136
|
-
const {activeSearchIndex, searchLength, indexMap
|
|
135
|
+
const {activeSearchIndex, searchLength, indexMap} = this.props;
|
|
137
136
|
const indexArray = this.indexArray;
|
|
138
137
|
if (text?.length === 0) {
|
|
139
138
|
return null;
|
|
140
139
|
}
|
|
141
|
-
// no-copy is a global class, no-copy-detached is a CSS module class for detached mode protection
|
|
142
|
-
const captionSpanClasses = protectCaptionCopy ? `${styles.captionSpan} no-copy ${styles.noCopyDetached}` : styles.captionSpan;
|
|
143
140
|
return (
|
|
144
|
-
<span className={
|
|
141
|
+
<span className={`${styles.captionSpan} no-copy ${styles.noCopyDetached}`}>
|
|
145
142
|
{indexMap
|
|
146
143
|
? indexArray.map((el: string, index: number) => {
|
|
147
144
|
const preSelected = index === 0 ? text.substring(0, indexMap[el]) : '';
|
|
@@ -13,7 +13,6 @@ export interface CaptionProps {
|
|
|
13
13
|
scrollTo(el: HTMLElement): void;
|
|
14
14
|
scrollToSearchMatch(el: HTMLElement): void;
|
|
15
15
|
videoDuration: number;
|
|
16
|
-
protectCaptionCopy: boolean;
|
|
17
16
|
}
|
|
18
17
|
|
|
19
18
|
export interface Props {
|
|
@@ -125,7 +124,6 @@ export class CaptionList extends Component<Props> {
|
|
|
125
124
|
shouldScrollToSearchMatch: this._getShouldScrollToSearchMatch(id),
|
|
126
125
|
isAutoScrollEnabled,
|
|
127
126
|
searchCaption: this.props.searchMap[id],
|
|
128
|
-
protectCaptionCopy: captionProps.protectCaptionCopy,
|
|
129
127
|
...this._getSearchProps(id)
|
|
130
128
|
};
|
|
131
129
|
return newCaptionProps;
|
|
@@ -82,7 +82,6 @@ export interface TranscriptProps {
|
|
|
82
82
|
player: any;
|
|
83
83
|
onOverlayOpen?: () => void;
|
|
84
84
|
onOverlayClose?: () => void;
|
|
85
|
-
protectCaptionCopy: boolean;
|
|
86
85
|
}
|
|
87
86
|
|
|
88
87
|
interface TranscriptState {
|
|
@@ -456,7 +455,7 @@ export class Transcript extends Component<TranscriptProps, TranscriptState> {
|
|
|
456
455
|
};
|
|
457
456
|
|
|
458
457
|
private _renderTranscript = () => {
|
|
459
|
-
const {captions, hasError, onRetryLoad, showTime, videoDuration, highlightedMap
|
|
458
|
+
const {captions, hasError, onRetryLoad, showTime, videoDuration, highlightedMap} = this.props;
|
|
460
459
|
const {isAutoScrollEnabled, searchMap, activeSearchIndex, searchLength} = this.state;
|
|
461
460
|
|
|
462
461
|
if (hasError) {
|
|
@@ -480,8 +479,7 @@ export class Transcript extends Component<TranscriptProps, TranscriptState> {
|
|
|
480
479
|
searchLength,
|
|
481
480
|
scrollTo: this._scrollTo,
|
|
482
481
|
scrollToSearchMatch: this._scrollToSearchMatch,
|
|
483
|
-
videoDuration
|
|
484
|
-
protectCaptionCopy
|
|
482
|
+
videoDuration
|
|
485
483
|
};
|
|
486
484
|
|
|
487
485
|
return (
|
|
@@ -38,8 +38,7 @@ export class TranscriptPlugin extends KalturaPlayer.core.BasePlugin {
|
|
|
38
38
|
searchDebounceTimeout: 250,
|
|
39
39
|
searchNextPrevDebounceTimeout: 100,
|
|
40
40
|
downloadDisabled: false,
|
|
41
|
-
printDisabled: false
|
|
42
|
-
protectCaptionCopy: true
|
|
41
|
+
printDisabled: false
|
|
43
42
|
};
|
|
44
43
|
private _activeCaptionMapId: string = '';
|
|
45
44
|
private _activeCuePointsMap: HighlightedMap = {};
|
|
@@ -309,8 +308,7 @@ export class TranscriptPlugin extends KalturaPlayer.core.BasePlugin {
|
|
|
309
308
|
searchDebounceTimeout,
|
|
310
309
|
searchNextPrevDebounceTimeout,
|
|
311
310
|
downloadDisabled,
|
|
312
|
-
printDisabled
|
|
313
|
-
protectCaptionCopy
|
|
311
|
+
printDisabled
|
|
314
312
|
} = this.config;
|
|
315
313
|
this._transcriptPanel = this.sidePanelsManager!.add({
|
|
316
314
|
label: 'Transcript',
|
|
@@ -355,7 +353,6 @@ export class TranscriptPlugin extends KalturaPlayer.core.BasePlugin {
|
|
|
355
353
|
player={this.player}
|
|
356
354
|
onOverlayOpen={() => this.sidePanelsManager?.deactivateItem(this._transcriptPanel)}
|
|
357
355
|
onOverlayClose={() => this.sidePanelsManager?.activateItem(this._transcriptPanel)}
|
|
358
|
-
protectCaptionCopy={getConfigValue(protectCaptionCopy, isBoolean, true)}
|
|
359
356
|
/>
|
|
360
357
|
) as any;
|
|
361
358
|
},
|
|
@@ -8,5 +8,4 @@ export interface TranscriptConfig {
|
|
|
8
8
|
downloadDisabled: boolean; // disable download menu
|
|
9
9
|
printDisabled: boolean; // disable print menu
|
|
10
10
|
expandMode: string; // over or pushing the player
|
|
11
|
-
protectCaptionCopy: boolean; // enable/disable copy protection for caption text (default: true)
|
|
12
11
|
}
|