New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-soundplayer

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-soundplayer - npm Package Compare versions

Comparing version 0.3.6 to 1.0.0-rc1

.babelrc

9

lib/addons/index.js
'use strict';
Object.defineProperty(exports, '__esModule', {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.SoundPlayerContainer = undefined;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _SoundPlayerContainer2 = require('./SoundPlayerContainer');

@@ -13,2 +12,4 @@

exports.SoundPlayerContainer = _SoundPlayerContainer3['default'];
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.SoundPlayerContainer = _SoundPlayerContainer3.default;
'use strict';
Object.defineProperty(exports, '__esModule', {
Object.defineProperty(exports, "__esModule", {
value: true
});
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; }; })();
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; }; }();
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
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 _react = require('react');

@@ -31,8 +21,15 @@

var _utilsAudioStoreJs = require('../utils/audioStore.js');
var _audioStore = require('../utils/audioStore.js');
var PropTypes = _react2['default'].PropTypes;
var Component = _react2['default'].Component;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var SoundPlayerContainer = (function (_Component) {
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
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 SoundPlayerContainer = function (_Component) {
_inherits(SoundPlayerContainer, _Component);

@@ -43,6 +40,6 @@

_get(Object.getPrototypeOf(SoundPlayerContainer.prototype), 'constructor', this).call(this, props, context);
var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(SoundPlayerContainer).call(this, props, context));
if (!props.clientId) {
throw new Error('You need to get clientId from SoundCloud\n https://github.com/soundblogs/react-soundplayer#usage');
if (!props.clientId && !props.soundCloudAudio) {
throw new Error('You need to get a clientId from SoundCloud,\n or pass in an instance of SoundCloudAudio.\n https://github.com/soundblogs/react-soundplayer#usage');
}

@@ -53,6 +50,10 @@

if ('undefined' !== typeof window) {
this.soundCloudAudio = new _soundcloudAudio2['default'](props.clientId);
if (props.soundCloudAudio) {
_this.soundCloudAudio = props.soundCloudAudio;
} else {
_this.soundCloudAudio = new _soundcloudAudio2.default(props.clientId);
}
}
this.state = {
_this.state = {
duration: 0,

@@ -63,3 +64,4 @@ currentTime: 0,

};
this.wrapChild = this.wrapChild.bind(this);
_this.wrapChild = _this.wrapChild.bind(_this);
return _this;
}

@@ -70,3 +72,3 @@

value: function componentDidMount() {
var _this = this;
var _this2 = this;

@@ -78,2 +80,3 @@ var soundCloudAudio = this.soundCloudAudio;

if (streamUrl) {

@@ -83,3 +86,3 @@ soundCloudAudio.preload(streamUrl);

soundCloudAudio.resolve(resolveUrl, function (data) {
_this.setState(_defineProperty({}, data.tracks ? 'playlist' : 'track', data));
_this2.setState(_defineProperty({}, data.tracks ? 'playlist' : 'track', data));
});

@@ -100,3 +103,3 @@ }

value: function componentWillReceiveProps(nextProps) {
var _this2 = this;
var _this3 = this;

@@ -123,3 +126,3 @@ var soundCloudAudio = this.soundCloudAudio;

soundCloudAudio.resolve(nextProps.resolveUrl, function (data) {
_this2.setState(_defineProperty({}, data.tracks ? 'playlist' : 'track', data));
_this3.setState(_defineProperty({}, data.tracks ? 'playlist' : 'track', data));
restartIfPlayed();

@@ -150,6 +153,7 @@ });

this.setState({ playing: true });
(0, _utilsAudioStoreJs.stopAllOther)(soundCloudAudio.playing);
(0, _utilsAudioStoreJs.addToPlayedStore)(soundCloudAudio);
(0, _audioStore.stopAllOther)(soundCloudAudio.playing);
(0, _audioStore.addToPlayedStore)(soundCloudAudio);

@@ -189,4 +193,4 @@ onStartTrack && onStartTrack(soundCloudAudio, soundCloudAudio.playing);

value: function wrapChild(child) {
var newProps = (0, _objectAssign2['default'])({}, { soundCloudAudio: this.soundCloudAudio }, this.state);
return _react2['default'].cloneElement(child, newProps);
var newProps = (0, _objectAssign2.default)({}, { soundCloudAudio: this.soundCloudAudio }, this.state);
return _react2.default.cloneElement(child, newProps);
}

@@ -198,2 +202,3 @@ }, {

if (!children) {

@@ -206,9 +211,9 @@ return null;

return this.wrapChild(child);
} else {
return _react2['default'].createElement(
'span',
null,
_react2['default'].Children.map(children, this.wrapChild)
);
}
return _react2.default.createElement(
'span',
null,
_react2.default.Children.map(children, this.wrapChild)
);
}

@@ -218,14 +223,14 @@ }]);

return SoundPlayerContainer;
})(Component);
}(_react.Component);
SoundPlayerContainer.propTypes = {
streamUrl: PropTypes.string,
resolveUrl: PropTypes.string,
clientId: PropTypes.string.isRequired,
onStartTrack: PropTypes.func,
onStopTrack: PropTypes.func,
onPauseTrack: PropTypes.func
streamUrl: _react.PropTypes.string,
resolveUrl: _react.PropTypes.string,
clientId: _react.PropTypes.string,
soundCloudAudio: _react.PropTypes.instanceOf(_soundcloudAudio2.default),
onStartTrack: _react.PropTypes.func,
onStopTrack: _react.PropTypes.func,
onPauseTrack: _react.PropTypes.func
};
exports['default'] = SoundPlayerContainer;
module.exports = exports['default'];
exports.default = SoundPlayerContainer;
'use strict';
Object.defineProperty(exports, '__esModule', {
Object.defineProperty(exports, "__esModule", {
value: true
});
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; }; })();
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; }; }();
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
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 _react = require('react');

