@lls/lls-audio 0.0.85 → 0.0.87
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 +15 -10
- package/player/index.js +12 -2
package/package.json
CHANGED
package/player/Audio.js
CHANGED
|
@@ -35,11 +35,17 @@ var Player = function (_Component) {
|
|
|
35
35
|
_this.refs.player.play();
|
|
36
36
|
} catch (e) {
|
|
37
37
|
// On tablet play needs to be triggered with a hand gesture
|
|
38
|
+
console.log("e", e);
|
|
38
39
|
}
|
|
39
40
|
};
|
|
40
41
|
|
|
41
42
|
_this.pause = function () {
|
|
42
|
-
|
|
43
|
+
try {
|
|
44
|
+
_this.refs.player.pause();
|
|
45
|
+
} catch (e) {
|
|
46
|
+
// On tablet play needs to be triggered with a hand gesture
|
|
47
|
+
console.log("e", e);
|
|
48
|
+
}
|
|
43
49
|
};
|
|
44
50
|
|
|
45
51
|
_this.setLoop = function () {
|
|
@@ -67,6 +73,14 @@ var Player = function (_Component) {
|
|
|
67
73
|
return _this.refs.player.currentTime = time;
|
|
68
74
|
};
|
|
69
75
|
|
|
76
|
+
_this.setVolume = function () {
|
|
77
|
+
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 100;
|
|
78
|
+
|
|
79
|
+
var volume = Math.min(value, 100);
|
|
80
|
+
_this.refs.player.volume = volume / 100;
|
|
81
|
+
_this.setStateWithCallback({ volume: volume });
|
|
82
|
+
};
|
|
83
|
+
|
|
70
84
|
_this.onAudioUpdate = function () {
|
|
71
85
|
return _this.setStateWithCallback({ currentTime: _this.getCurrentTime() });
|
|
72
86
|
};
|
|
@@ -151,15 +165,6 @@ var Player = function (_Component) {
|
|
|
151
165
|
|
|
152
166
|
// Controls
|
|
153
167
|
|
|
154
|
-
}, {
|
|
155
|
-
key: 'setVolume',
|
|
156
|
-
value: function setVolume() {
|
|
157
|
-
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 100;
|
|
158
|
-
|
|
159
|
-
var volume = Math.min(value, 100);
|
|
160
|
-
this.refs.player.volume = volume / 100;
|
|
161
|
-
this.setStateWithCallback({ volume: volume });
|
|
162
|
-
}
|
|
163
168
|
}, {
|
|
164
169
|
key: 'componentWillReceiveProps',
|
|
165
170
|
value: function componentWillReceiveProps(newProps) {
|
package/player/index.js
CHANGED
|
@@ -224,12 +224,22 @@ var Player = function (_Component) {
|
|
|
224
224
|
|
|
225
225
|
/* Play and pause will be called from the outside */
|
|
226
226
|
value: function play() {
|
|
227
|
-
|
|
227
|
+
try {
|
|
228
|
+
this.refs.audio.play();
|
|
229
|
+
} catch (e) {
|
|
230
|
+
// On tablet play needs to be triggered with a hand gesture
|
|
231
|
+
console.log("e", e);
|
|
232
|
+
}
|
|
228
233
|
}
|
|
229
234
|
}, {
|
|
230
235
|
key: 'pause',
|
|
231
236
|
value: function pause() {
|
|
232
|
-
|
|
237
|
+
try {
|
|
238
|
+
this.refs.audio.pause();
|
|
239
|
+
} catch (e) {
|
|
240
|
+
// On tablet play needs to be triggered with a hand gesture
|
|
241
|
+
console.log("e", e);
|
|
242
|
+
}
|
|
233
243
|
}
|
|
234
244
|
}, {
|
|
235
245
|
key: 'render',
|