@capgo/native-audio 7.7.2 → 7.7.4

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.
@@ -11,7 +11,7 @@ enum MyError: Error {
11
11
  /// here: https://capacitor.ionicframework.com/docs/plugins/ios
12
12
  @objc(NativeAudio)
13
13
  public class NativeAudio: CAPPlugin, AVAudioPlayerDelegate, CAPBridgedPlugin {
14
- private let PLUGIN_VERSION: String = "7.7.2"
14
+ private let PLUGIN_VERSION: String = "7.7.4"
15
15
  public let identifier = "NativeAudio"
16
16
  public let jsName = "NativeAudio"
17
17
  public let pluginMethods: [CAPPluginMethod] = [
@@ -77,7 +77,9 @@ public class NativeAudio: CAPPlugin, AVAudioPlayerDelegate, CAPBridgedPlugin {
77
77
  return false
78
78
  }
79
79
 
80
- if !hasPlayingAssets {
80
+ // Only deactivate if we have no playing assets AND no other audio is active
81
+ // This prevents interfering with VoIP calls or other audio sessions
82
+ if !hasPlayingAssets && !strongSelf.session.isOtherAudioPlaying && strongSelf.session.secondaryAudioShouldBeSilencedHint == false {
81
83
  strongSelf.endSession()
82
84
  }
83
85
  }
@@ -220,8 +222,9 @@ public class NativeAudio: CAPPlugin, AVAudioPlayerDelegate, CAPBridgedPlugin {
220
222
  }
221
223
  }
222
224
 
223
- // Only deactivate if no assets are playing
224
- if !hasPlayingAssets {
225
+ // Only deactivate if no assets are playing AND no other audio is active
226
+ // This prevents interfering with VoIP calls or other audio sessions
227
+ if !hasPlayingAssets && !session.isOtherAudioPlaying && session.secondaryAudioShouldBeSilencedHint == false {
225
228
  try self.session.setActive(false, options: .notifyOthersOnDeactivation)
226
229
  }
227
230
  } catch {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/native-audio",
3
- "version": "7.7.2",
3
+ "version": "7.7.4",
4
4
  "description": "A native plugin for native audio engine",
5
5
  "license": "MIT",
6
6
  "main": "dist/plugin.cjs.js",