react-soundplayer
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("soundcloud-audio")):"function"==typeof define&&define.amd?define("ReactSoundplayer",["react","soundcloud-audio"],t):"object"==typeof exports?exports.ReactSoundplayer=t(require("react"),require("soundcloud-audio")):e.ReactSoundplayer=t(e.React,e.SoundCloudAudio)}(this,function(e,t){return function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=8)}([function(t,n){t.exports=e},function(e,t,n){e.exports=n(23)()},function(e,t,n){var o,r;!function(){"use strict";function n(){for(var e=[],t=0;t<arguments.length;t++){var o=arguments[t];if(o){var r=typeof o;if("string"===r||"number"===r)e.push(o);else if(Array.isArray(o))e.push(n.apply(null,o));else if("object"===r)for(var i in o)u.call(o,i)&&o[i]&&e.push(i)}}return e.join(" ")}var u={}.hasOwnProperty;void 0!==e&&e.exports?e.exports=n:(o=[],void 0!==(r=function(){return n}.apply(t,o))&&(e.exports=r))}()},function(e,n){e.exports=t},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VolumeIconMuteSVG=t.VolumeIconLoudSVG=t.VolumeIconSVG=t.PrevIconSVG=t.NextIconSVG=t.PauseIconSVG=t.PlayIconSVG=t.ButtonIconSVG=t.SoundCloudLogoSVG=void 0;var o=n(0),r=function(e){return e&&e.__esModule?e:{default:e}}(o),u=(t.SoundCloudLogoSVG=function(){return r.default.createElement("svg",{className:"sb-soundplayer-cover-logo",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor"},r.default.createElement("path",{d:"M10.517 3.742c-.323 0-.49.363-.49.582 0 0-.244 3.591-.244 4.641 0 1.602.15 2.621.15 2.621 0 .222.261.401.584.401.321 0 .519-.179.519-.401 0 0 .398-1.038.398-2.639 0-1.837-.153-4.127-.284-4.592-.112-.395-.313-.613-.633-.613zm-1.996.268c-.323 0-.49.363-.49.582 0 0-.244 3.322-.244 4.372 0 1.602.119 2.621.119 2.621 0 .222.26.401.584.401.321 0 .581-.179.581-.401 0 0 .081-1.007.081-2.608 0-1.837-.206-4.386-.206-4.386 0-.218-.104-.581-.425-.581zm-2.021 1.729c-.324 0-.49.362-.49.582 0 0-.272 1.594-.272 2.644 0 1.602.179 2.559.179 2.559 0 .222.229.463.552.463.321 0 .519-.241.519-.463 0 0 .19-.944.19-2.546 0-1.837-.253-2.657-.253-2.657 0-.22-.104-.582-.425-.582zm-2.046-.358c-.323 0-.49.363-.49.582 0 0-.162 1.92-.162 2.97 0 1.602.069 2.496.069 2.496 0 .222.26.557.584.557.321 0 .581-.304.581-.526 0 0 .143-.936.143-2.538 0-1.837-.206-2.96-.206-2.96 0-.218-.198-.581-.519-.581zm-2.169 1.482c-.272 0-.232.218-.232.218v3.982s-.04.335.232.335c.351 0 .716-.832.716-2.348 0-1.245-.436-2.187-.716-2.187zm18.715-.976c-.289 0-.567.042-.832.116-.417-2.266-2.806-3.989-5.263-3.989-1.127 0-2.095.705-2.931 1.316v8.16s0 .484.5.484h8.526c1.655 0 3-1.55 3-3.155 0-1.607-1.346-2.932-3-2.932zm10.17.857c-1.077-.253-1.368-.389-1.368-.815 0-.3.242-.611.97-.611.621 0 1.106.253 1.542.699l.981-.951c-.641-.669-1.417-1.067-2.474-1.067-1.339 0-2.425.757-2.425 1.99 0 1.338.873 1.736 2.124 2.026 1.281.291 1.513.486 1.513.923 0 .514-.379.738-1.184.738-.65 0-1.26-.223-1.736-.777l-.98.873c.514.757 1.504 1.232 2.639 1.232 1.853 0 2.668-.873 2.668-2.163 0-1.477-1.193-1.845-2.27-2.097zm6.803-2.745c-1.853 0-2.949 1.435-2.949 3.502s1.096 3.501 2.949 3.501c1.852 0 2.949-1.434 2.949-3.501s-1.096-3.502-2.949-3.502zm0 5.655c-1.097 0-1.553-.941-1.553-2.153 0-1.213.456-2.153 1.553-2.153 1.096 0 1.551.94 1.551 2.153.001 1.213-.454 2.153-1.551 2.153zm8.939-1.736c0 1.086-.533 1.756-1.396 1.756-.864 0-1.388-.689-1.388-1.775v-3.897h-1.358v3.916c0 1.978 1.106 3.084 2.746 3.084 1.726 0 2.754-1.136 2.754-3.103v-3.897h-1.358v3.916zm8.142-.89l.019 1.485c-.087-.174-.31-.515-.475-.768l-2.703-3.692h-1.362v6.894h1.401v-2.988l-.02-1.484c.088.175.311.514.475.767l2.79 3.705h1.213v-6.894h-1.339v2.975zm5.895-2.923h-2.124v6.791h2.027c1.746 0 3.474-1.01 3.474-3.395 0-2.484-1.437-3.396-3.377-3.396zm-.097 5.472h-.67v-4.152h.719c1.436 0 2.028.688 2.028 2.076 0 1.242-.651 2.076-2.077 2.076zm7.909-4.229c.611 0 1 .271 1.242.737l1.26-.582c-.426-.883-1.202-1.503-2.483-1.503-1.775 0-3.016 1.435-3.016 3.502 0 2.143 1.191 3.501 2.968 3.501 1.232 0 2.047-.572 2.513-1.533l-1.145-.68c-.358.602-.718.864-1.329.864-1.019 0-1.611-.932-1.611-2.153-.001-1.261.583-2.153 1.601-2.153zm5.17-1.192h-1.359v6.791h4.083v-1.338h-2.724v-5.453zm6.396-.157c-1.854 0-2.949 1.435-2.949 3.502s1.095 3.501 2.949 3.501c1.853 0 2.95-1.434 2.95-3.501s-1.097-3.502-2.95-3.502zm0 5.655c-1.097 0-1.553-.941-1.553-2.153 0-1.213.456-2.153 1.553-2.153 1.095 0 1.55.94 1.55 2.153.001 1.213-.454 2.153-1.55 2.153zm8.557-1.736c0 1.086-.532 1.756-1.396 1.756-.864 0-1.388-.689-1.388-1.775v-3.794h-1.358v3.813c0 1.978 1.106 3.084 2.746 3.084 1.726 0 2.755-1.136 2.755-3.103v-3.794h-1.36v3.813zm5.449-3.907h-2.318v6.978h2.211c1.908 0 3.789-1.037 3.789-3.489 0-2.552-1.565-3.489-3.682-3.489zm-.108 5.623h-.729v-4.266h.783c1.565 0 2.21.706 2.21 2.133.001 1.276-.707 2.133-2.264 2.133z"}))},t.ButtonIconSVG=function(e){return r.default.createElement("svg",{className:"sb-soundplayer-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor"},e.children)}),i=(t.PlayIconSVG=function(){return r.default.createElement(u,null,r.default.createElement("path",{d:"M0 0 L32 16 L0 32 z"}))},t.PauseIconSVG=function(){return r.default.createElement(u,null,r.default.createElement("path",{d:"M0 0 H12 V32 H0 z M20 0 H32 V32 H20 z"}))},t.NextIconSVG=function(){return r.default.createElement(u,null,r.default.createElement("path",{d:"M4 4 L24 14 V4 H28 V28 H24 V18 L4 28 z "}))},t.PrevIconSVG=function(){return r.default.createElement(u,null,r.default.createElement("path",{d:"M4 4 H8 V14 L28 4 V28 L8 18 V28 H4 z "}))},t.VolumeIconSVG=function(e){return r.default.createElement("svg",{className:"sb-soundplayer-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 75 75",fill:"currentColor",stroke:"currentColor"},e.children)});t.VolumeIconLoudSVG=function(){return r.default.createElement(i,null,r.default.createElement("polygon",{points:"39.389,13.769 22.235,28.606 6,28.606 6,47.699 21.989,47.699 39.389,62.75 39.389,13.769",style:{strokeWidth:5,strokeLinejoin:"round"}}),r.default.createElement("path",{d:"M 48.128,49.03 C 50.057,45.934 51.19,42.291 51.19,38.377 C 51.19,34.399 50.026,30.703 48.043,27.577",style:{fill:"none",strokeWidth:5,strokeLinecap:"round"}}),r.default.createElement("path",{d:"M 55.082,20.537 C 58.777,25.523 60.966,31.694 60.966,38.377 C 60.966,44.998 58.815,51.115 55.178,56.076",style:{fill:"none",strokeWidth:5,strokeLinecap:"round"}}),r.default.createElement("path",{d:"M 61.71,62.611 C 66.977,55.945 70.128,47.531 70.128,38.378 C 70.128,29.161 66.936,20.696 61.609,14.01",style:{fill:"none",strokeWidth:5,strokeLinecap:"round"}}))},t.VolumeIconMuteSVG=function(){return r.default.createElement(i,null,r.default.createElement("polygon",{points:"39.389,13.769 22.235,28.606 6,28.606 6,47.699 21.989,47.699 39.389,62.75 39.389,13.769",style:{stroke:"#11111",strokeWidth:5,strokeLinejoin:"round"}}),r.default.createElement("path",{d:"M 48.651772,50.269646 69.395223,25.971024",style:{fill:"none",strokeWidth:5,strokeLinecap:"round"}}),r.default.createElement("path",{d:"M 69.395223,50.269646 48.651772,25.971024",style:{fill:"none",strokeWidth:5,strokeLinecap:"round"}}))}},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":c(t))&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":c(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)}function l(e){return e.displayName||e.name||"Component"}function s(e){var t=function(t){function n(e,t){u(this,n);var o=i(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e,t));return e.clientId||e.soundCloudAudio||e.streamUrl||console.warn("You need to get a clientId from SoundCloud,\n pass in an instance of SoundCloudAudio\n or use streamUrl with audio source instead\n https://github.com/soundblogs/react-soundplayer#examples"),"undefined"!=typeof window&&(e.soundCloudAudio?o.soundCloudAudio=e.soundCloudAudio:o.soundCloudAudio=new b.default(e.clientId)),o.state={duration:0,currentTime:0,seeking:!1,playing:!1,volume:1,isMuted:!1},o}return a(n,t),d(n,[{key:"componentDidMount",value:function(){this.mounted=!0,this.requestAudio(),this.listenAudioEvents()}},{key:"componentWillUnmount",value:function(){this.mounted=!1,this.soundCloudAudio.unbindAll()}},{key:"requestAudio",value:function(){var e=this,t=this.soundCloudAudio,n=this.props,o=n.resolveUrl,u=n.streamUrl,i=n.preloadType,a=n.onReady;u?t.preload(u,i):o&&t.resolve(o,function(t){e.mounted&&e.setState(r({},t.tracks?"playlist":"track",t),function(){return a&&a()})})}},{key:"listenAudioEvents",value:function(){var e=this.soundCloudAudio;e.on("playing",this.onAudioStarted.bind(this)),e.on("timeupdate",this.getCurrentTime.bind(this)),e.on("loadedmetadata",this.getDuration.bind(this)),e.on("seeking",this.onSeekingTrack.bind(this)),e.on("seeked",this.onSeekedTrack.bind(this)),e.on("pause",this.onAudioPaused.bind(this)),e.on("ended",this.onAudioEnded.bind(this)),e.on("volumechange",this.onVolumeChange.bind(this))}},{key:"onSeekingTrack",value:function(){this.setState({seeking:!0})}},{key:"onSeekedTrack",value:function(){this.setState({seeking:!1})}},{key:"onAudioStarted",value:function(){var e=this.soundCloudAudio,t=this.props.onStartTrack;this.setState({playing:!0}),(0,g.stopAllOther)(e.playing),(0,g.addToPlayedStore)(e),t&&t(e,e.playing)}},{key:"onAudioPaused",value:function(){var e=this.props.onPauseTrack;this.setState({playing:!1}),e&&e(this.soundCloudAudio)}},{key:"onAudioEnded",value:function(){var e=this.props.onStopTrack;this.setState({playing:!1}),e&&e(this.soundCloudAudio)}},{key:"onVolumeChange",value:function(){this.setState({volume:this.soundCloudAudio.audio.volume,isMuted:this.soundCloudAudio.audio.muted})}},{key:"getCurrentTime",value:function(){this.setState({currentTime:this.soundCloudAudio.audio.currentTime})}},{key:"getDuration",value:function(){this.setState({duration:this.soundCloudAudio.audio.duration})}},{key:"render",value:function(){return y.default.createElement(e,f({},this.props,{soundCloudAudio:this.soundCloudAudio},this.state))}}]),n}(p.Component);return t.displayName="withSoundCloudAudio("+l(e)+")",t.WrappedComponent=e,(0,v.default)(t,e)}var c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};Object.defineProperty(t,"__esModule",{value:!0});var f=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},d=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}}();t.default=s;var p=n(0),y=o(p),m=n(3),b=o(m),h=n(22),v=o(h),g=n(19)},function(e,t,n){"use strict";e.exports=n(10)},function(e,t,n){"use strict";e.exports=n(18)},function(e,t,n){"use strict";e.exports={components:n(7),addons:n(6)}},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 u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":a(t))&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":a(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)}var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};Object.defineProperty(t,"__esModule",{value:!0});var l=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}}(),s=n(0),c=o(s),f=n(1),d=o(f),p=n(3),y=o(p),m=n(5),b=o(m),h=function(e){function t(){return r(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),l(t,[{key:"wrapChild",value:function(e){return c.default.cloneElement(e,this.props)}},{key:"componentWillMount",value:function(){console.warn("\n <SoundPlayerContainer /> is deprecated! Please use HOC addons/withSoundCloudAudio instead.\n https://reactjs.org/docs/higher-order-components.html\n https://labs.voronianski.com/react-soundplayer/#Containers\n ")}},{key:"render",value:function(){var e=this.props.children;if(e)return Array.isArray(e)?c.default.createElement("span",null,c.default.Children.map(e,this.wrapChild.bind(this))):this.wrapChild(e)}}]),t}(s.Component);h.propTypes={streamUrl:d.default.string,resolveUrl:d.default.string,clientId:d.default.string,soundCloudAudio:d.default.instanceOf(y.default),onStartTrack:d.default.func,onStopTrack:d.default.func,onPauseTrack:d.default.func,onVolumeChange:d.default.func,onReady:d.default.func},t.default=(0,b.default)(h)},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.SoundPlayerContainer=t.withSoundCloudAudio=t.withCustomAudio=void 0;var r=n(5),u=o(r),i=n(9),a=o(i);t.withCustomAudio=u.default,t.withSoundCloudAudio=u.default,t.SoundPlayerContainer=a.default},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 u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":a(t))&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":a(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)}var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};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}}(),c=n(0),f=o(c),d=n(1),p=o(d),y=n(2),m=o(y),b=n(4),h=function(e){function t(){return r(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),s(t,[{key:"render",value:function(){var e=this.props,t=e.backgroundUrl,n=e.trackName,o=e.artistName,r=e.className,u=e.style,i=e.children,a=(0,m.default)("sb-soundplayer-cover",r);return f.default.createElement("div",{className:a,style:l({},u,{backgroundImage:"url("+t+")"})},f.default.createElement("div",null,f.default.createElement(b.SoundCloudLogoSVG,null)),f.default.createElement("div",null,f.default.createElement("span",{className:"sb-soundplayer-track sb-soundplayer-info-box"},n)),f.default.createElement("div",null,f.default.createElement("span",{className:"sb-soundplayer-artist sb-soundplayer-info-box"},"by ",o)),f.default.Children.map(i,f.default.cloneElement))}}]),t}(c.Component);h.propTypes={className:p.default.string,backgroundUrl:p.default.string.isRequired,trackName:p.default.string.isRequired,artistName:p.default.string.isRequired},h.defaultProps={style:{}},t.default=h},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 u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":a(t))&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":a(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)}var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};Object.defineProperty(t,"__esModule",{value:!0});var l=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}}(),s=n(0),c=o(s),f=n(1),d=o(f),p=n(2),y=o(p),m=n(3),b=o(m),h=n(4),v=function(e){function t(){return r(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),l(t,[{key:"shouldComponentUpdate",value:function(){return!1}},{key:"handleClick",value:function(e){var t=this.props,n=t.soundCloudAudio,o=t.onNextClick;n&&n.next(),o&&o(e)}},{key:"render",value:function(){var e=this.props,t=e.className,n=e.style,o=(0,y.default)("sb-soundplayer-btn sb-soundplayer-next-btn",t);return c.default.createElement("button",{type:"button",className:o,style:n,onClick:this.handleClick.bind(this)},c.default.createElement(h.NextIconSVG,null))}}]),t}(s.Component);v.propTypes={className:d.default.string,onNextClick:d.default.func,soundCloudAudio:d.default.instanceOf(b.default)},t.default=v},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 u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":a(t))&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":a(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)}var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};Object.defineProperty(t,"__esModule",{value:!0});var l=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}}(),s=n(0),c=o(s),f=n(1),d=o(f),p=n(2),y=o(p),m=n(3),b=o(m),h=n(4),v=function(e){function t(){return r(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),l(t,[{key:"shouldComponentUpdate",value:function(e){var t=this.props,n=t.playing,o=t.seeking;return n!==e.playing||o!==e.seeking}},{key:"handleClick",value:function(e){var t=this.props,n=t.playing,o=t.soundCloudAudio,r=t.onTogglePlay;n?o&&o.pause():o&&o.play({playlistIndex:o._playlistIndex}),r&&r(e)}},{key:"render",value:function(){var e=this.props,t=e.playing,n=e.seekingIcon,o=e.seeking,r=e.className,u=e.style,i=void 0;i=o&&n?c.default.cloneElement(n):t?c.default.createElement(h.PauseIconSVG,null):c.default.createElement(h.PlayIconSVG,null);var a=(0,y.default)("sb-soundplayer-btn sb-soundplayer-play-btn",r);return c.default.createElement("button",{type:"button",className:a,style:u,onClick:this.handleClick.bind(this)},i)}}]),t}(s.Component);v.propTypes={className:d.default.string,seeking:d.default.bool,playing:d.default.bool,onTogglePlay:d.default.func,seekingIcon:d.default.node,soundCloudAudio:d.default.instanceOf(b.default)},v.defaultProps={playing:!1,seeking:!1},t.default=v},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 u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":a(t))&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":a(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)}var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};Object.defineProperty(t,"__esModule",{value:!0});var l=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}}(),s=n(0),c=o(s),f=n(1),d=o(f),p=n(2),y=o(p),m=n(3),b=o(m),h=n(4),v=function(e){function t(){return r(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),l(t,[{key:"shouldComponentUpdate",value:function(){return!1}},{key:"handleClick",value:function(e){var t=this.props,n=t.soundCloudAudio,o=t.onPrevClick;n&&n.previous(),o&&o(e)}},{key:"render",value:function(){var e=this.props,t=e.className,n=e.style,o=(0,y.default)("sb-soundplayer-btn sb-soundplayer-prev-btn",t);return c.default.createElement("button",{type:"button",className:o,style:n,onClick:this.handleClick.bind(this)},c.default.createElement(h.PrevIconSVG,null))}}]),t}(s.Component);v.propTypes={className:d.default.string,onPrevClick:d.default.func,soundCloudAudio:d.default.instanceOf(b.default)},t.default=v},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 u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":a(t))&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":a(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)}var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};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}}(),c=n(0),f=o(c),d=n(1),p=o(d),y=n(3),m=o(y),b=n(2),h=o(b),v=function(e){function t(){return r(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),s(t,[{key:"handleSeekTrack",value:function(e){var t=this.props,n=t.onSeekTrack,o=t.soundCloudAudio,r=(e.pageX-e.currentTarget.getBoundingClientRect().left)/e.currentTarget.offsetWidth;o&&!isNaN(o.audio.duration)&&(o.audio.currentTime=r*o.audio.duration),n&&n.call(this,r,e)}},{key:"render",value:function(){var e=this.props,t=e.className,n=e.innerClassName,o=e.style,r=e.currentTime,u=e.duration,i=this.props,a=i.value,s=i.innerStyle;!a&&r&&u&&(a=r/u*100||0),a<0&&(a=0),a>100&&(a=100);var c=(0,h.default)("sb-soundplayer-progress-container",t),d=(0,h.default)("sb-soundplayer-progress-inner",n);return s||(s={}),s=l({},s,{width:a+"%"}),f.default.createElement("div",{className:c,style:o,onClick:this.handleSeekTrack.bind(this)},f.default.createElement("div",{className:d,style:s}))}}]),t}(c.Component);v.propTypes={className:p.default.string,innerClassName:p.default.string,innerStyle:p.default.object,value:p.default.number,onSeekTrack:p.default.func,soundCloudAudio:p.default.instanceOf(m.default)},v.defaultProps={value:0},t.default=v},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 u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":a(t))&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":a(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)}var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};Object.defineProperty(t,"__esModule",{value:!0});var l=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}}(),s=n(0),c=o(s),f=n(1),d=o(f),p=n(2),y=o(p),m=function(e){function t(){return r(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),l(t,[{key:"render",value:function(){var e=this.props,n=e.currentTime,o=e.className,r=e.style,u=e.soundCloudAudio,i=this.props.duration,a=(0,y.default)("sb-soundplayer-timer",o);return!i&&u&&u.duration&&(i=u.duration),c.default.createElement("div",{className:a,style:r},t.prettyTime(n)," / ",t.prettyTime(i))}}],[{key:"prettyTime",value:function(e){var t=Math.floor(e/3600),n="0"+Math.floor(e%3600/60),o="0"+Math.floor(e%60);return n=n.substr(n.length-2),o=o.substr(o.length-2),isNaN(o)?"00:00":t?t+":"+n+":"+o:n+":"+o}}]),t}(s.Component);m.propTypes={className:d.default.string,duration:d.default.oneOfType([d.default.string,d.default.number]),currentTime:d.default.oneOfType([d.default.string,d.default.number])},m.defaultProps={duration:0,currentTime:0},t.default=m},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 u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":a(t))&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":a(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)}var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};Object.defineProperty(t,"__esModule",{value:!0});var l=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}}(),s=n(0),c=o(s),f=n(1),d=o(f),p=n(3),y=o(p),m=n(2),b=o(m),h=n(4),v=function(e){function t(){return r(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),l(t,[{key:"handleVolumeChange",value:function(e){var t=this.props,n=t.onVolumeChange,o=t.onToggleMute,r=t.soundCloudAudio,u=t.isMuted,i=e.target.value/100,a=i<=0&&!u;r&&!isNaN(r.audio.volume)&&(r.audio.volume=i,r.audio.muted=a),a!==u&&o&&o.call(this,a,e),n&&n.call(this,i,e)}},{key:"handleMute",value:function(e){var t=this.props,n=t.onToggleMute,o=t.soundCloudAudio;o&&!isNaN(o.audio.muted)&&(o.audio.muted=!o.audio.muted),n&&n.call(this,!this.props.isMuted,e)}},{key:"render",value:function(){var e=this.props,t=e.className,n=e.buttonClassName,o=e.rangeClassName,r=e.volume,u=e.isMuted,i=100*r||0;(i<0||u)&&(i=0),i>100&&(i=100);var a=(0,b.default)("sb-soundplayer-volume",t),l=(0,b.default)("sb-soundplayer-btn sb-soundplayer-volume-btn",n),s=(0,b.default)("sb-soundplayer-volume-range",o);return c.default.createElement("div",{className:a},c.default.createElement("button",{className:l,onClick:this.handleMute.bind(this)},u?c.default.createElement(h.VolumeIconMuteSVG,null):c.default.createElement(h.VolumeIconLoudSVG,null)),c.default.createElement("div",null,c.default.createElement("input",{className:s,type:"range",min:"0",max:"100",step:"1",value:i,onChange:this.handleVolumeChange.bind(this)})))}}]),t}(s.Component);v.propTypes={className:d.default.string,buttonClassName:d.default.string,rangeClassName:d.default.string,volume:d.default.number,onVolumeChange:d.default.func,onToggleMute:d.default.func,soundCloudAudio:d.default.instanceOf(y.default)},v.defaultProps={volume:1,isMuted:0},t.default=v},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Icons=t.Cover=t.Timer=t.Progress=t.PrevButton=t.NextButton=t.PlayButton=t.VolumeControl=void 0;var r=n(17),u=o(r),i=n(13),a=o(i),l=n(12),s=o(l),c=n(14),f=o(c),d=n(15),p=o(d),y=n(16),m=o(y),b=n(11),h=o(b);t.VolumeControl=u.default,t.PlayButton=a.default,t.NextButton=s.default,t.PrevButton=f.default,t.Progress=p.default,t.Timer=m.default,t.Cover=h.default,t.Icons=n(4)},function(e,t,n){"use strict";function o(e,t){if(e)for(var n=0,o=e.length;n<o&&(!e[n]||!t(e[n],n,e));n++);}function r(e){o(i,function(t){t.playing&&t.playing!==e&&t.stop()})}function u(e){var t=!1;o(i,function(n){if(n.playing===e.playing)return t=!0,!0}),t||i.push(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.stopAllOther=r,t.addToPlayedStore=u;var i=[]},function(e,t,n){"use strict";function o(e){return function(){return e}}var r=function(){};r.thatReturns=o,r.thatReturnsFalse=o(!1),r.thatReturnsTrue=o(!0),r.thatReturnsNull=o(null),r.thatReturnsThis=function(){return this},r.thatReturnsArgument=function(e){return e},e.exports=r},function(e,t,n){"use strict";function o(e,t,n,o,u,i,a,l){if(r(t),!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,o,u,i,a,l],f=0;s=new Error(t.replace(/%s/g,function(){return c[f++]})),s.name="Invariant Violation"}throw s.framesToPop=1,s}}var r=function(e){};e.exports=o},function(e,t,n){"use strict";var o={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,mixins:!0,propTypes:!0,type:!0},r={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},u=Object.defineProperty,i=Object.getOwnPropertyNames,a=Object.getOwnPropertySymbols,l=Object.getOwnPropertyDescriptor,s=Object.getPrototypeOf,c=s&&s(Object);e.exports=function e(t,n,f){if("string"!=typeof n){if(c){var d=s(n);d&&d!==c&&e(t,d,f)}var p=i(n);a&&(p=p.concat(a(n)));for(var y=0;y<p.length;++y){var m=p[y];if(!(o[m]||r[m]||f&&f[m])){var b=l(n,m);try{u(t,m,b)}catch(e){}}}return t}return t}},function(e,t,n){"use strict";var o=n(20),r=n(21),u=n(24);e.exports=function(){function e(e,t,n,o,i,a){a!==u&&r(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=o,n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}])}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("soundcloud-audio")):"function"==typeof define&&define.amd?define("ReactSoundplayer",["react","soundcloud-audio"],t):"object"==typeof exports?exports.ReactSoundplayer=t(require("react"),require("soundcloud-audio")):e.ReactSoundplayer=t(e.React,e.SoundCloudAudio)}(this,function(e,t){return function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=8)}([function(t,n){t.exports=e},function(e,t,n){e.exports=n(23)()},function(e,t,n){var o,r;!function(){"use strict";function n(){for(var e=[],t=0;t<arguments.length;t++){var o=arguments[t];if(o){var r=typeof o;if("string"===r||"number"===r)e.push(o);else if(Array.isArray(o))e.push(n.apply(null,o));else if("object"===r)for(var i in o)u.call(o,i)&&o[i]&&e.push(i)}}return e.join(" ")}var u={}.hasOwnProperty;void 0!==e&&e.exports?e.exports=n:(o=[],void 0!==(r=function(){return n}.apply(t,o))&&(e.exports=r))}()},function(e,n){e.exports=t},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VolumeIconMuteSVG=t.VolumeIconLoudSVG=t.VolumeIconSVG=t.PrevIconSVG=t.NextIconSVG=t.PauseIconSVG=t.PlayIconSVG=t.ButtonIconSVG=t.SoundCloudLogoSVG=void 0;var o=n(0),r=function(e){return e&&e.__esModule?e:{default:e}}(o),u=(t.SoundCloudLogoSVG=function(){return r.default.createElement("svg",{className:"sb-soundplayer-cover-logo",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor"},r.default.createElement("path",{d:"M10.517 3.742c-.323 0-.49.363-.49.582 0 0-.244 3.591-.244 4.641 0 1.602.15 2.621.15 2.621 0 .222.261.401.584.401.321 0 .519-.179.519-.401 0 0 .398-1.038.398-2.639 0-1.837-.153-4.127-.284-4.592-.112-.395-.313-.613-.633-.613zm-1.996.268c-.323 0-.49.363-.49.582 0 0-.244 3.322-.244 4.372 0 1.602.119 2.621.119 2.621 0 .222.26.401.584.401.321 0 .581-.179.581-.401 0 0 .081-1.007.081-2.608 0-1.837-.206-4.386-.206-4.386 0-.218-.104-.581-.425-.581zm-2.021 1.729c-.324 0-.49.362-.49.582 0 0-.272 1.594-.272 2.644 0 1.602.179 2.559.179 2.559 0 .222.229.463.552.463.321 0 .519-.241.519-.463 0 0 .19-.944.19-2.546 0-1.837-.253-2.657-.253-2.657 0-.22-.104-.582-.425-.582zm-2.046-.358c-.323 0-.49.363-.49.582 0 0-.162 1.92-.162 2.97 0 1.602.069 2.496.069 2.496 0 .222.26.557.584.557.321 0 .581-.304.581-.526 0 0 .143-.936.143-2.538 0-1.837-.206-2.96-.206-2.96 0-.218-.198-.581-.519-.581zm-2.169 1.482c-.272 0-.232.218-.232.218v3.982s-.04.335.232.335c.351 0 .716-.832.716-2.348 0-1.245-.436-2.187-.716-2.187zm18.715-.976c-.289 0-.567.042-.832.116-.417-2.266-2.806-3.989-5.263-3.989-1.127 0-2.095.705-2.931 1.316v8.16s0 .484.5.484h8.526c1.655 0 3-1.55 3-3.155 0-1.607-1.346-2.932-3-2.932zm10.17.857c-1.077-.253-1.368-.389-1.368-.815 0-.3.242-.611.97-.611.621 0 1.106.253 1.542.699l.981-.951c-.641-.669-1.417-1.067-2.474-1.067-1.339 0-2.425.757-2.425 1.99 0 1.338.873 1.736 2.124 2.026 1.281.291 1.513.486 1.513.923 0 .514-.379.738-1.184.738-.65 0-1.26-.223-1.736-.777l-.98.873c.514.757 1.504 1.232 2.639 1.232 1.853 0 2.668-.873 2.668-2.163 0-1.477-1.193-1.845-2.27-2.097zm6.803-2.745c-1.853 0-2.949 1.435-2.949 3.502s1.096 3.501 2.949 3.501c1.852 0 2.949-1.434 2.949-3.501s-1.096-3.502-2.949-3.502zm0 5.655c-1.097 0-1.553-.941-1.553-2.153 0-1.213.456-2.153 1.553-2.153 1.096 0 1.551.94 1.551 2.153.001 1.213-.454 2.153-1.551 2.153zm8.939-1.736c0 1.086-.533 1.756-1.396 1.756-.864 0-1.388-.689-1.388-1.775v-3.897h-1.358v3.916c0 1.978 1.106 3.084 2.746 3.084 1.726 0 2.754-1.136 2.754-3.103v-3.897h-1.358v3.916zm8.142-.89l.019 1.485c-.087-.174-.31-.515-.475-.768l-2.703-3.692h-1.362v6.894h1.401v-2.988l-.02-1.484c.088.175.311.514.475.767l2.79 3.705h1.213v-6.894h-1.339v2.975zm5.895-2.923h-2.124v6.791h2.027c1.746 0 3.474-1.01 3.474-3.395 0-2.484-1.437-3.396-3.377-3.396zm-.097 5.472h-.67v-4.152h.719c1.436 0 2.028.688 2.028 2.076 0 1.242-.651 2.076-2.077 2.076zm7.909-4.229c.611 0 1 .271 1.242.737l1.26-.582c-.426-.883-1.202-1.503-2.483-1.503-1.775 0-3.016 1.435-3.016 3.502 0 2.143 1.191 3.501 2.968 3.501 1.232 0 2.047-.572 2.513-1.533l-1.145-.68c-.358.602-.718.864-1.329.864-1.019 0-1.611-.932-1.611-2.153-.001-1.261.583-2.153 1.601-2.153zm5.17-1.192h-1.359v6.791h4.083v-1.338h-2.724v-5.453zm6.396-.157c-1.854 0-2.949 1.435-2.949 3.502s1.095 3.501 2.949 3.501c1.853 0 2.95-1.434 2.95-3.501s-1.097-3.502-2.95-3.502zm0 5.655c-1.097 0-1.553-.941-1.553-2.153 0-1.213.456-2.153 1.553-2.153 1.095 0 1.55.94 1.55 2.153.001 1.213-.454 2.153-1.55 2.153zm8.557-1.736c0 1.086-.532 1.756-1.396 1.756-.864 0-1.388-.689-1.388-1.775v-3.794h-1.358v3.813c0 1.978 1.106 3.084 2.746 3.084 1.726 0 2.755-1.136 2.755-3.103v-3.794h-1.36v3.813zm5.449-3.907h-2.318v6.978h2.211c1.908 0 3.789-1.037 3.789-3.489 0-2.552-1.565-3.489-3.682-3.489zm-.108 5.623h-.729v-4.266h.783c1.565 0 2.21.706 2.21 2.133.001 1.276-.707 2.133-2.264 2.133z"}))},t.ButtonIconSVG=function(e){return r.default.createElement("svg",{className:"sb-soundplayer-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor"},e.children)}),i=(t.PlayIconSVG=function(){return r.default.createElement(u,null,r.default.createElement("path",{d:"M0 0 L32 16 L0 32 z"}))},t.PauseIconSVG=function(){return r.default.createElement(u,null,r.default.createElement("path",{d:"M0 0 H12 V32 H0 z M20 0 H32 V32 H20 z"}))},t.NextIconSVG=function(){return r.default.createElement(u,null,r.default.createElement("path",{d:"M4 4 L24 14 V4 H28 V28 H24 V18 L4 28 z "}))},t.PrevIconSVG=function(){return r.default.createElement(u,null,r.default.createElement("path",{d:"M4 4 H8 V14 L28 4 V28 L8 18 V28 H4 z "}))},t.VolumeIconSVG=function(e){return r.default.createElement("svg",{className:"sb-soundplayer-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 75 75",fill:"currentColor",stroke:"currentColor"},e.children)});t.VolumeIconLoudSVG=function(){return r.default.createElement(i,null,r.default.createElement("polygon",{points:"39.389,13.769 22.235,28.606 6,28.606 6,47.699 21.989,47.699 39.389,62.75 39.389,13.769",style:{strokeWidth:5,strokeLinejoin:"round"}}),r.default.createElement("path",{d:"M 48.128,49.03 C 50.057,45.934 51.19,42.291 51.19,38.377 C 51.19,34.399 50.026,30.703 48.043,27.577",style:{fill:"none",strokeWidth:5,strokeLinecap:"round"}}),r.default.createElement("path",{d:"M 55.082,20.537 C 58.777,25.523 60.966,31.694 60.966,38.377 C 60.966,44.998 58.815,51.115 55.178,56.076",style:{fill:"none",strokeWidth:5,strokeLinecap:"round"}}),r.default.createElement("path",{d:"M 61.71,62.611 C 66.977,55.945 70.128,47.531 70.128,38.378 C 70.128,29.161 66.936,20.696 61.609,14.01",style:{fill:"none",strokeWidth:5,strokeLinecap:"round"}}))},t.VolumeIconMuteSVG=function(){return r.default.createElement(i,null,r.default.createElement("polygon",{points:"39.389,13.769 22.235,28.606 6,28.606 6,47.699 21.989,47.699 39.389,62.75 39.389,13.769",style:{stroke:"#11111",strokeWidth:5,strokeLinejoin:"round"}}),r.default.createElement("path",{d:"M 48.651772,50.269646 69.395223,25.971024",style:{fill:"none",strokeWidth:5,strokeLinecap:"round"}}),r.default.createElement("path",{d:"M 69.395223,50.269646 48.651772,25.971024",style:{fill:"none",strokeWidth:5,strokeLinecap:"round"}}))}},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":c(t))&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":c(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)}function l(e){return e.displayName||e.name||"Component"}function s(e){var t=function(t){function n(e,t){u(this,n);var o=i(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e,t));return e.clientId||e.soundCloudAudio||e.streamUrl||console.warn("You need to get a clientId from SoundCloud,\n pass in an instance of SoundCloudAudio\n or use streamUrl with audio source instead\n https://github.com/soundblogs/react-soundplayer#examples"),"undefined"!=typeof window&&(e.soundCloudAudio?o.soundCloudAudio=e.soundCloudAudio:o.soundCloudAudio=new b.default(e.clientId)),o.state={duration:0,currentTime:0,seeking:!1,playing:!1,volume:1,isMuted:!1},o}return a(n,t),d(n,[{key:"componentDidMount",value:function(){this.mounted=!0,this.requestAudio(),this.listenAudioEvents()}},{key:"componentWillUnmount",value:function(){this.mounted=!1,(0,g.resetPlayedStore)(),this.soundCloudAudio.unbindAll()}},{key:"requestAudio",value:function(){var e=this,t=this.soundCloudAudio,n=this.props,o=n.resolveUrl,u=n.streamUrl,i=n.preloadType,a=n.onReady;u?t.preload(u,i):o&&t.resolve(o,function(t){e.mounted&&e.setState(r({},t.tracks?"playlist":"track",t),function(){return a&&a()})})}},{key:"listenAudioEvents",value:function(){var e=this.soundCloudAudio;e.on("playing",this.onAudioStarted.bind(this)),e.on("timeupdate",this.getCurrentTime.bind(this)),e.on("loadedmetadata",this.getDuration.bind(this)),e.on("seeking",this.onSeekingTrack.bind(this)),e.on("seeked",this.onSeekedTrack.bind(this)),e.on("pause",this.onAudioPaused.bind(this)),e.on("ended",this.onAudioEnded.bind(this)),e.on("volumechange",this.onVolumeChange.bind(this))}},{key:"onSeekingTrack",value:function(){this.setState({seeking:!0})}},{key:"onSeekedTrack",value:function(){this.setState({seeking:!1})}},{key:"onAudioStarted",value:function(){var e=this.soundCloudAudio,t=this.props.onStartTrack;this.setState({playing:!0}),(0,g.stopAllOther)(e.playing),(0,g.addToPlayedStore)(e),t&&t(e,e.playing)}},{key:"onAudioPaused",value:function(){var e=this.props.onPauseTrack;this.setState({playing:!1}),e&&e(this.soundCloudAudio)}},{key:"onAudioEnded",value:function(){var e=this.props.onStopTrack;this.setState({playing:!1}),e&&e(this.soundCloudAudio)}},{key:"onVolumeChange",value:function(){this.setState({volume:this.soundCloudAudio.audio.volume,isMuted:this.soundCloudAudio.audio.muted})}},{key:"getCurrentTime",value:function(){this.setState({currentTime:this.soundCloudAudio.audio.currentTime})}},{key:"getDuration",value:function(){this.setState({duration:this.soundCloudAudio.audio.duration})}},{key:"render",value:function(){return y.default.createElement(e,f({},this.props,{soundCloudAudio:this.soundCloudAudio},this.state))}}]),n}(p.Component);return t.displayName="withSoundCloudAudio("+l(e)+")",t.WrappedComponent=e,(0,v.default)(t,e)}var c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};Object.defineProperty(t,"__esModule",{value:!0});var f=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},d=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}}();t.default=s;var p=n(0),y=o(p),m=n(3),b=o(m),h=n(22),v=o(h),g=n(19)},function(e,t,n){"use strict";e.exports=n(10)},function(e,t,n){"use strict";e.exports=n(18)},function(e,t,n){"use strict";e.exports={components:n(7),addons:n(6)}},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 u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":a(t))&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":a(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)}var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};Object.defineProperty(t,"__esModule",{value:!0});var l=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}}(),s=n(0),c=o(s),f=n(1),d=o(f),p=n(3),y=o(p),m=n(5),b=o(m),h=function(e){function t(){return r(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),l(t,[{key:"wrapChild",value:function(e){return c.default.cloneElement(e,this.props)}},{key:"componentWillMount",value:function(){console.warn("\n <SoundPlayerContainer /> is deprecated! Please use HOC addons/withSoundCloudAudio instead.\n https://reactjs.org/docs/higher-order-components.html\n https://labs.voronianski.com/react-soundplayer/#Containers\n ")}},{key:"render",value:function(){var e=this.props.children;if(e)return Array.isArray(e)?c.default.createElement("span",null,c.default.Children.map(e,this.wrapChild.bind(this))):this.wrapChild(e)}}]),t}(s.Component);h.propTypes={streamUrl:d.default.string,resolveUrl:d.default.string,clientId:d.default.string,soundCloudAudio:d.default.instanceOf(y.default),onStartTrack:d.default.func,onStopTrack:d.default.func,onPauseTrack:d.default.func,onVolumeChange:d.default.func,onReady:d.default.func},t.default=(0,b.default)(h)},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.SoundPlayerContainer=t.withSoundCloudAudio=t.withCustomAudio=void 0;var r=n(5),u=o(r),i=n(9),a=o(i);t.withCustomAudio=u.default,t.withSoundCloudAudio=u.default,t.SoundPlayerContainer=a.default},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 u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":a(t))&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":a(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)}var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};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}}(),c=n(0),f=o(c),d=n(1),p=o(d),y=n(2),m=o(y),b=n(4),h=function(e){function t(){return r(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),s(t,[{key:"render",value:function(){var e=this.props,t=e.backgroundUrl,n=e.trackName,o=e.artistName,r=e.className,u=e.style,i=e.children,a=(0,m.default)("sb-soundplayer-cover",r);return f.default.createElement("div",{className:a,style:l({},u,{backgroundImage:"url("+t+")"})},f.default.createElement("div",null,f.default.createElement(b.SoundCloudLogoSVG,null)),f.default.createElement("div",null,f.default.createElement("span",{className:"sb-soundplayer-track sb-soundplayer-info-box"},n)),f.default.createElement("div",null,f.default.createElement("span",{className:"sb-soundplayer-artist sb-soundplayer-info-box"},"by ",o)),f.default.Children.map(i,f.default.cloneElement))}}]),t}(c.Component);h.propTypes={className:p.default.string,backgroundUrl:p.default.string.isRequired,trackName:p.default.string.isRequired,artistName:p.default.string.isRequired},h.defaultProps={style:{}},t.default=h},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 u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":a(t))&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":a(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)}var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};Object.defineProperty(t,"__esModule",{value:!0});var l=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}}(),s=n(0),c=o(s),f=n(1),d=o(f),p=n(2),y=o(p),m=n(3),b=o(m),h=n(4),v=function(e){function t(){return r(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),l(t,[{key:"shouldComponentUpdate",value:function(){return!1}},{key:"handleClick",value:function(e){var t=this.props,n=t.soundCloudAudio,o=t.onNextClick;n&&n.next(),o&&o(e)}},{key:"render",value:function(){var e=this.props,t=e.className,n=e.style,o=(0,y.default)("sb-soundplayer-btn sb-soundplayer-next-btn",t);return c.default.createElement("button",{type:"button",className:o,style:n,onClick:this.handleClick.bind(this)},c.default.createElement(h.NextIconSVG,null))}}]),t}(s.Component);v.propTypes={className:d.default.string,onNextClick:d.default.func,soundCloudAudio:d.default.instanceOf(b.default)},t.default=v},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 u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":a(t))&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":a(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)}var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};Object.defineProperty(t,"__esModule",{value:!0});var l=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}}(),s=n(0),c=o(s),f=n(1),d=o(f),p=n(2),y=o(p),m=n(3),b=o(m),h=n(4),v=function(e){function t(){return r(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),l(t,[{key:"shouldComponentUpdate",value:function(e){var t=this.props,n=t.playing,o=t.seeking;return n!==e.playing||o!==e.seeking}},{key:"handleClick",value:function(e){var t=this.props,n=t.playing,o=t.soundCloudAudio,r=t.onTogglePlay;n?o&&o.pause():o&&o.play({playlistIndex:o._playlistIndex}),r&&r(e)}},{key:"render",value:function(){var e=this.props,t=e.playing,n=e.seekingIcon,o=e.seeking,r=e.className,u=e.style,i=void 0;i=o&&n?c.default.cloneElement(n):t?c.default.createElement(h.PauseIconSVG,null):c.default.createElement(h.PlayIconSVG,null);var a=(0,y.default)("sb-soundplayer-btn sb-soundplayer-play-btn",r);return c.default.createElement("button",{type:"button",className:a,style:u,onClick:this.handleClick.bind(this)},i)}}]),t}(s.Component);v.propTypes={className:d.default.string,seeking:d.default.bool,playing:d.default.bool,onTogglePlay:d.default.func,seekingIcon:d.default.node,soundCloudAudio:d.default.instanceOf(b.default)},v.defaultProps={playing:!1,seeking:!1},t.default=v},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 u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":a(t))&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":a(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)}var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};Object.defineProperty(t,"__esModule",{value:!0});var l=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}}(),s=n(0),c=o(s),f=n(1),d=o(f),p=n(2),y=o(p),m=n(3),b=o(m),h=n(4),v=function(e){function t(){return r(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),l(t,[{key:"shouldComponentUpdate",value:function(){return!1}},{key:"handleClick",value:function(e){var t=this.props,n=t.soundCloudAudio,o=t.onPrevClick;n&&n.previous(),o&&o(e)}},{key:"render",value:function(){var e=this.props,t=e.className,n=e.style,o=(0,y.default)("sb-soundplayer-btn sb-soundplayer-prev-btn",t);return c.default.createElement("button",{type:"button",className:o,style:n,onClick:this.handleClick.bind(this)},c.default.createElement(h.PrevIconSVG,null))}}]),t}(s.Component);v.propTypes={className:d.default.string,onPrevClick:d.default.func,soundCloudAudio:d.default.instanceOf(b.default)},t.default=v},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 u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":a(t))&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":a(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)}var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};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}}(),c=n(0),f=o(c),d=n(1),p=o(d),y=n(3),m=o(y),b=n(2),h=o(b),v=function(e){function t(){return r(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),s(t,[{key:"handleSeekTrack",value:function(e){var t=this.props,n=t.onSeekTrack,o=t.soundCloudAudio,r=(e.pageX-e.currentTarget.getBoundingClientRect().left)/e.currentTarget.offsetWidth;o&&!isNaN(o.audio.duration)&&(o.audio.currentTime=r*o.audio.duration),n&&n.call(this,r,e)}},{key:"render",value:function(){var e=this.props,t=e.className,n=e.innerClassName,o=e.style,r=e.currentTime,u=e.duration,i=this.props,a=i.value,s=i.innerStyle;!a&&r&&u&&(a=r/u*100||0),a<0&&(a=0),a>100&&(a=100);var c=(0,h.default)("sb-soundplayer-progress-container",t),d=(0,h.default)("sb-soundplayer-progress-inner",n);return s||(s={}),s=l({},s,{width:a+"%"}),f.default.createElement("div",{className:c,style:o,onClick:this.handleSeekTrack.bind(this)},f.default.createElement("div",{className:d,style:s}))}}]),t}(c.Component);v.propTypes={className:p.default.string,innerClassName:p.default.string,innerStyle:p.default.object,value:p.default.number,onSeekTrack:p.default.func,soundCloudAudio:p.default.instanceOf(m.default)},v.defaultProps={value:0},t.default=v},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 u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":a(t))&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":a(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)}var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};Object.defineProperty(t,"__esModule",{value:!0});var l=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}}(),s=n(0),c=o(s),f=n(1),d=o(f),p=n(2),y=o(p),m=function(e){function t(){return r(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),l(t,[{key:"render",value:function(){var e=this.props,n=e.currentTime,o=e.className,r=e.style,u=e.soundCloudAudio,i=this.props.duration,a=(0,y.default)("sb-soundplayer-timer",o);return!i&&u&&u.duration&&(i=u.duration),c.default.createElement("div",{className:a,style:r},t.prettyTime(n)," / ",t.prettyTime(i))}}],[{key:"prettyTime",value:function(e){var t=Math.floor(e/3600),n="0"+Math.floor(e%3600/60),o="0"+Math.floor(e%60);return n=n.substr(n.length-2),o=o.substr(o.length-2),isNaN(o)?"00:00":t?t+":"+n+":"+o:n+":"+o}}]),t}(s.Component);m.propTypes={className:d.default.string,duration:d.default.oneOfType([d.default.string,d.default.number]),currentTime:d.default.oneOfType([d.default.string,d.default.number])},m.defaultProps={duration:0,currentTime:0},t.default=m},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 u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":a(t))&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":a(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)}var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};Object.defineProperty(t,"__esModule",{value:!0});var l=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}}(),s=n(0),c=o(s),f=n(1),d=o(f),p=n(3),y=o(p),m=n(2),b=o(m),h=n(4),v=function(e){function t(){return r(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),l(t,[{key:"handleVolumeChange",value:function(e){var t=this.props,n=t.onVolumeChange,o=t.onToggleMute,r=t.soundCloudAudio,u=t.isMuted,i=e.target.value/100,a=i<=0&&!u;r&&!isNaN(r.audio.volume)&&(r.audio.volume=i,r.audio.muted=a),a!==u&&o&&o.call(this,a,e),n&&n.call(this,i,e)}},{key:"handleMute",value:function(e){var t=this.props,n=t.onToggleMute,o=t.soundCloudAudio;o&&!isNaN(o.audio.muted)&&(o.audio.muted=!o.audio.muted),n&&n.call(this,!this.props.isMuted,e)}},{key:"render",value:function(){var e=this.props,t=e.className,n=e.buttonClassName,o=e.rangeClassName,r=e.volume,u=e.isMuted,i=100*r||0;(i<0||u)&&(i=0),i>100&&(i=100);var a=(0,b.default)("sb-soundplayer-volume",t),l=(0,b.default)("sb-soundplayer-btn sb-soundplayer-volume-btn",n),s=(0,b.default)("sb-soundplayer-volume-range",o);return c.default.createElement("div",{className:a},c.default.createElement("button",{className:l,onClick:this.handleMute.bind(this)},u?c.default.createElement(h.VolumeIconMuteSVG,null):c.default.createElement(h.VolumeIconLoudSVG,null)),c.default.createElement("div",null,c.default.createElement("input",{className:s,type:"range",min:"0",max:"100",step:"1",value:i,onChange:this.handleVolumeChange.bind(this)})))}}]),t}(s.Component);v.propTypes={className:d.default.string,buttonClassName:d.default.string,rangeClassName:d.default.string,volume:d.default.number,onVolumeChange:d.default.func,onToggleMute:d.default.func,soundCloudAudio:d.default.instanceOf(y.default)},v.defaultProps={volume:1,isMuted:0},t.default=v},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Icons=t.Cover=t.Timer=t.Progress=t.PrevButton=t.NextButton=t.PlayButton=t.VolumeControl=void 0;var r=n(17),u=o(r),i=n(13),a=o(i),l=n(12),s=o(l),c=n(14),f=o(c),d=n(15),p=o(d),y=n(16),m=o(y),b=n(11),h=o(b);t.VolumeControl=u.default,t.PlayButton=a.default,t.NextButton=s.default,t.PrevButton=f.default,t.Progress=p.default,t.Timer=m.default,t.Cover=h.default,t.Icons=n(4)},function(e,t,n){"use strict";function o(e,t){if(e)for(var n=0,o=e.length;n<o&&(!e[n]||!t(e[n],n,e));n++);}function r(e){o(a,function(t){t.playing&&t.playing!==e&&t.stop()})}function u(e){var t=!1;o(a,function(n){if(n.playing===e.playing)return t=!0,!0}),t||a.push(e)}function i(){o(a,function(e){e.stop()}),a=[]}Object.defineProperty(t,"__esModule",{value:!0}),t.stopAllOther=r,t.addToPlayedStore=u,t.resetPlayedStore=i;var a=[]},function(e,t,n){"use strict";function o(e){return function(){return e}}var r=function(){};r.thatReturns=o,r.thatReturnsFalse=o(!1),r.thatReturnsTrue=o(!0),r.thatReturnsNull=o(null),r.thatReturnsThis=function(){return this},r.thatReturnsArgument=function(e){return e},e.exports=r},function(e,t,n){"use strict";function o(e,t,n,o,u,i,a,l){if(r(t),!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,o,u,i,a,l],f=0;s=new Error(t.replace(/%s/g,function(){return c[f++]})),s.name="Invariant Violation"}throw s.framesToPop=1,s}}var r=function(e){};e.exports=o},function(e,t,n){"use strict";var o={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,mixins:!0,propTypes:!0,type:!0},r={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},u=Object.defineProperty,i=Object.getOwnPropertyNames,a=Object.getOwnPropertySymbols,l=Object.getOwnPropertyDescriptor,s=Object.getPrototypeOf,c=s&&s(Object);e.exports=function e(t,n,f){if("string"!=typeof n){if(c){var d=s(n);d&&d!==c&&e(t,d,f)}var p=i(n);a&&(p=p.concat(a(n)));for(var y=0;y<p.length;++y){var m=p[y];if(!(o[m]||r[m]||f&&f[m])){var b=l(n,m);try{u(t,m,b)}catch(e){}}}return t}return t}},function(e,t,n){"use strict";var o=n(20),r=n(21),u=n(24);e.exports=function(){function e(e,t,n,o,i,a){a!==u&&r(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=o,n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}])}); |
@@ -79,2 +79,3 @@ 'use strict'; | ||
this.mounted = true; | ||
this.requestAudio(); | ||
@@ -87,2 +88,4 @@ this.listenAudioEvents(); | ||
this.mounted = false; | ||
(0, _audioStore.resetPlayedStore)(); | ||
this.soundCloudAudio.unbindAll(); | ||
@@ -89,0 +92,0 @@ } |
@@ -8,2 +8,3 @@ "use strict"; | ||
exports.addToPlayedStore = addToPlayedStore; | ||
exports.resetPlayedStore = resetPlayedStore; | ||
// handling multiple audio on the page helpers | ||
@@ -43,2 +44,10 @@ var _playedAudios = []; | ||
} | ||
} | ||
function resetPlayedStore() { | ||
each(_playedAudios, function (soundCloudAudio) { | ||
soundCloudAudio.stop(); | ||
}); | ||
_playedAudios = []; | ||
} |
{ | ||
"name": "react-soundplayer", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Create custom SoundCloud players with React", | ||
@@ -31,2 +31,6 @@ "main": "index.js", | ||
], | ||
"engines": { | ||
"node": ">=8.0.0", | ||
"npm": ">=5.5.0" | ||
}, | ||
"author": "Dmitri Voronianski <dmitri.voronianski@gmail.com>", | ||
@@ -39,3 +43,2 @@ "license": "MIT", | ||
"prop-types": "^15.6.0", | ||
"react": "^16.0.0", | ||
"soundcloud-audio": "^1.2.2" | ||
@@ -59,2 +62,3 @@ }, | ||
"postcss-import": "^11.0.0", | ||
"react": "^16.0.0", | ||
"webpack": "^2.7.0", | ||
@@ -61,0 +65,0 @@ "webpack-umd-external": "^1.0.2" |
import React, { Component } from 'react'; | ||
import SoundCloudAudio from 'soundcloud-audio'; | ||
import hoistStatics from 'hoist-non-react-statics'; | ||
import { stopAllOther, addToPlayedStore } from '../utils/audioStore.js'; | ||
import { | ||
stopAllOther, | ||
addToPlayedStore, | ||
resetPlayedStore | ||
} from '../utils/audioStore.js'; | ||
@@ -46,2 +50,3 @@ function getDisplayName (WrappedComponent) { | ||
this.mounted = true; | ||
this.requestAudio(); | ||
@@ -53,2 +58,4 @@ this.listenAudioEvents(); | ||
this.mounted = false; | ||
resetPlayedStore(); | ||
this.soundCloudAudio.unbindAll(); | ||
@@ -55,0 +62,0 @@ } |
// handling multiple audio on the page helpers | ||
const _playedAudios = []; | ||
let _playedAudios = []; | ||
@@ -36,1 +36,9 @@ function each (arr, cb) { | ||
} | ||
export function resetPlayedStore () { | ||
each(_playedAudios, soundCloudAudio => { | ||
soundCloudAudio.stop(); | ||
}); | ||
_playedAudios = []; | ||
} |
Sorry, the diff of this file is too big to display
5
230578
18
47
4461
- Removedreact@^16.0.0
- Removedreact@16.14.0(transitive)