scratch-audio/src/StartAudioContext.js
2018-06-21 16:01:35 -04:00

10 lines
470 B
JavaScript

// StartAudioContext assumes that we are in a window/document setting and messes with the unit
// tests, this is our own version just checking to see if we have a global document to listen
// to before we even try to "start" it. Our test api audio context is started by default.
const StartAudioContext = require('startaudiocontext');
module.exports = function (context) {
if (typeof document !== 'undefined') {
return StartAudioContext(context);
}
};