abcjs 6.0.0-beta.38 → 6.0.0-beta.39

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.
@@ -15367,11 +15367,29 @@ function CreateSynth() {
15367
15367
  self.debugCallback("creationTime = " + Math.floor((activeAudioContext().currentTime - startTime) * 1000) + "ms");
15368
15368
  }
15369
15369
 
15370
+ function resolveData(me) {
15371
+ var duration = me && me.audioBuffers && me.audioBuffers.length > 0 ? me.audioBuffers[0].duration : 0;
15372
+ return {
15373
+ status: activeAudioContext().state,
15374
+ duration: duration
15375
+ };
15376
+ }
15377
+
15370
15378
  Promise.all(allPromises).then(function () {
15371
- resolve({
15372
- status: "ok",
15373
- seconds: 0
15374
- });
15379
+ // Safari iOS can mess with the audioContext state, so resume if needed.
15380
+ if (activeAudioContext().state === "suspended") {
15381
+ activeAudioContext().resume().then(function () {
15382
+ resolve(resolveData(self));
15383
+ });
15384
+ } else if (activeAudioContext().state === "interrupted") {
15385
+ activeAudioContext().suspend().then(function () {
15386
+ activeAudioContext().resume().then(function () {
15387
+ resolve(resolveData(self));
15388
+ });
15389
+ });
15390
+ } else {
15391
+ resolve(resolveData(self));
15392
+ }
15375
15393
  });
15376
15394
  });
15377
15395
  };
@@ -28131,7 +28149,7 @@ module.exports = unhighlight;
28131
28149
  \********************/
28132
28150
  /***/ (function(module) {
28133
28151
 
28134
- var version = '6.0.0-beta.38';
28152
+ var version = '6.0.0-beta.39';
28135
28153
  module.exports = version;
28136
28154
 
28137
28155
  /***/ })