Document iOS gapless looping.

This commit is contained in:
Ryan Heise 2021-01-05 14:26:07 +11:00
parent baa73045f0
commit 3d5eaf7a5f
1 changed files with 2 additions and 10 deletions

View File

@ -779,12 +779,8 @@ class AudioPlayer {
await (await _platform).setSpeed(SetSpeedRequest(speed: speed)); await (await _platform).setSpeed(SetSpeedRequest(speed: speed));
} }
/// Sets the [LoopMode]. The gapless looping support is as follows: /// Sets the [LoopMode]. Looping will be gapless on Android, iOS and macOS. On
/// /// web, there will be a slight gap at the loop point.
/// * Android: supported
/// * iOS/macOS: not supported, however, gapless looping can be achieved by
/// using [LoopingAudioSource].
/// * Web: not supported
Future<void> setLoopMode(LoopMode mode) async { Future<void> setLoopMode(LoopMode mode) async {
if (_disposed) return; if (_disposed) return;
_loopModeSubject.add(mode); _loopModeSubject.add(mode);
@ -1854,10 +1850,6 @@ class ClippingAudioSource extends IndexedAudioSource {
// An [AudioSource] that loops a nested [AudioSource] a finite number of times. // An [AudioSource] that loops a nested [AudioSource] a finite number of times.
// NOTE: this can be inefficient when using a large loop count. If you wish to // NOTE: this can be inefficient when using a large loop count. If you wish to
// loop an infinite number of times, use [AudioPlayer.setLoopMode]. // loop an infinite number of times, use [AudioPlayer.setLoopMode].
//
// On iOS and macOS, note that [LoopingAudioSource] will provide gapless
// playback while [AudioPlayer.setLoopMode] will not. (This will be supported
// in a future release.)
class LoopingAudioSource extends AudioSource { class LoopingAudioSource extends AudioSource {
AudioSource child; AudioSource child;
final int count; final int count;