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:
parent
a5b2a01d96
commit
d4660a3ce9
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user