-
Notifications
You must be signed in to change notification settings - Fork 7.5k
/
Copy pathsubtitles-button.js
66 lines (57 loc) · 1.5 KB
/
subtitles-button.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/**
* @file subtitles-button.js
*/
import TextTrackButton from './text-track-button.js';
import Component from '../../component.js';
/** @import Player from '../../player' */
/**
* The button component for toggling and selecting subtitles
*
* @extends TextTrackButton
*/
class SubtitlesButton extends TextTrackButton {
/**
* Creates an instance of this class.
*
* @param {Player} player
* The `Player` that this class should be attached to.
*
* @param {Object} [options]
* The key/value store of player options.
*
* @param {Function} [ready]
* The function to call when this component is ready.
*/
constructor(player, options, ready) {
super(player, options, ready);
this.setIcon('subtitles');
}
/**
* Builds the default DOM `className`.
*
* @return {string}
* The DOM `className` for this object.
*/
buildCSSClass() {
return `vjs-subtitles-button ${super.buildCSSClass()}`;
}
buildWrapperCSSClass() {
return `vjs-subtitles-button ${super.buildWrapperCSSClass()}`;
}
}
/**
* `kind` of TextTrack to look for to associate it with this menu.
*
* @type {string}
* @private
*/
SubtitlesButton.prototype.kind_ = 'subtitles';
/**
* The text that should display over the `SubtitlesButton`s controls. Added for localization.
*
* @type {string}
* @protected
*/
SubtitlesButton.prototype.controlText_ = 'Subtitles';
Component.registerComponent('SubtitlesButton', SubtitlesButton);
export default SubtitlesButton;