🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@capgo/native-audio

Package Overview
Dependencies
Maintainers
1
Versions
256
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@capgo/native-audio - npm Package Compare versions

Comparing version
8.3.0
to
8.3.1
+18
-2
ios/Sources/NativeAudioPlugin/Plugin.swift

@@ -15,3 +15,3 @@ import AVFoundation

public class NativeAudio: CAPPlugin, AVAudioPlayerDelegate, CAPBridgedPlugin {
private let pluginVersion: String = "8.3.0"
private let pluginVersion: String = "8.3.1"
public let identifier = "NativeAudio"

@@ -644,6 +644,17 @@ public let jsName = "NativeAudio"

// Don't immediately end the session here, as other players might still be active
// Instead, check if all players are done
// Instead, check if all players are done and clear Now Playing if this asset was current
audioQueue.async { [weak self] in
guard let self = self else { return }
// Find which asset this player belongs to; if it was the currently playing one, clear notification
for (audioId, asset) in self.audioList {
if let audioAsset = asset as? AudioAsset, audioAsset.channels.contains(player) {
if self.currentlyPlayingAssetId == audioId {
self.currentlyPlayingAssetId = nil
self.clearNowPlayingInfo()
}
break
}
}
// Avoid recursive calls by checking if the asset is still in the list

@@ -660,2 +671,7 @@ let hasPlayingAssets = self.audioList.values.contains { asset in

if !hasPlayingAssets {
// If we didn't find the asset above (e.g. playOnce already removed it), clear notification when nothing is playing
if self.currentlyPlayingAssetId != nil {
self.currentlyPlayingAssetId = nil
self.clearNowPlayingInfo()
}
self.endSession()

@@ -662,0 +678,0 @@ }

+1
-1
{
"name": "@capgo/native-audio",
"version": "8.3.0",
"version": "8.3.1",
"description": "A native plugin for native audio engine",

@@ -5,0 +5,0 @@ "license": "MPL-2.0",