@lls/lls-audio 0.0.76 → 0.0.77
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/recorder/index.js +4 -1
package/package.json
CHANGED
package/recorder/index.js
CHANGED
|
@@ -40,7 +40,7 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen
|
|
|
40
40
|
|
|
41
41
|
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; }
|
|
42
42
|
|
|
43
|
-
var audioContext = new _audioContext2.default();
|
|
43
|
+
var audioContext = _audioContext2.default ? new _audioContext2.default() : null;
|
|
44
44
|
|
|
45
45
|
// make the volume a value between 0 and 100
|
|
46
46
|
var formatVolume = function formatVolume(volume) {
|
|
@@ -161,6 +161,9 @@ var Recorder = function (_Component) {
|
|
|
161
161
|
_props$onRecordComple = props.onRecordComplete,
|
|
162
162
|
onRecordComplete = _props$onRecordComple === undefined ? function () {} : _props$onRecordComple;
|
|
163
163
|
|
|
164
|
+
if (!audioContext) {
|
|
165
|
+
return onNotAvailable();
|
|
166
|
+
}
|
|
164
167
|
|
|
165
168
|
(0, _mediaDevices.shimMediaDevices)();
|
|
166
169
|
|