@capgo/native-audio 8.2.7 → 8.2.9
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
|
@@ -81,7 +81,7 @@ dependencies {
|
|
|
81
81
|
implementation 'androidx.media3:media3-session:1.9.0'
|
|
82
82
|
implementation 'androidx.media3:media3-transformer:1.9.0'
|
|
83
83
|
implementation 'androidx.media3:media3-ui:1.9.0'
|
|
84
|
-
implementation 'androidx.media3:media3-database:1.9.
|
|
84
|
+
implementation 'androidx.media3:media3-database:1.9.2'
|
|
85
85
|
implementation 'androidx.media3:media3-common:1.9.2'
|
|
86
86
|
// Media notification support
|
|
87
87
|
implementation 'androidx.media:media:1.7.1'
|
|
@@ -856,7 +856,7 @@ public class NativeAudio extends Plugin implements AudioManager.OnAudioFocusChan
|
|
|
856
856
|
}
|
|
857
857
|
}
|
|
858
858
|
|
|
859
|
-
if (assetPath
|
|
859
|
+
if (isHlsUrl(assetPath)) {
|
|
860
860
|
// HLS Stream - check if HLS support is available
|
|
861
861
|
if (!HlsAvailabilityChecker.isHlsAvailable()) {
|
|
862
862
|
throw new Exception(
|
|
@@ -1064,6 +1064,32 @@ public class NativeAudio extends Plugin implements AudioManager.OnAudioFocusChan
|
|
|
1064
1064
|
return (value != null && !value.isEmpty() && !value.equals("null"));
|
|
1065
1065
|
}
|
|
1066
1066
|
|
|
1067
|
+
/**
|
|
1068
|
+
* Check if the given URL is an HLS stream by examining the URL path.
|
|
1069
|
+
* This handles URLs with query parameters correctly.
|
|
1070
|
+
*
|
|
1071
|
+
* @param assetPath The URL or path to check
|
|
1072
|
+
* @return true if the URL path ends with .m3u8, false otherwise
|
|
1073
|
+
*/
|
|
1074
|
+
private boolean isHlsUrl(String assetPath) {
|
|
1075
|
+
if (assetPath == null || assetPath.isEmpty()) {
|
|
1076
|
+
return false;
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
try {
|
|
1080
|
+
Uri uri = Uri.parse(assetPath);
|
|
1081
|
+
String path = uri.getPath();
|
|
1082
|
+
if (path != null) {
|
|
1083
|
+
return path.toLowerCase().endsWith(".m3u8");
|
|
1084
|
+
}
|
|
1085
|
+
} catch (Exception e) {
|
|
1086
|
+
Log.w(TAG, "Failed to parse URL for HLS detection: " + assetPath, e);
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1089
|
+
// Fallback: check if the URL contains .m3u8 followed by nothing or query params
|
|
1090
|
+
return assetPath.toLowerCase().contains(".m3u8");
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1067
1093
|
/**
|
|
1068
1094
|
* Creates a StreamAudioAsset via reflection.
|
|
1069
1095
|
* This allows the StreamAudioAsset class to be excluded at compile time when HLS is disabled,
|
|
@@ -13,7 +13,7 @@ enum MyError: Error {
|
|
|
13
13
|
// swiftlint:disable type_body_length file_length
|
|
14
14
|
@objc(NativeAudio)
|
|
15
15
|
public class NativeAudio: CAPPlugin, AVAudioPlayerDelegate, CAPBridgedPlugin {
|
|
16
|
-
private let pluginVersion: String = "8.2.
|
|
16
|
+
private let pluginVersion: String = "8.2.9"
|
|
17
17
|
public let identifier = "NativeAudio"
|
|
18
18
|
public let jsName = "NativeAudio"
|
|
19
19
|
public let pluginMethods: [CAPPluginMethod] = [
|