Skip to content

Commit

Permalink
Recognize a external file and a bundled file on Android.
Browse files Browse the repository at this point in the history
  • Loading branch information
Daisuke Inoue committed May 19, 2016
1 parent 9c0462b commit be4e31e
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 be4e31e

Please sign in to comment.