7ea4334f0e90a47aff054512def0bc33ae701c04
[yaffs-website] / node_modules / video.js / es5 / control-bar / text-track-controls / caption-settings-menu-item.js
1 'use strict';
2
3 exports.__esModule = true;
4
5 var _textTrackMenuItem = require('./text-track-menu-item.js');
6
7 var _textTrackMenuItem2 = _interopRequireDefault(_textTrackMenuItem);
8
9 var _component = require('../../component.js');
10
11 var _component2 = _interopRequireDefault(_component);
12
13 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
14
15 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
16
17 function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
18
19 function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /**
20                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 * @file caption-settings-menu-item.js
21                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 */
22
23
24 /**
25  * The menu item for caption track settings menu
26  *
27  * @extends TextTrackMenuItem
28  */
29 var CaptionSettingsMenuItem = function (_TextTrackMenuItem) {
30   _inherits(CaptionSettingsMenuItem, _TextTrackMenuItem);
31
32   /**
33    * Creates an instance of this class.
34    *
35    * @param {Player} player
36    *        The `Player` that this class should be attached to.
37    *
38    * @param {Object} [options]
39    *        The key/value store of player options.
40    */
41   function CaptionSettingsMenuItem(player, options) {
42     _classCallCheck(this, CaptionSettingsMenuItem);
43
44     options.track = {
45       player: player,
46       kind: options.kind,
47       label: options.kind + ' settings',
48       selectable: false,
49       'default': false,
50       mode: 'disabled'
51     };
52
53     // CaptionSettingsMenuItem has no concept of 'selected'
54     options.selectable = false;
55
56     var _this = _possibleConstructorReturn(this, _TextTrackMenuItem.call(this, player, options));
57
58     _this.addClass('vjs-texttrack-settings');
59     _this.controlText(', opens ' + options.kind + ' settings dialog');
60     return _this;
61   }
62
63   /**
64    * This gets called when an `CaptionSettingsMenuItem` is "clicked". See
65    * {@link ClickableComponent} for more detailed information on what a click can be.
66    *
67    * @param {EventTarget~Event} [event]
68    *        The `keydown`, `tap`, or `click` event that caused this function to be
69    *        called.
70    *
71    * @listens tap
72    * @listens click
73    */
74
75
76   CaptionSettingsMenuItem.prototype.handleClick = function handleClick(event) {
77     this.player().getChild('textTrackSettings').show();
78     this.player().getChild('textTrackSettings').el_.focus();
79   };
80
81   return CaptionSettingsMenuItem;
82 }(_textTrackMenuItem2['default']);
83
84 _component2['default'].registerComponent('CaptionSettingsMenuItem', CaptionSettingsMenuItem);
85 exports['default'] = CaptionSettingsMenuItem;