@capgo/native-audio
Advanced tools
@@ -15,3 +15,3 @@ import AVFoundation | ||
| public class NativeAudio: CAPPlugin, AVAudioPlayerDelegate, CAPBridgedPlugin { | ||
| private let pluginVersion: String = "8.3.2" | ||
| private let pluginVersion: String = "8.3.3" | ||
| public let identifier = "NativeAudio" | ||
@@ -632,5 +632,17 @@ public let jsName = "NativeAudio" | ||
| // Only deactivate if no assets are playing AND no other audio is active | ||
| // This prevents interfering with VoIP calls or other audio sessions | ||
| if !hasPlayingAssets && !session.isOtherAudioPlaying && session.secondaryAudioShouldBeSilencedHint == false { | ||
| // Only deactivate if no assets are playing AND no other audio is active, | ||
| // and only when we're not in a record-capable mode (e.g. usage with CameraPreview plugin). | ||
| let isRecordCapableCategory: Bool = { | ||
| switch session.category { | ||
| case .record, .playAndRecord, .multiRoute: | ||
| return true | ||
| default: | ||
| return false | ||
| } | ||
| }() | ||
| if !hasPlayingAssets && | ||
| !session.isOtherAudioPlaying && | ||
| session.secondaryAudioShouldBeSilencedHint == false && | ||
| !isRecordCapableCategory { | ||
| try self.session.setActive(false, options: .notifyOthersOnDeactivation) | ||
@@ -637,0 +649,0 @@ } |
+1
-1
| { | ||
| "name": "@capgo/native-audio", | ||
| "version": "8.3.2", | ||
| "version": "8.3.3", | ||
| "description": "A native plugin for native audio engine", | ||
@@ -5,0 +5,0 @@ "license": "MPL-2.0", |
668985
0.06%