@capgo/native-audio 6.0.10 → 6.0.12

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/README.md CHANGED
@@ -25,7 +25,7 @@
25
25
  # Capacitor Native Audio Plugin
26
26
 
27
27
  Capacitor plugin for native audio engine.
28
- Capacitor v4 - ✅ Support!
28
+ Capacitor V5 - ✅ Support!
29
29
 
30
30
  Click on video to see example 💥
31
31
 
@@ -69,12 +69,16 @@ public class AudioAsset: NSObject, AVAudioPlayerDelegate {
69
69
  }
70
70
 
71
71
  func play(time: TimeInterval) {
72
- let player: AVAudioPlayer = channels[playIndex]
73
- player.currentTime = time
74
- player.numberOfLoops = 0
75
- player.play()
76
- playIndex += 1
77
- playIndex = playIndex % channels.count
72
+ let player: AVAudioPlayer
73
+
74
+ if channels.count > 0 {
75
+ player = channels[playIndex]
76
+ player.currentTime = time
77
+ player.numberOfLoops = 0
78
+ player.play()
79
+ playIndex += 1
80
+ playIndex = playIndex % channels.count
81
+ }
78
82
  }
79
83
 
80
84
  func playWithFade(time: TimeInterval) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/native-audio",
3
- "version": "6.0.10",
3
+ "version": "6.0.12",
4
4
  "description": "A native plugin for native audio engine",
5
5
  "main": "dist/plugin.js",
6
6
  "module": "dist/esm/index.js",