@@ -27,6 +19,11 @@

var PropTypes = _react2['default'].PropTypes;
var Component = _react2['default'].Component;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var Cover = (function (_Component) {
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 Cover = function (_Component) {
_inherits(Cover, _Component);

@@ -37,3 +34,3 @@

_get(Object.getPrototypeOf(Cover.prototype), 'constructor', this).apply(this, arguments);
return _possibleConstructorReturn(this, Object.getPrototypeOf(Cover).apply(this, arguments));
}

@@ -52,16 +49,16 @@

var classNames = (0, _classnames2['default'])('sb-soundplayer-cover', className);
var classNames = (0, _classnames2.default)('sb-soundplayer-cover', className);
return _react2['default'].createElement(
return _react2.default.createElement(
'div',
{ className: classNames, style: Object.assign(style, { backgroundImage: 'url(' + backgroundUrl + ')' }) },
_react2['default'].createElement(
_react2.default.createElement(
'div',
null,
_react2['default'].createElement(_Icons.SoundCloudLogoSVG, null)
_react2.default.createElement(_Icons.SoundCloudLogoSVG, null)
),
_react2['default'].createElement(
_react2.default.createElement(
'div',
null,
_react2['default'].createElement(
_react2.default.createElement(
'span',

@@ -72,6 +69,6 @@ { className: 'sb-soundplayer-track sb-soundplayer-info-box' },

),
_react2['default'].createElement(
_react2.default.createElement(
'div',
null,
_react2['default'].createElement(
_react2.default.createElement(
'span',

@@ -83,3 +80,3 @@ { className: 'sb-soundplayer-artist sb-soundplayer-info-box' },

),
_react2['default'].Children.map(children, _react2['default'].cloneElement)
_react2.default.Children.map(children, _react2.default.cloneElement)
);

@@ -90,12 +87,14 @@ }

return Cover;
})(Component);
}(_react.Component);
Cover.propTypes = {
className: PropTypes.string,
backgroundUrl: PropTypes.string.isRequired,
trackName: PropTypes.string.isRequired,
artistName: PropTypes.string.isRequired
className: _react.PropTypes.string,
backgroundUrl: _react.PropTypes.string.isRequired,
trackName: _react.PropTypes.string.isRequired,
artistName: _react.PropTypes.string.isRequired
};
Cover.defaultProps = {
style: {}
};
exports['default'] = Cover;
module.exports = exports['default'];
exports.default = Cover;

@@ -6,210 +6,71 @@ "use strict";

});
exports.PrevIconSVG = exports.NextIconSVG = exports.PauseIconSVG = exports.PlayIconSVG = exports.ButtonIconSVG = exports.SoundCloudLogoSVG = undefined;
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; }; })();
var _react = require("react");
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
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 _react = require('react');
var _react2 = _interopRequireDefault(_react);
var Component = _react2["default"].Component;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// SoundCloud Logo
var SoundCloudLogoSVG = exports.SoundCloudLogoSVG = function SoundCloudLogoSVG() {
return _react2.default.createElement(
"svg",
{
className: "sb-soundplayer-cover-logo",
xmlns: "http://www.w3.org/2000/svg",
fill: "currentColor"
},
_react2.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" })
);
};
var SoundCloudLogoSVG = (function (_Component) {
_inherits(SoundCloudLogoSVG, _Component);
// Player Button Icons
var ButtonIconSVG = exports.ButtonIconSVG = function ButtonIconSVG(props) {
return _react2.default.createElement(
"svg",
{
className: "sb-soundplayer-play-icon",
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 32 32",
fill: "currentColor"
},
props.children
);
};
function SoundCloudLogoSVG() {
_classCallCheck(this, SoundCloudLogoSVG);
// |> Play
var PlayIconSVG = exports.PlayIconSVG = function PlayIconSVG() {
return _react2.default.createElement(
ButtonIconSVG,
null,
_react2.default.createElement("path", { d: "M0 0 L32 16 L0 32 z" })
);
};
_get(Object.getPrototypeOf(SoundCloudLogoSVG.prototype), "constructor", this).apply(this, arguments);
}
// || Pause
var PauseIconSVG = exports.PauseIconSVG = function PauseIconSVG() {
return _react2.default.createElement(
ButtonIconSVG,
null,
_react2.default.createElement("path", { d: "M0 0 H12 V32 H0 z M20 0 H32 V32 H20 z" })
);
};
// Player Button Icons
// |>| Next
var NextIconSVG = exports.NextIconSVG = function NextIconSVG() {
return _react2.default.createElement(
ButtonIconSVG,
null,
_react2.default.createElement("path", { d: "M4 4 L24 14 V4 H28 V28 H24 V18 L4 28 z " })
);
};
_createClass(SoundCloudLogoSVG, [{
key: "shouldComponentUpdate",
value: function shouldComponentUpdate() {
return false;
}
}, {
key: "render",
value: function render() {
return _react2["default"].createElement(
"svg",
{
className: "sb-soundplayer-cover-logo",
xmlns: "http://www.w3.org/2000/svg",
fill: "currentColor"
},
_react2["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" })
);
}
}]);
return SoundCloudLogoSVG;
})(Component);
var ButtonIconSVG = (function (_Component2) {
_inherits(ButtonIconSVG, _Component2);
function ButtonIconSVG() {
_classCallCheck(this, ButtonIconSVG);
_get(Object.getPrototypeOf(ButtonIconSVG.prototype), "constructor", this).apply(this, arguments);
}
// |> Play
_createClass(ButtonIconSVG, [{
key: "render",
value: function render() {
return _react2["default"].createElement(
"svg",
{
className: "sb-soundplayer-play-icon",
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 32 32",
fill: "currentColor"
},
this.props.children
);
}
}]);
return ButtonIconSVG;
})(Component);
var PlayIconSVG = (function (_Component3) {
_inherits(PlayIconSVG, _Component3);
function PlayIconSVG() {
_classCallCheck(this, PlayIconSVG);
_get(Object.getPrototypeOf(PlayIconSVG.prototype), "constructor", this).apply(this, arguments);
}
// || Pause
_createClass(PlayIconSVG, [{
key: "shouldComponentUpdate",
value: function shouldComponentUpdate() {
return false;
}
}, {
key: "render",
value: function render() {
return _react2["default"].createElement(
ButtonIconSVG,
null,
_react2["default"].createElement("path", { d: "M0 0 L32 16 L0 32 z" })
);
}
}]);
return PlayIconSVG;
})(Component);
var PauseIconSVG = (function (_Component4) {
_inherits(PauseIconSVG, _Component4);
function PauseIconSVG() {
_classCallCheck(this, PauseIconSVG);
_get(Object.getPrototypeOf(PauseIconSVG.prototype), "constructor", this).apply(this, arguments);
}
// |>| Next
_createClass(PauseIconSVG, [{
key: "shouldComponentUpdate",
value: function shouldComponentUpdate() {
return false;
}
}, {
key: "render",
value: function render() {
return _react2["default"].createElement(
ButtonIconSVG,
null,
_react2["default"].createElement("path", { d: "M0 0 H12 V32 H0 z M20 0 H32 V32 H20 z" })
);
}
}]);
return PauseIconSVG;
})(Component);
var NextIconSVG = (function (_Component5) {
_inherits(NextIconSVG, _Component5);
function NextIconSVG() {
_classCallCheck(this, NextIconSVG);
_get(Object.getPrototypeOf(NextIconSVG.prototype), "constructor", this).apply(this, arguments);
}
// |<| Prev
_createClass(NextIconSVG, [{
key: "shouldComponentUpdate",
value: function shouldComponentUpdate() {
return false;
}
}, {
key: "render",
value: function render() {
return _react2["default"].createElement(
ButtonIconSVG,
null,
_react2["default"].createElement("path", { d: "M4 4 L24 14 V4 H28 V28 H24 V18 L4 28 z " })
);
}
}]);
return NextIconSVG;
})(Component);
var PrevIconSVG = (function (_Component6) {
_inherits(PrevIconSVG, _Component6);
function PrevIconSVG() {
_classCallCheck(this, PrevIconSVG);
_get(Object.getPrototypeOf(PrevIconSVG.prototype), "constructor", this).apply(this, arguments);
}
_createClass(PrevIconSVG, [{
key: "shouldComponentUpdate",
value: function shouldComponentUpdate() {
return false;
}
}, {
key: "render",
value: function render() {
return _react2["default"].createElement(
ButtonIconSVG,
null,
_react2["default"].createElement("path", { d: "M4 4 H8 V14 L28 4 V28 L8 18 V28 H4 z " })
);
}
}]);
return PrevIconSVG;
})(Component);
exports["default"] = {
SoundCloudLogoSVG: SoundCloudLogoSVG,
PlayIconSVG: PlayIconSVG,
PauseIconSVG: PauseIconSVG,
NextIconSVG: NextIconSVG,
PrevIconSVG: PrevIconSVG
};
module.exports = exports["default"];
// |<| Prev
var PrevIconSVG = exports.PrevIconSVG = function PrevIconSVG() {
return _react2.default.createElement(
ButtonIconSVG,
null,
_react2.default.createElement("path", { d: "M4 4 H8 V14 L28 4 V28 L8 18 V28 H4 z " })
);
};
'use strict';
Object.defineProperty(exports, '__esModule', {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Icons = exports.Cover = exports.Timer = exports.Progress = exports.PrevButton = exports.NextButton = exports.PlayButton = undefined;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _PlayButton2 = require('./PlayButton');

@@ -13,4 +12,2 @@

exports.PlayButton = _PlayButton3['default'];
var _NextButton2 = require('./NextButton');

@@ -20,4 +17,2 @@

exports.NextButton = _NextButton3['default'];
var _PrevButton2 = require('./PrevButton');

@@ -27,4 +22,2 @@

exports.PrevButton = _PrevButton3['default'];
var _Progress2 = require('./Progress');

@@ -34,4 +27,2 @@

exports.Progress = _Progress3['default'];
var _Timer2 = require('./Timer');

@@ -41,4 +32,2 @@

exports.Timer = _Timer3['default'];
var _Cover2 = require('./Cover');

@@ -48,4 +37,2 @@

exports.Cover = _Cover3['default'];
var _Icons2 = require('./Icons');

@@ -55,2 +42,10 @@

exports.Icons = _Icons3['default'];
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.PlayButton = _PlayButton3.default;
exports.NextButton = _NextButton3.default;
exports.PrevButton = _PrevButton3.default;
exports.Progress = _Progress3.default;
exports.Timer = _Timer3.default;
exports.Cover = _Cover3.default;
exports.Icons = _Icons3.default;
'use strict';
Object.defineProperty(exports, '__esModule', {
Object.defineProperty(exports, "__esModule", {
value: true
});
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; }; })();
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; }; }();
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
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 _react = require('react');

