Skip to content

Commit

Permalink
Merge pull request #39 from tasiyo7333/android/external_file
Browse files Browse the repository at this point in the history
Detect relative paths.
  • Loading branch information
zmxv committed May 19, 2016
2 parents 9c0462b + be4e31e commit da87816
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sound.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@ var IsAndroid = RNSound.IsAndroid;

var nextKey = 0;

function isRelativePath(path) {
return !/^\//.test(path);
}

function Sound(filename, basePath, onError) {
this._filename = basePath ? basePath + '/' + filename : filename;

if (IsAndroid && !basePath) {
if (IsAndroid && !basePath && isRelativePath(filename)) {
this._filename = filename.toLowerCase().replace(/\.[^.]+$/, '');
}

Expand Down

0 comments on commit da87816

Please sign in to comment.