@playkit-js/transcript 2.1.5-canary.20-c308f5e → 2.1.5-canary.21-e28422e

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@playkit-js/transcript",
3
- "version": "2.1.5-canary.20-c308f5e",
3
+ "version": "2.1.5-canary.21-e28422e",
4
4
  "main": "dist/playkit-transcript.js",
5
5
  "license": "AGPL-3.0",
6
6
  "private": false,
@@ -1,5 +1,5 @@
1
1
  import {h, Component} from 'preact';
2
- import {A11yWrapper} from '@playkit-js/common';
2
+ import {A11yWrapper, OnClickEvent} from '@playkit-js/common';
3
3
  import {debounce} from '../../utils';
4
4
  import * as styles from './transcript.scss';
5
5
  import {Spinner} from '../spinner';
@@ -84,7 +84,7 @@ export class Transcript extends Component<TranscriptProps, TranscriptState> {
84
84
  this._setWidgetSize();
85
85
  }
86
86
 
87
- private _enableAutoScroll = (event: any, byKeyboard?: boolean) => {
87
+ private _enableAutoScroll = (event: OnClickEvent, byKeyboard?: boolean) => {
88
88
  event.preventDefault();
89
89
  if (this.state.isAutoScrollEnabled) {
90
90
  return;
@@ -93,7 +93,7 @@ export class Transcript extends Component<TranscriptProps, TranscriptState> {
93
93
  this.setState({
94
94
  isAutoScrollEnabled: true
95
95
  });
96
- if (event.type !== 'click') {
96
+ if (byKeyboard) {
97
97
  this._skipTranscriptButtonRef?.focus();
98
98
  }
99
99
  };
@@ -77,7 +77,11 @@ export class TranscriptPlugin extends KalturaPlayer.core.BasePlugin {
77
77
  private _initListeners(): void {
78
78
  this.eventManager.listen(this.player, this.player.Event.FIRST_PLAYING, () => {
79
79
  if ((this.player.getTracks(this.player.Track.TEXT) || []).length) {
80
- this._isLoading = true;
80
+ // check if captions already added in TextTrack
81
+ if (!this._captionMap.size) {
82
+ // turn on loading animation till captions added to TextTrack
83
+ this._isLoading = true;
84
+ }
81
85
  this._addPopoverIcon();
82
86
  this._addTranscriptItem();
83
87
  }