@@ -31,6 +23,11 @@

var PropTypes = _react2['default'].PropTypes;
var Component = _react2['default'].Component;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var NextButton = (function (_Component) {
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 NextButton = function (_Component) {
_inherits(NextButton, _Component);

@@ -41,3 +38,3 @@

_get(Object.getPrototypeOf(NextButton.prototype), 'constructor', this).apply(this, arguments);
return _possibleConstructorReturn(this, Object.getPrototypeOf(NextButton).apply(this, arguments));
}

@@ -52,3 +49,3 @@

key: 'handleClick',
value: function handleClick() {
value: function handleClick(e) {
var _props = this.props;

@@ -58,2 +55,3 @@ var soundCloudAudio = _props.soundCloudAudio;

soundCloudAudio && soundCloudAudio.next();

@@ -69,8 +67,8 @@ onNextClick && onNextClick(e);

var classNames = (0, _classnames2['default'])('sb-soundplayer-play-btn', className);
var classNames = (0, _classnames2.default)('sb-soundplayer-play-btn', className);
return _react2['default'].createElement(
return _react2.default.createElement(
'button',
{ type: 'button', className: classNames, style: style, onClick: this.handleClick.bind(this) },
_react2['default'].createElement(_Icons.NextIconSVG, null)
_react2.default.createElement(_Icons.NextIconSVG, null)
);

@@ -81,11 +79,10 @@ }

return NextButton;
})(Component);
}(_react.Component);
NextButton.propTypes = {
className: PropTypes.string,
onNextClick: PropTypes.func,
soundCloudAudio: PropTypes.instanceOf(_soundcloudAudio2['default'])
className: _react.PropTypes.string,
onNextClick: _react.PropTypes.func,
soundCloudAudio: _react.PropTypes.instanceOf(_soundcloudAudio2.default)
};
exports['default'] = NextButton;
module.exports = exports['default'];
exports.default = NextButton;
'use strict';
Object.defineProperty(exports, '__esModule', {
Object.defineProperty(exports, "__esModule", {
value: true
});
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; }; })();
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; }; }();
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
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 _react = require('react');

