3 exports.__esModule = true;
5 var _component = require('../../component.js');
7 var _component2 = _interopRequireDefault(_component);
9 require('./volume-bar.js');
11 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
13 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
15 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; }
17 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; } /**
18 * @file volume-control.js
26 * The component for controlling the volume level
30 var VolumeControl = function (_Component) {
31 _inherits(VolumeControl, _Component);
34 * Creates an instance of this class.
36 * @param {Player} player
37 * The `Player` that this class should be attached to.
39 * @param {Object} [options={}]
40 * The key/value store of player options.
42 function VolumeControl(player, options) {
43 _classCallCheck(this, VolumeControl);
45 // hide volume controls when they're not supported by the current tech
46 var _this = _possibleConstructorReturn(this, _Component.call(this, player, options));
48 if (player.tech_ && player.tech_.featuresVolumeControl === false) {
49 _this.addClass('vjs-hidden');
51 _this.on(player, 'loadstart', function () {
52 if (player.tech_.featuresVolumeControl === false) {
53 this.addClass('vjs-hidden');
55 this.removeClass('vjs-hidden');
62 * Create the `Component`'s DOM element
65 * The element that was created.
69 VolumeControl.prototype.createEl = function createEl() {
70 return _Component.prototype.createEl.call(this, 'div', {
71 className: 'vjs-volume-control vjs-control'
76 }(_component2['default']);
79 * Default options for the `VolumeControl`
86 VolumeControl.prototype.options_ = {
87 children: ['volumeBar']
90 _component2['default'].registerComponent('VolumeControl', VolumeControl);
91 exports['default'] = VolumeControl;