@capgo/capacitor-native-audio 8.4.14 → 8.4.16

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.
@@ -21,6 +21,12 @@ public class AudioAsset: NSObject, AVAudioPlayerDelegate {
21
21
 
22
22
  private var logger = Logger(logTag: "AudioAsset")
23
23
 
24
+ private static func isRemoteHttpUrl(_ path: String) -> Bool {
25
+ guard let url = URL(string: path), let scheme = url.scheme?.lowercased() else { return false }
26
+ return scheme == "http" || scheme == "https"
27
+ }
28
+
29
+
24
30
  init(owner: NativeAudio, withAssetId assetId: String, withPath path: String, withChannels channels: Int?, withVolume volume: Float?) {
25
31
  self.owner = owner
26
32
  self.assetId = assetId
@@ -39,6 +45,9 @@ public class AudioAsset: NSObject, AVAudioPlayerDelegate {
39
45
 
40
46
  let setupBlock = { [weak self] in
41
47
  guard let self else { return }
48
+ if Self.isRemoteHttpUrl(path) {
49
+ return
50
+ }
42
51
  for _ in 0..<channelCount {
43
52
  do {
44
53
  let player = try AVAudioPlayer(contentsOf: pathUrl)
@@ -78,6 +87,9 @@ public class AudioAsset: NSObject, AVAudioPlayerDelegate {
78
87
  let channelCount = min(max(channels ?? 1, 1), Constant.MaxChannels)
79
88
  let setupBlock = { [weak self] in
80
89
  guard let self else { return }
90
+ if Self.isRemoteHttpUrl(path) {
91
+ return
92
+ }
81
93
  for _ in 0..<channelCount {
82
94
  do {
83
95
  let player = try AVAudioPlayer(contentsOf: pathUrl)
@@ -18,7 +18,7 @@ private enum PlaybackStateValue: String {
18
18
  @objc(NativeAudio)
19
19
  // swiftlint:disable:next type_body_length
20
20
  public class NativeAudio: CAPPlugin, AVAudioPlayerDelegate, CAPBridgedPlugin {
21
- private let pluginVersion: String = "8.4.14"
21
+ private let pluginVersion: String = "8.4.16"
22
22
  public let identifier = "NativeAudio"
23
23
  public let jsName = "NativeAudio"
24
24
  public let pluginMethods: [CAPPluginMethod] = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-native-audio",
3
- "version": "8.4.14",
3
+ "version": "8.4.16",
4
4
  "description": "A native plugin for native audio engine",
5
5
  "license": "MPL-2.0",
6
6
  "main": "dist/plugin.cjs.js",
@@ -59,7 +59,8 @@
59
59
  "test:e2e:android": "maestro test .maestro/android/basic-features.yaml",
60
60
  "test:e2e:ios": "maestro test .maestro/ios/basic-features.yaml",
61
61
  "prepublishOnly": "bun run build",
62
- "check:wiring": "node scripts/check-capacitor-plugin-wiring.mjs"
62
+ "check:wiring": "node scripts/check-capacitor-plugin-wiring.mjs",
63
+ "changelog:ai": "node scripts/generate-ai-changelog.mjs"
63
64
  },
64
65
  "devDependencies": {
65
66
  "@capacitor/android": "^8.0.0",