@@ -31,6 +23,11 @@

var PropTypes = _react2['default'].PropTypes;
var Component = _react2['default'].Component;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var PlayButton = (function (_Component) {
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 PlayButton = function (_Component) {
_inherits(PlayButton, _Component);

@@ -41,3 +38,3 @@

_get(Object.getPrototypeOf(PlayButton.prototype), 'constructor', this).apply(this, arguments);
return _possibleConstructorReturn(this, Object.getPrototypeOf(PlayButton).apply(this, arguments));
}

@@ -62,2 +59,3 @@

if (!playing) {

@@ -81,14 +79,15 @@ soundCloudAudio && soundCloudAudio.play({ playlistIndex: soundCloudAudio._playlistIndex });

var iconNode = undefined;
var iconNode = void 0;
if (seeking && seekingIcon) {
iconNode = _react2['default'].cloneElement(seekingIcon);
iconNode = _react2.default.cloneElement(seekingIcon);
} else if (playing) {
iconNode = _react2['default'].createElement(_Icons.PauseIconSVG, null);
iconNode = _react2.default.createElement(_Icons.PauseIconSVG, null);
} else {
iconNode = _react2['default'].createElement(_Icons.PlayIconSVG, null);
iconNode = _react2.default.createElement(_Icons.PlayIconSVG, null);
}
var classNames = (0, _classnames2['default'])('sb-soundplayer-play-btn', className);
var classNames = (0, _classnames2.default)('sb-soundplayer-play-btn', className);
return _react2['default'].createElement(
return _react2.default.createElement(
'button',

@@ -102,11 +101,11 @@ { type: 'button', className: classNames, style: style, onClick: this.handleClick.bind(this) },

return PlayButton;
})(Component);
}(_react.Component);
PlayButton.propTypes = {
className: PropTypes.string,
seeking: PropTypes.bool,
playing: PropTypes.bool,
onTogglePlay: PropTypes.func,
seekingIcon: PropTypes.node,
soundCloudAudio: PropTypes.instanceOf(_soundcloudAudio2['default'])
className: _react.PropTypes.string,
seeking: _react.PropTypes.bool,
playing: _react.PropTypes.bool,
onTogglePlay: _react.PropTypes.func,
seekingIcon: _react.PropTypes.node,
soundCloudAudio: _react.PropTypes.instanceOf(_soundcloudAudio2.default)
};

@@ -119,3 +118,2 @@

exports['default'] = PlayButton;
module.exports = exports['default'];
exports.default = PlayButton;
'use strict';
Object.defineProperty(exports, '__esModule', {
Object.defineProperty(exports, "__esModule", {
value: true
});
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; }; })();
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; }; }();
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
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 _react = require('react');

