@capgo/native-audio 7.1.5 → 7.1.6

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.
@@ -128,7 +128,7 @@ public class NativeAudio: CAPPlugin, AVAudioPlayerDelegate {
128
128
  call.reject("Missing assetId")
129
129
  return
130
130
  }
131
-
131
+
132
132
  audioQueue.sync {
133
133
  call.resolve([
134
134
  "found": self.audioList[assetId] != nil
@@ -164,23 +164,23 @@ public class NativeAudio: CAPPlugin, AVAudioPlayerDelegate {
164
164
  let audioId = call.getString(Constant.AssetIdKey) ?? ""
165
165
  let time = call.getDouble("time") ?? 0
166
166
  let delay = call.getDouble("delay") ?? 0
167
-
167
+
168
168
  if audioId.isEmpty {
169
169
  call.reject(Constant.ErrorAssetId)
170
170
  return
171
171
  }
172
-
172
+
173
173
  audioQueue.async {
174
174
  guard !self.audioList.isEmpty else {
175
175
  call.reject("Audio list is empty")
176
176
  return
177
177
  }
178
-
178
+
179
179
  guard let asset = self.audioList[audioId] else {
180
180
  call.reject(Constant.ErrorAssetNotFound)
181
181
  return
182
182
  }
183
-
183
+
184
184
  if let audioAsset = asset as? AudioAsset {
185
185
  self.activateSession()
186
186
  if self.fadeMusic {
@@ -205,21 +205,21 @@ public class NativeAudio: CAPPlugin, AVAudioPlayerDelegate {
205
205
  call.reject(Constant.ErrorAssetId)
206
206
  return nil
207
207
  }
208
-
208
+
209
209
  var asset: AudioAsset?
210
210
  audioQueue.sync {
211
211
  if self.audioList.isEmpty {
212
212
  call.reject("Audio list is empty")
213
213
  return
214
214
  }
215
-
215
+
216
216
  guard let foundAsset = self.audioList[audioId] as? AudioAsset else {
217
217
  call.reject(Constant.ErrorAssetNotFound + " - " + audioId)
218
218
  return
219
219
  }
220
220
  asset = foundAsset
221
221
  }
222
-
222
+
223
223
  if asset == nil {
224
224
  call.reject("Failed to get audio asset")
225
225
  return nil
@@ -293,13 +293,13 @@ public class NativeAudio: CAPPlugin, AVAudioPlayerDelegate {
293
293
 
294
294
  @objc func stop(_ call: CAPPluginCall) {
295
295
  let audioId = call.getString(Constant.AssetIdKey) ?? ""
296
-
296
+
297
297
  audioQueue.async {
298
298
  guard !self.audioList.isEmpty else {
299
299
  call.reject("Audio list is empty")
300
300
  return
301
301
  }
302
-
302
+
303
303
  do {
304
304
  try self.stopAudio(audioId: audioId)
305
305
  self.endSession()
@@ -324,13 +324,13 @@ public class NativeAudio: CAPPlugin, AVAudioPlayerDelegate {
324
324
 
325
325
  @objc func unload(_ call: CAPPluginCall) {
326
326
  let audioId = call.getString(Constant.AssetIdKey) ?? ""
327
-
327
+
328
328
  audioQueue.async {
329
329
  guard !self.audioList.isEmpty else {
330
330
  call.reject("Audio list is empty")
331
331
  return
332
332
  }
333
-
333
+
334
334
  if let asset = self.audioList[audioId] as? AudioAsset {
335
335
  asset.unload()
336
336
  self.audioList[audioId] = nil
@@ -472,11 +472,11 @@ public class NativeAudio: CAPPlugin, AVAudioPlayerDelegate {
472
472
 
473
473
  private func stopAudio(audioId: String) throws {
474
474
  var asset: AudioAsset?
475
-
475
+
476
476
  audioQueue.sync {
477
477
  asset = self.audioList[audioId] as? AudioAsset
478
478
  }
479
-
479
+
480
480
  guard let audioAsset = asset else {
481
481
  throw MyError.runtimeError(Constant.ErrorAssetNotFound)
482
482
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/native-audio",
3
- "version": "7.1.5",
3
+ "version": "7.1.6",
4
4
  "description": "A native plugin for native audio engine",
5
5
  "main": "dist/plugin.js",
6
6
  "module": "dist/esm/index.js",
@@ -83,6 +83,5 @@
83
83
  },
84
84
  "publishConfig": {
85
85
  "access": "public"
86
- },
87
- "packageManager": "pnpm@9.7.0+sha512.dc09430156b427f5ecfc79888899e1c39d2d690f004be70e05230b72cb173d96839587545d09429b55ac3c429c801b4dc3c0e002f653830a420fa2dd4e3cf9cf"
86
+ }
88
87
  }