🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
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.2.8
to
8.2.9
+27
-1
android/src/main/java/ee/forgr/audio/NativeAudio.java

@@ -859,3 +859,3 @@ package ee.forgr.audio;

if (assetPath.endsWith(".m3u8")) {
if (isHlsUrl(assetPath)) {
// HLS Stream - check if HLS support is available

@@ -1069,2 +1069,28 @@ if (!HlsAvailabilityChecker.isHlsAvailable()) {

/**
* Check if the given URL is an HLS stream by examining the URL path.
* This handles URLs with query parameters correctly.
*
* @param assetPath The URL or path to check
* @return true if the URL path ends with .m3u8, false otherwise
*/
private boolean isHlsUrl(String assetPath) {
if (assetPath == null || assetPath.isEmpty()) {
return false;
}
try {
Uri uri = Uri.parse(assetPath);
String path = uri.getPath();
if (path != null) {
return path.toLowerCase().endsWith(".m3u8");
}
} catch (Exception e) {
Log.w(TAG, "Failed to parse URL for HLS detection: " + assetPath, e);
}
// Fallback: check if the URL contains .m3u8 followed by nothing or query params
return assetPath.toLowerCase().contains(".m3u8");
}
/**
* Creates a StreamAudioAsset via reflection.

@@ -1071,0 +1097,0 @@ * This allows the StreamAudioAsset class to be excluded at compile time when HLS is disabled,

+1
-1

@@ -16,3 +16,3 @@ import AVFoundation

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

@@ -19,0 +19,0 @@ public let jsName = "NativeAudio"

{
"name": "@capgo/native-audio",
"version": "8.2.8",
"version": "8.2.9",
"description": "A native plugin for native audio engine",

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