@@ -31,6 +23,11 @@

var PropTypes = _react2['default'].PropTypes;
var Component = _react2['default'].Component;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var PrevButton = (function (_Component) {
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 PrevButton = function (_Component) {
_inherits(PrevButton, _Component);

@@ -41,3 +38,3 @@

_get(Object.getPrototypeOf(PrevButton.prototype), 'constructor', this).apply(this, arguments);
return _possibleConstructorReturn(this, Object.getPrototypeOf(PrevButton).apply(this, arguments));
}

@@ -57,2 +54,3 @@

soundCloudAudio && soundCloudAudio.previous();

@@ -68,8 +66,9 @@ onPrevClick && onPrevClick(e);

var classNames = (0, _classnames2['default'])('sb-soundplayer-play-btn', className);
return _react2['default'].createElement(
var classNames = (0, _classnames2.default)('sb-soundplayer-play-btn', className);
return _react2.default.createElement(
'button',
{ type: 'button', className: classNames, style: style, onClick: this.handleClick.bind(this) },
_react2['default'].createElement(_Icons.PrevIconSVG, null)
_react2.default.createElement(_Icons.PrevIconSVG, null)
);

@@ -80,11 +79,10 @@ }

return PrevButton;
})(Component);
}(_react.Component);
PrevButton.propTypes = {
className: PropTypes.string,
onPrevClick: PropTypes.func,
soundCloudAudio: PropTypes.instanceOf(_soundcloudAudio2['default'])
className: _react.PropTypes.string,
onPrevClick: _react.PropTypes.func,
soundCloudAudio: _react.PropTypes.instanceOf(_soundcloudAudio2.default)
};
exports['default'] = PrevButton;
module.exports = exports['default'];
exports.default = PrevButton;
'use strict';
Object.defineProperty(exports, '__esModule', {
Object.defineProperty(exports, "__esModule", {
value: true
});
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; }; })();
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; }; }();
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
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 _react = require('react');

