1
0
mirror of https://github.com/danog/termux-api.git synced 2024-11-26 20:04:42 +01:00

MediaPlayerApi playHandler: prepare synchronously, don't always print failure

the isPlaying() call was completing before the prepareAsync() call, always returning "Failed to play: "
This commit is contained in:
landfillbaby 2018-04-07 00:29:28 +01:00 committed by Fredrik Fornwall
parent a5b2a01d96
commit d4660a3ce9

View File

@ -204,7 +204,7 @@ public class MediaPlayerAPI {
}
try {
player.setDataSource(context, Uri.fromFile(mediaFile));
player.prepareAsync();
player.prepare();
if (player.isPlaying()) {
result.message = "Now Playing: " + mediaFile.getName();
} else {