- 1 :
/**
- 2 :
* @file caption-settings-menu-item.js
- 3 :
*/
- 4 :
import TextTrackMenuItem from './text-track-menu-item.js';
- 5 :
import Component from '../../component.js';
- 6 :
- 7 :
/**
- 8 :
* The menu item for caption track settings menu
- 9 :
*
- 10 :
* @extends TextTrackMenuItem
- 11 :
*/
- 12 :
class CaptionSettingsMenuItem extends TextTrackMenuItem {
- 13 :
- 14 :
/**
- 15 :
* Creates an instance of this class.
- 16 :
*
- 17 :
* @param {Player} player
- 18 :
* The `Player` that this class should be attached to.
- 19 :
*
- 20 :
* @param {Object} [options]
- 21 :
* The key/value store of player options.
- 22 :
*/
- 23 :
constructor(player, options) {
- 24 :
options.track = {
- 25 :
player,
- 26 :
kind: options.kind,
- 27 :
label: options.kind + ' settings',
- 28 :
selectable: false,
- 29 :
default: false,
- 30 :
mode: 'disabled'
- 31 :
};
- 32 :
- 33 :
// CaptionSettingsMenuItem has no concept of 'selected'
- 34 :
options.selectable = false;
- 35 :
- 36 :
options.name = 'CaptionSettingsMenuItem';
- 37 :
- 38 :
super(player, options);
- 39 :
this.addClass('vjs-texttrack-settings');
- 40 :
this.controlText(', opens ' + options.kind + ' settings dialog');
- 41 :
}
- 42 :
- 43 :
/**
- 44 :
* This gets called when an `CaptionSettingsMenuItem` is "clicked". See
- 45 :
* {@link ClickableComponent} for more detailed information on what a click can be.
- 46 :
*
- 47 :
* @param {EventTarget~Event} [event]
- 48 :
* The `keydown`, `tap`, or `click` event that caused this function to be
- 49 :
* called.
- 50 :
*
- 51 :
* @listens tap
- 52 :
* @listens click
- 53 :
*/
- 54 :
handleClick(event) {
- 55 :
this.player().getChild('textTrackSettings').open();
- 56 :
}
- 57 :
}
- 58 :
- 59 :
Component.registerComponent('CaptionSettingsMenuItem', CaptionSettingsMenuItem);
- 60 :
export default CaptionSettingsMenuItem;