@@ -29,6 +21,11 @@

var PropTypes = _react2['default'].PropTypes;
var Component = _react2['default'].Component;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var Progress = (function (_Component) {
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 Progress = function (_Component) {
_inherits(Progress, _Component);

@@ -39,3 +36,3 @@

_get(Object.getPrototypeOf(Progress.prototype), 'constructor', this).apply(this, arguments);
return _possibleConstructorReturn(this, Object.getPrototypeOf(Progress).apply(this, arguments));
}

@@ -70,2 +67,3 @@

if (!value && currentTime && duration) {

@@ -83,4 +81,4 @@ value = currentTime / duration * 100 || 0;

var classNames = (0, _classnames2['default'])('sb-soundplayer-progress-container', className);
var innerClassNames = (0, _classnames2['default'])('sb-soundplayer-progress-inner', innerClassName);
var classNames = (0, _classnames2.default)('sb-soundplayer-progress-container', className);
var innerClassNames = (0, _classnames2.default)('sb-soundplayer-progress-inner', innerClassName);

@@ -93,6 +91,6 @@ if (!innerStyle) {

return _react2['default'].createElement(
return _react2.default.createElement(
'div',
{ className: classNames, style: style, onClick: this.handleSeekTrack.bind(this) },
_react2['default'].createElement('div', { className: innerClassNames, style: innerStyle })
_react2.default.createElement('div', { className: innerClassNames, style: innerStyle })
);

@@ -103,11 +101,11 @@ }

return Progress;
})(Component);
}(_react.Component);
Progress.propTypes = {
className: PropTypes.string,
innerClassName: _react2['default'].PropTypes.string,
innerStyle: PropTypes.object,
value: _react2['default'].PropTypes.number,
onSeekTrack: PropTypes.func,
soundCloudAudio: PropTypes.instanceOf(_soundcloudAudio2['default'])
className: _react.PropTypes.string,
innerClassName: _react.PropTypes.string,
innerStyle: _react.PropTypes.object,
value: _react.PropTypes.number,
onSeekTrack: _react.PropTypes.func,
soundCloudAudio: _react.PropTypes.instanceOf(_soundcloudAudio2.default)
};

@@ -119,3 +117,2 @@

exports['default'] = Progress;
module.exports = exports['default'];
exports.default = Progress;
'use strict';
Object.defineProperty(exports, '__esModule', {
Object.defineProperty(exports, "__esModule", {
value: true
});
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; }; })();
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; }; }();
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
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 _react = require('react');

