Skip to content

Commit

Permalink
refactor(android): Simplify preload call options handling
Browse files Browse the repository at this point in the history
  • Loading branch information
jcesarmobile committed Jun 28, 2024
1 parent b5363a2 commit 1274fec
Showing 1 changed file with 2 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,8 @@ public void dispatchComplete(String assetId) {
}

private void preloadAsset(PluginCall call) {
double volume = 1.0;
int audioChannelNum = 1;
double volume = call.getDouble(VOLUME, 1.0);
int audioChannelNum = call.getInt(AUDIO_CHANNEL_NUM, 1);

try {
initSoundPool();
Expand All @@ -369,18 +369,6 @@ private void preloadAsset(PluginCall call) {

String fullPath = assetPath; //"raw/".concat(assetPath);

if (call.getDouble(VOLUME) == null) {
volume = 1.0;
} else {
volume = call.getDouble(VOLUME, 0.5);
}

if (call.getInt(AUDIO_CHANNEL_NUM) == null) {
audioChannelNum = 1;
} else {
audioChannelNum = call.getInt(AUDIO_CHANNEL_NUM);
}

AssetFileDescriptor assetFileDescriptor;
if (isUrl) {
File f = new File(new URI(fullPath));
Expand Down

0 comments on commit 1274fec

Please sign in to comment.