Play interrupts previous future.
This commit is contained in:
parent
2c3d38f1ad
commit
a494dabcfb
|
@ -605,10 +605,9 @@ public class AudioPlayer implements MethodCallHandler, Player.EventListener, Met
|
||||||
public void play(Result result) {
|
public void play(Result result) {
|
||||||
if (player.getPlayWhenReady()) return;
|
if (player.getPlayWhenReady()) return;
|
||||||
if (playResult != null) {
|
if (playResult != null) {
|
||||||
result.success(null);
|
playResult.success(null);
|
||||||
} else {
|
|
||||||
playResult = result;
|
|
||||||
}
|
}
|
||||||
|
playResult = result;
|
||||||
startWatchingBuffer();
|
startWatchingBuffer();
|
||||||
player.setPlayWhenReady(true);
|
player.setPlayWhenReady(true);
|
||||||
if (processingState == ProcessingState.completed && playResult != null) {
|
if (processingState == ProcessingState.completed && playResult != null) {
|
||||||
|
|
|
@ -1181,8 +1181,9 @@ class ClippingAudioSource extends IndexedAudioSource {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// An [AudioSource] that loops a nested [AudioSource] a
|
// An [AudioSource] that loops a nested [AudioSource] a finite number of times.
|
||||||
// specified number of times.
|
// Note that this can be inefficient when using a large loop count. If you wish
|
||||||
|
// to loop an infinite number of times, use [AudioPlayer.setLoopMode].
|
||||||
class LoopingAudioSource extends AudioSource {
|
class LoopingAudioSource extends AudioSource {
|
||||||
AudioSource child;
|
AudioSource child;
|
||||||
final int count;
|
final int count;
|
||||||
|
|
Loading…
Reference in New Issue