@lls/lls-audio 0.0.20 → 0.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/player/index.js +9 -17
package/package.json
CHANGED
package/player/index.js
CHANGED
|
@@ -84,19 +84,10 @@ var Player = function (_Component) {
|
|
|
84
84
|
return _this.refs.audio.setRange(range);
|
|
85
85
|
};
|
|
86
86
|
|
|
87
|
-
_this.toggleVisible = function () {
|
|
88
|
-
var visible = _this.state.visible;
|
|
89
|
-
|
|
90
|
-
_this.setState({
|
|
91
|
-
visible: !visible
|
|
92
|
-
});
|
|
93
|
-
};
|
|
94
|
-
|
|
95
87
|
_this.state = {
|
|
96
88
|
waveform: false,
|
|
97
89
|
loading: true,
|
|
98
|
-
containerWidth: 0
|
|
99
|
-
visible: true
|
|
90
|
+
containerWidth: 0
|
|
100
91
|
};
|
|
101
92
|
_this.setContainerWidth = (0, _utils.debounce)(_this.setContainerWidth.bind(_this), 500);
|
|
102
93
|
_this.onKeyPress = _this.onKeyPress.bind(_this);
|
|
@@ -122,7 +113,7 @@ var Player = function (_Component) {
|
|
|
122
113
|
}, {
|
|
123
114
|
key: 'componentWillReceiveProps',
|
|
124
115
|
value: function componentWillReceiveProps(newProps) {
|
|
125
|
-
if (newProps.src !== this.props.src
|
|
116
|
+
if (newProps.src !== this.props.src) {
|
|
126
117
|
this.initialize(newProps);
|
|
127
118
|
}
|
|
128
119
|
}
|
|
@@ -158,8 +149,7 @@ var Player = function (_Component) {
|
|
|
158
149
|
(0, _audio.getWaveform)(src).then(function (waveform) {
|
|
159
150
|
_this3.setState({
|
|
160
151
|
waveform: waveform,
|
|
161
|
-
loading: false
|
|
162
|
-
visible: visible
|
|
152
|
+
loading: false
|
|
163
153
|
});
|
|
164
154
|
});
|
|
165
155
|
}
|
|
@@ -170,7 +160,10 @@ var Player = function (_Component) {
|
|
|
170
160
|
|
|
171
161
|
var _props = this.props,
|
|
172
162
|
src = _props.src,
|
|
173
|
-
|
|
163
|
+
visible = _props.visible,
|
|
164
|
+
className = _props.className,
|
|
165
|
+
_props$onClose = _props.onClose,
|
|
166
|
+
onClose = _props$onClose === undefined ? function () {} : _props$onClose;
|
|
174
167
|
var _state = this.state,
|
|
175
168
|
loading = _state.loading,
|
|
176
169
|
duration = _state.duration,
|
|
@@ -180,8 +173,7 @@ var Player = function (_Component) {
|
|
|
180
173
|
containerWidth = _state.containerWidth,
|
|
181
174
|
speed = _state.speed,
|
|
182
175
|
_state$currentRange = _state.currentRange,
|
|
183
|
-
currentRange = _state$currentRange === undefined ? {} : _state$currentRange
|
|
184
|
-
visible = _state.visible;
|
|
176
|
+
currentRange = _state$currentRange === undefined ? {} : _state$currentRange;
|
|
185
177
|
var _currentRange$startTi = currentRange.startTime,
|
|
186
178
|
startTime = _currentRange$startTi === undefined ? 0 : _currentRange$startTi,
|
|
187
179
|
_currentRange$endTime = currentRange.endTime,
|
|
@@ -235,7 +227,7 @@ var Player = function (_Component) {
|
|
|
235
227
|
} })
|
|
236
228
|
),
|
|
237
229
|
_react2.default.createElement('div', { className: 'Close ' + (0, _noImportant.css)(styles.close), onClick: function onClick() {
|
|
238
|
-
return
|
|
230
|
+
return onClose();
|
|
239
231
|
} })
|
|
240
232
|
);
|
|
241
233
|
}
|