Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions packages/react-native-audio-api/src/core/AudioDecoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,16 @@ class AudioDecoder {
}

private resolveLocalFilePath(stringSource: string): string {
return stringSource.startsWith('file://')
? stringSource.replace('file://', '')
const stripped = stringSource.startsWith('file://')
? stringSource.slice('file://'.length)
: stringSource;
try {
// Unescape percent-encoded tokens.
return decodeURIComponent(stripped);
} catch {
// Fall back to the stripped path if encoding is malformed.
return stripped;
}
}

private async decodeFromLocalFile(
Expand Down
Loading