@@ -25,6 +17,11 @@

var PropTypes = _react2['default'].PropTypes;
var Component = _react2['default'].Component;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var Timer = (function (_Component) {
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 Timer = function (_Component) {
_inherits(Timer, _Component);

@@ -35,3 +32,3 @@

_get(Object.getPrototypeOf(Timer.prototype), 'constructor', this).apply(this, arguments);
return _possibleConstructorReturn(this, Object.getPrototypeOf(Timer).apply(this, arguments));
}

@@ -49,3 +46,3 @@

var classNames = (0, _classnames2['default'])('sb-soundplayer-timer', className);
var classNames = (0, _classnames2.default)('sb-soundplayer-timer', className);

@@ -56,3 +53,3 @@ if (!duration && soundCloudAudio.duration) {

return _react2['default'].createElement(
return _react2.default.createElement(
'div',

@@ -78,8 +75,6 @@ { className: classNames, style: style },

return hours + ':' + mins + ':' + secs;
} else {
return mins + ':' + secs;
}
} else {
return '00:00';
return mins + ':' + secs;
}
return '00:00';
}

@@ -89,8 +84,8 @@ }]);

return Timer;
})(Component);
}(_react.Component);
Timer.propTypes = {
className: PropTypes.string,
duration: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
currentTime: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
className: _react.PropTypes.string,
duration: _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.number]),
currentTime: _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.number])
};

@@ -103,3 +98,2 @@

exports['default'] = Timer;
module.exports = exports['default'];
exports.default = Timer;

@@ -1,2 +0,1 @@

// handling multiple audio on the page helpers
"use strict";

@@ -9,2 +8,3 @@

exports.addToPlayedStore = addToPlayedStore;
// handling multiple audio on the page helpers
var _playedAudios = [];

@@ -11,0 +11,0 @@

