@lls/lls-audio 0.0.81 → 0.0.82
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/Audio.js +14 -1
package/package.json
CHANGED
package/player/Audio.js
CHANGED
|
@@ -142,7 +142,7 @@ var Player = function (_Component) {
|
|
|
142
142
|
_props$preload = _props.preload,
|
|
143
143
|
preload = _props$preload === undefined ? 'auto' : _props$preload;
|
|
144
144
|
|
|
145
|
-
return _react2.default.createElement('audio', { ref: 'player', autoPlay:
|
|
145
|
+
return _react2.default.createElement('audio', { ref: 'player', autoPlay: false, src: src, loop: loop, preload: preload });
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
// Controls
|
|
@@ -156,6 +156,15 @@ var Player = function (_Component) {
|
|
|
156
156
|
this.refs.player.volume = volume / 100;
|
|
157
157
|
this.setStateWithCallback({ volume: volume });
|
|
158
158
|
}
|
|
159
|
+
}, {
|
|
160
|
+
key: 'componentWillReceiveProps',
|
|
161
|
+
value: function componentWillReceiveProps(newProps) {
|
|
162
|
+
if (newProps.src !== this.props.src) {
|
|
163
|
+
if (newprops.autoPlay) {
|
|
164
|
+
this.play();
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
159
168
|
|
|
160
169
|
// HTML5 events
|
|
161
170
|
|
|
@@ -170,6 +179,10 @@ var Player = function (_Component) {
|
|
|
170
179
|
player.addEventListener('play', this.onPlay);
|
|
171
180
|
player.addEventListener('pause', this.onPause);
|
|
172
181
|
player.addEventListener('timeupdate', this.onAudioUpdate);
|
|
182
|
+
|
|
183
|
+
if (this.props.autoPlay) {
|
|
184
|
+
this.play();
|
|
185
|
+
}
|
|
173
186
|
}
|
|
174
187
|
}, {
|
|
175
188
|
key: 'componentWillUnmount',
|