3 exports.__esModule = true;
5 var _component = require('./component');
7 var _component2 = _interopRequireDefault(_component);
9 var _modalDialog = require('./modal-dialog');
11 var _modalDialog2 = _interopRequireDefault(_modalDialog);
13 var _mergeOptions = require('./utils/merge-options');
15 var _mergeOptions2 = _interopRequireDefault(_mergeOptions);
17 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
19 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
21 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; }
23 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; } /**
24 * @file error-display.js
29 * A display that indicates an error has occurred. This means that the video
32 * @extends ModalDialog
34 var ErrorDisplay = function (_ModalDialog) {
35 _inherits(ErrorDisplay, _ModalDialog);
38 * Creates an instance of this class.
40 * @param {Player} player
41 * The `Player` that this class should be attached to.
43 * @param {Object} [options]
44 * The key/value store of player options.
46 function ErrorDisplay(player, options) {
47 _classCallCheck(this, ErrorDisplay);
49 var _this = _possibleConstructorReturn(this, _ModalDialog.call(this, player, options));
51 _this.on(player, 'error', _this.open);
56 * Builds the default DOM `className`.
59 * The DOM `className` for this object.
61 * @deprecated Since version 5.
65 ErrorDisplay.prototype.buildCSSClass = function buildCSSClass() {
66 return 'vjs-error-display ' + _ModalDialog.prototype.buildCSSClass.call(this);
70 * Gets the localized error message based on the `Player`s error.
73 * The `Player`s error message localized or an empty string.
77 ErrorDisplay.prototype.content = function content() {
78 var error = this.player().error();
80 return error ? this.localize(error.message) : '';
84 }(_modalDialog2['default']);
87 * The default options for an `ErrorDisplay`.
93 ErrorDisplay.prototype.options_ = (0, _mergeOptions2['default'])(_modalDialog2['default'].prototype.options_, {
100 _component2['default'].registerComponent('ErrorDisplay', ErrorDisplay);
101 exports['default'] = ErrorDisplay;