@lls/lls-audio 0.0.86 → 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 +20 -11
package/package.json
CHANGED
package/player/Audio.js
CHANGED
|
@@ -31,11 +31,21 @@ var Player = function (_Component) {
|
|
|
31
31
|
_this.requestAnimationId = null;
|
|
32
32
|
|
|
33
33
|
_this.play = function () {
|
|
34
|
-
|
|
34
|
+
try {
|
|
35
|
+
_this.refs.player.play();
|
|
36
|
+
} catch (e) {
|
|
37
|
+
// On tablet play needs to be triggered with a hand gesture
|
|
38
|
+
console.log("e", e);
|
|
39
|
+
}
|
|
35
40
|
};
|
|
36
41
|
|
|
37
42
|
_this.pause = function () {
|
|
38
|
-
|
|
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
|
+
}
|
|
39
49
|
};
|
|
40
50
|
|
|
41
51
|
_this.setLoop = function () {
|
|
@@ -63,6 +73,14 @@ var Player = function (_Component) {
|
|
|
63
73
|
return _this.refs.player.currentTime = time;
|
|
64
74
|
};
|
|
65
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
|
+
|
|
66
84
|
_this.onAudioUpdate = function () {
|
|
67
85
|
return _this.setStateWithCallback({ currentTime: _this.getCurrentTime() });
|
|
68
86
|
};
|
|
@@ -147,15 +165,6 @@ var Player = function (_Component) {
|
|
|
147
165
|
|
|
148
166
|
// Controls
|
|
149
167
|
|
|
150
|
-
}, {
|
|
151
|
-
key: 'setVolume',
|
|
152
|
-
value: function setVolume() {
|
|
153
|
-
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 100;
|
|
154
|
-
|
|
155
|
-
var volume = Math.min(value, 100);
|
|
156
|
-
this.refs.player.volume = volume / 100;
|
|
157
|
-
this.setStateWithCallback({ volume: volume });
|
|
158
|
-
}
|
|
159
168
|
}, {
|
|
160
169
|
key: 'componentWillReceiveProps',
|
|
161
170
|
value: function componentWillReceiveProps(newProps) {
|