{
"name": "react-soundplayer",
"version": "0.3.6",
"version": "1.0.0-rc1",
"description": "Create custom SoundCloud players with React",

@@ -9,7 +9,13 @@ "main": "index.js",

},
"repository": {
"type": "git",
"url": "git://github.com/soundblogs/react-soundplayer.git"
},
"scripts": {
"build-js": "rm -rf ./lib && babel src -d lib --stage 0",
"build-js": "rm -rf ./lib && babel src -d lib",
"build-css": "rm -rf ./styles && mkdir styles && node .cssnext",
"build": "npm run build-js && npm run build-css",
"prepublish": "npm run build"
"lint": "eslint ./src --fix",
"prepublish": "npm run build",
"prepush": "npm run lint"
},

@@ -29,18 +35,20 @@ "keywords": [

"object-assign": "^4.0.1",
"react": "^15.3.0",
"soundcloud-audio": "^1.0.3"
},
"peerDependencies": {
"react": "^0.14.x",
"react-dom": "^0.14.x"
},
"devDependencies": {
"babel": "^5.1.2",
"babelify": "^6.0.2",
"basscss": "^6.0.0",
"browserify": "^9.0.8",
"babel-cli": "^6.11.4",
"babel-eslint": "^6.1.2",
"babel-preset-es2015": "^6.13.1",
"babel-preset-react": "^6.11.1",
"babel-preset-stage-0": "^6.5.0",
"cssnext": "^1.2.3",
"envify": "^3.4.0",
"highlight.js": "^8.5.0",
"watchify": "^2.4.0"
"eslint": "^3.2.2",
"eslint-config-airbnb": "^10.0.0",
"eslint-import-resolver-node": "^0.2.2",
"eslint-plugin-import": "^1.12.0",
"eslint-plugin-jsx-a11y": "^2.0.1",
"eslint-plugin-react": "^6.0.0",
"husky": "^0.11.6"
}
}

@@ -62,6 +62,6 @@ # <img src="http://www.officialpsds.com/images/thumbs/Soundcloud-Logo-psd47614.png" width="75" align="left">&nbsp;react-soundplayer

Play or pause track.
Play or pause track.
```javascript
<PlayButton
<PlayButton
className={String}

@@ -71,3 +71,3 @@ playing={Boolean}

seekingIcon={
ReactElement
ReactElement
/*optional icon that will be showed when track is seeking new position to play*/

@@ -85,3 +85,3 @@ }

```javascript
<NextButton
<NextButton
className={String}

@@ -112,3 +112,3 @@ onNextClick={Function}

```javascript
<Progress
<Progress
className={String}

@@ -118,5 +118,5 @@ innerClassName={String}

onSeekTrack={
Function
Function
/*receives `x` position as first argument and `event` as second*/
}
}
/>

@@ -131,3 +131,3 @@ ```

<Timer
className={String}
className={String}
duration={Number}

@@ -177,3 +177,3 @@ currentTime={Number}

_(String)_ - pass here pure stream url as it's returned by [SoundCloud API](https://developers.soundcloud.com/docs/api/reference#tracks), it has higher priority than `resolveUrl`, example:
_(String)_ - pass here pure stream url as it's returned by [SoundCloud API](https://developers.soundcloud.com/docs/api/reference#tracks), it has higher priority than `resolveUrl`, example:

@@ -200,3 +200,3 @@ ```javascript

<div>
<SoundPlayerContainer streamUrl={streamUrl} clientId={client}>
<SoundPlayerContainer streamUrl={streamUrl} clientId={clientId}>
{/* your custom player components */}

@@ -210,2 +210,4 @@ </SoundPlayerContainer>

```
##### `soundCloudAudio`
_(object)_ - Use instead of `clientId` to pass in a pre-existing instance of `soundCloudAudio` for `SoundPlayerContainer` to wrap.

@@ -235,3 +237,3 @@ ### Children Props

let { track } = this.props;
if (!track) {

@@ -263,3 +265,3 @@ return <div>Loading...</div>;

let text = playing ? 'Pause' : 'Play';
if (!track) {

@@ -266,0 +268,0 @@ return <div>Loading...</div>;

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc