Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module.exports = function(e) {
- function t(o) {
- if (n[o]) return n[o].exports;
- var r = n[o] = {
- exports: {},
- id: o,
- loaded: !1
- };
- return e[o].call(r.exports, r, r.exports, t), r.loaded = !0, r.exports
- }
- var n = {};
- return t.m = e, t.c = n, t.p = "", t(0)
- }([function(e, t, n) {
- "use strict";
- function o(e) {
- return e && e.__esModule ? e : {
- default: e
- }
- }
- function r(e, t) {
- if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
- }
- function a(e, t) {
- if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- return !t || "object" != typeof t && "function" != typeof t ? e : t
- }
- function u(e, t) {
- if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- enumerable: !1,
- writable: !0,
- configurable: !0
- }
- }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
- }
- Object.defineProperty(t, "__esModule", {
- value: !0
- });
- var l = Object.assign || function(e) {
- for (var t = 1; t < arguments.length; t++) {
- var n = arguments[t];
- for (var o in n) Object.prototype.hasOwnProperty.call(n, o) && (e[o] = n[o])
- }
- return e
- },
- s = function() {
- function e(e, t) {
- for (var n = 0; n < t.length; n++) {
- var o = t[n];
- o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, o.key, o)
- }
- }
- return function(t, n, o) {
- return n && e(t.prototype, n), o && e(t, o), t
- }
- }(),
- i = n(2),
- c = o(i),
- d = n(1),
- p = o(d),
- f = function(e) {
- function t() {
- return r(this, t), a(this, (t.__proto__ || Object.getPrototypeOf(t)).apply(this, arguments))
- }
- return u(t, e), s(t, [{
- key: "componentDidMount",
- value: function() {
- var e = this,
- t = this.audioEl;
- this.updateVolume(this.props.volume), t.addEventListener("error", function(t) {
- e.props.onError(t)
- }), t.addEventListener("canplay", function(t) {
- e.props.onCanPlay(t)
- }), t.addEventListener("canplaythrough", function(t) {
- e.props.onCanPlayThrough(t)
- }), t.addEventListener("play", function(t) {
- e.setListenTrack(), e.props.onPlay(t)
- }), t.addEventListener("abort", function(t) {
- e.clearListenTrack(), e.props.onAbort(t)
- }), t.addEventListener("ended", function(t) {
- e.clearListenTrack(), e.props.onEnded(t)
- }), t.addEventListener("pause", function(t) {
- e.clearListenTrack(), e.props.onPause(t)
- }), t.addEventListener("seeked", function(t) {
- e.props.onSeeked(t)
- }), t.addEventListener("loadedmetadata", function(t) {
- e.props.onLoadedMetadata(t)
- }), t.addEventListener("volumechange", function(t) {
- e.props.onVolumeChanged(t)
- })
- }
- }, {
- key: "componentWillReceiveProps",
- value: function(e) {
- this.updateVolume(e.volume)
- }
- }, {
- key: "setListenTrack",
- value: function() {
- var e = this;
- if (!this.listenTracker) {
- var t = this.props.listenInterval;
- this.listenTracker = setInterval(function() {
- e.props.onListen(e.audioEl.currentTime)
- }, t)
- }
- }
- }, {
- key: "updateVolume",
- value: function(e) {
- "number" == typeof e && e !== this.audioEl.volume && (this.audioEl.volume = e)
- }
- }, {
- key: "clearListenTrack",
- value: function() {
- this.listenTracker && (clearInterval(this.listenTracker), this.listenTracker = null)
- }
- }, {
- key: "render",
- value: function() {
- var e = this,
- t = this.props.children || c.default.createElement("p", null, "Your browser does not support the ", c.default.createElement("code", null, "audio"), " element."),
- n = !(this.props.controls === !1),
- o = this.props.title ? this.props.title : this.props.src,
- r = {};
- return this.props.controlsList && (r.controlsList = this.props.controlsList), c.default.createElement("audio", l({
- autoPlay: this.props.autoPlay,
- className: "react-audio-player " + this.props.className,
- controls: n,
- loop: this.props.loop,
- muted: this.props.muted,
- onPlay: this.onPlay,
- preload: this.props.preload,
- ref: function(t) {
- e.audioEl = t
- },
- src: this.props.src,
- style: this.props.style,
- title: o
- }, r), t)
- }
- }]), t
- }(i.Component);
- f.defaultProps = {
- autoPlay: !1,
- children: null,
- className: "",
- controls: !1,
- controlsList: "",
- listenInterval: 1e4,
- loop: !1,
- muted: !1,
- onAbort: function() {},
- onCanPlay: function() {},
- onCanPlayThrough: function() {},
- onEnded: function() {},
- onError: function() {},
- onListen: function() {},
- onPause: function() {},
- onPlay: function() {},
- onSeeked: function() {},
- onVolumeChanged: function() {},
- onLoadedMetadata: function() {},
- preload: "metadata",
- src: null,
- style: {},
- title: "",
- volume: 1
- }, f.propTypes = {
- autoPlay: p.default.bool,
- children: p.default.element,
- className: p.default.string,
- controls: p.default.bool,
- controlsList: p.default.string,
- listenInterval: p.default.number,
- loop: p.default.bool,
- muted: p.default.bool,
- onAbort: p.default.func,
- onCanPlay: p.default.func,
- onCanPlayThrough: p.default.func,
- onEnded: p.default.func,
- onError: p.default.func,
- onListen: p.default.func,
- onLoadedMetadata: p.default.func,
- onPause: p.default.func,
- onPlay: p.default.func,
- onSeeked: p.default.func,
- onVolumeChanged: p.default.func,
- preload: p.default.oneOf(["", "none", "metadata", "auto"]),
- src: p.default.string,
- style: p.default.objectOf(p.default.string),
- title: p.default.string,
- volume: p.default.number
- };
- var h = f;
- t.default = h;
- (function() {
- "undefined" != typeof __REACT_HOT_LOADER__ && (__REACT_HOT_LOADER__.register(f, "ReactAudioPlayer", "/Users/mccandj/Documents/Projects/react-audio-player/src/index.jsx"), __REACT_HOT_LOADER__.register(h, "default", "/Users/mccandj/Documents/Projects/react-audio-player/src/index.jsx"))
- })()
- }, function(e, t) {
- e.exports = require("prop-types")
- }, function(e, t) {
- e.exports = require("react")
- }]);
Add Comment
Please, Sign In to add comment