@capgo/capacitor-native-audio 8.4.13 → 8.4.15
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.
package/android/build.gradle
CHANGED
|
@@ -79,7 +79,7 @@ dependencies {
|
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
implementation 'androidx.media3:media3-session:1.10.1'
|
|
82
|
-
implementation 'androidx.media3:media3-transformer:1.10.
|
|
82
|
+
implementation 'androidx.media3:media3-transformer:1.10.1'
|
|
83
83
|
implementation 'androidx.media3:media3-ui:1.10.0'
|
|
84
84
|
implementation 'androidx.media3:media3-database:1.10.1'
|
|
85
85
|
implementation 'androidx.media3:media3-common:1.10.1'
|
|
@@ -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.
|
|
21
|
+
private let pluginVersion: String = "8.4.15"
|
|
22
22
|
public let identifier = "NativeAudio"
|
|
23
23
|
public let jsName = "NativeAudio"
|
|
24
24
|
public let pluginMethods: [CAPPluginMethod] = [
|