@playkit-js/transcript 3.5.30-canary.0-bdae263 → 3.5.30-canary.0-e5c3d3a

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": "3.5.30-canary.0-bdae263",
3
+ "version": "3.5.30-canary.0-e5c3d3a",
4
4
  "main": "dist/playkit-transcript.js",
5
5
  "license": "AGPL-3.0",
6
6
  "private": false,
@@ -1,11 +1,12 @@
1
1
  import {h, Component} from 'preact';
2
2
  import {InputField} from '@playkit-js/common/dist/components/input-field';
3
- import {core} from '@playkit-js/kaltura-player-js';
3
+ import {core, ui} from '@playkit-js/kaltura-player-js';
4
4
 
5
5
  const {Utils} = core;
6
6
  const {withEventManager} = KalturaPlayer.ui.Event;
7
7
  const {TAB} = KalturaPlayer.ui.utils.KeyMap;
8
8
  const {withText, Text} = KalturaPlayer.ui.preacti18n;
9
+ const {withPlayer} = ui.Components;
9
10
 
10
11
  const translates = ({activeSearchIndex, totalSearchResults}: SearchProps) => ({
11
12
  searchLabel: <Text id="transcript.search">Search in Transcript</Text>,
@@ -41,19 +42,23 @@ export interface SearchProps {
41
42
  searchResultsLabel?: string;
42
43
  eventManager?: any
43
44
  focusPluginButton: () => void;
45
+ player?: any;
44
46
  }
45
47
 
48
+ @withPlayer
46
49
  @withEventManager
47
50
  class SearchComponent extends Component<SearchProps> {
48
51
  private _inputField: InputField | null = null;
49
52
 
50
53
  constructor(props: SearchProps) {
51
54
  super(props);
52
- this.props.eventManager?.listen(document, 'keydown', this.handleKeydownEvent);
55
+ this.props.eventManager?.listen(this.props.player, this.props.player.Event.FIRST_PLAY, () => {
56
+ this.props.eventManager?.listen(document, 'keydown', this.handleKeydownEvent);
57
+ })
53
58
  }
54
59
 
55
60
  private handleKeydownEvent = (event: KeyboardEvent) => {
56
- if (event.keyCode === TAB && event.shiftKey && this._inputField?.base?.contains(document.activeElement)){
61
+ if (event.keyCode === TAB && event.shiftKey && document.activeElement === this._inputField?.base?.childNodes[0]){
57
62
  event.preventDefault();
58
63
  this.props.focusPluginButton();
59
64
  }