UNPKG

@bradmax/player-rxjs

Version:
74 lines (60 loc) 3.46 kB
/** * @license * _ _ * | | | | * | |__ _ __ __ _ __| |_ __ ___ __ ___ __ * | '_ \| '__/ _` |/ _` | '_ ` _ \ / _` \ \/ / * | |_) | | | (_| | (_| | | | | | | (_| |> < * |_.__/|_| \__,_|\__,_|_| |_| |_|\__,_/_/\_\ * * Bradmax Player * bradmax.com */ /* @bradmax/player-rxjs v0.1.2 */ import '@bradmax/player/zebra'; import { BRADMAX_PLAYER_VERSION } from '@bradmax/player/version'; import { createElement, Component } from 'react'; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 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; } 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; } var BradmaxPlayerZebra = function (_React$Component) { _inherits(BradmaxPlayerZebra, _React$Component); function BradmaxPlayerZebra() { _classCallCheck(this, BradmaxPlayerZebra); var _this = _possibleConstructorReturn(this, (BradmaxPlayerZebra.__proto__ || Object.getPrototypeOf(BradmaxPlayerZebra)).apply(this, arguments)); _this.theme = 'zebra'; _this.container = null; _this.player = null; _this.api = null; return _this; } _createClass(BradmaxPlayerZebra, [{ key: 'componentDidMount', value: function componentDidMount() { if (this.container != null) { this.player = bradmax.player.create(this.container, this.props, this.theme + '_' + BRADMAX_PLAYER_VERSION); this.api = this.player.modules.JavascriptApi; } } }, { key: 'componentWillUnmount', value: function componentWillUnmount() { if (this.player != null) { bradmax.player.destroy(this.player); } } }, { key: 'render', value: function render() { var _this2 = this; return createElement('div', { className: 'bradmax-player zebra', ref: function ref(r) { return _this2.container = r; } }); } }]); return BradmaxPlayerZebra; }(Component); export default BradmaxPlayerZebra; /* bradmax.com */ //# sourceMappingURL=index.js.map