@mcfarljw/capacitor-audio 1.0.2 → 1.0.3
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.
|
@@ -44,8 +44,8 @@ public class CapacitorAudio {
|
|
|
44
44
|
|
|
45
45
|
public void play(String path, int track) {
|
|
46
46
|
final Context context = this.context;
|
|
47
|
-
final String trimmedPath = path.trim().
|
|
48
|
-
final String absolutePath = context.getFilesDir().getAbsolutePath() + "/
|
|
47
|
+
final String trimmedPath = path.trim().replaceFirst("^/", "");
|
|
48
|
+
final String absolutePath = context.getFilesDir().getAbsolutePath() + "/" + trimmedPath;
|
|
49
49
|
final String parsedPath = Uri.parse(absolutePath).getPath();
|
|
50
50
|
|
|
51
51
|
this.bridge.getActivity().runOnUiThread(() -> {
|
|
@@ -28,9 +28,9 @@ import Foundation
|
|
|
28
28
|
|
|
29
29
|
@objc public func play(_ path: String, _ track: Int) -> Void {
|
|
30
30
|
let trimmedPath = path.trimmingCharacters(in: .whitespaces).trimmingCharacters(in: CharacterSet(charactersIn: "/"))
|
|
31
|
-
let documentPath =
|
|
32
|
-
let wwwPath =
|
|
33
|
-
let publicPath =
|
|
31
|
+
let documentPath = self.documentDirectory! + "/" + trimmedPath
|
|
32
|
+
let wwwPath = self.wwwDirectory! + "/" + trimmedPath
|
|
33
|
+
let publicPath = self.publicDirectory + "/" + trimmedPath
|
|
34
34
|
|
|
35
35
|
DispatchQueue.global(qos: .userInitiated).async {
|
|
36
36
|
var audioUrl: URL?
|