@capgo/native-audio 6.1.34 → 6.1.36

Sign up to get free protection for your applications and to get access to all the features.
@@ -75,7 +75,11 @@ public class AudioAsset: NSObject, AVAudioPlayerDelegate {
75
75
  player = channels[playIndex]
76
76
  player.currentTime = time
77
77
  player.numberOfLoops = 0
78
- player.play(atTime: player.deviceCurrentTime + delay)
78
+ if (delay > 0) {
79
+ player.play(atTime: player.deviceCurrentTime + delay)
80
+ } else {
81
+ player.play()
82
+ }
79
83
  playIndex += 1
80
84
  playIndex = playIndex % channels.count
81
85
  }
@@ -35,12 +35,9 @@ public class NativeAudio: CAPPlugin {
35
35
  }
36
36
 
37
37
  let focus = call.getBool(Constant.FocusAudio) ?? false
38
-
39
38
  do {
40
-
41
39
  if focus {
42
-
43
- try self.session.setCategory(AVAudioSession.Category.playback)
40
+ try self.session.setCategory(AVAudioSession.Category.playback, options: .duckOthers)
44
41
 
45
42
  }
46
43
 
@@ -78,7 +75,7 @@ public class NativeAudio: CAPPlugin {
78
75
 
79
76
  if focus {
80
77
 
81
- try self.session.setCategory(AVAudioSession.Category.ambient)
78
+ try self.session.setCategory(AVAudioSession.Category.ambient, options: .duckOthers)
82
79
 
83
80
  } else {
84
81
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/native-audio",
3
- "version": "6.1.34",
3
+ "version": "6.1.36",
4
4
  "description": "A native plugin for native audio engine",
5
5
  "main": "dist/plugin.js",
6
6
  "module": "dist/esm/index.js",