@capgo/native-audio 7.3.36 → 7.3.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -617,6 +617,7 @@ public class NativeAudio extends Plugin implements AudioManager.OnAudioFocusChan
|
|
617
617
|
AssetManager am = ctx.getResources().getAssets();
|
618
618
|
AssetFileDescriptor assetFileDescriptor = am.openFd(assetPath);
|
619
619
|
AudioAsset asset = new AudioAsset(this, audioId, assetFileDescriptor, audioChannelNum, volume);
|
620
|
+
asset.setCompletionListener(this::dispatchComplete);
|
620
621
|
audioAssetList.put(audioId, asset);
|
621
622
|
call.resolve(status);
|
622
623
|
} catch (IOException e) {
|
@@ -120,6 +120,8 @@ public class RemoteAudioAsset extends AudioAsset {
|
|
120
120
|
Log.d(TAG, "Notifying duration: " + durationSec + " seconds");
|
121
121
|
owner.notifyDurationAvailable(assetId, durationSec);
|
122
122
|
}
|
123
|
+
} else if (playbackState == Player.STATE_ENDED) {
|
124
|
+
notifyCompletion();
|
123
125
|
}
|
124
126
|
}
|
125
127
|
|
@@ -180,7 +182,6 @@ public class RemoteAudioAsset extends AudioAsset {
|
|
180
182
|
Log.e(TAG, "Error playing after prepare", e);
|
181
183
|
}
|
182
184
|
} else if (playbackState == Player.STATE_ENDED) {
|
183
|
-
owner.dispatchComplete(getAssetId());
|
184
185
|
notifyCompletion();
|
185
186
|
}
|
186
187
|
}
|