support seeking to end of live streams (#108)
* support seeking to end of live streams suggested edit for #96 * fix type casting
This commit is contained in:
parent
ee0c4cd7cd
commit
f66413c007
3 changed files with 23 additions and 11 deletions
|
@ -421,11 +421,13 @@ class AudioPlayer {
|
|||
[automaticallyWaitsToMinimizeStalling]);
|
||||
}
|
||||
|
||||
/// Seeks to a particular position. It is legal to invoke this method from
|
||||
/// Seeks to a particular position. Specify [null] to seek to the end of live streams.
|
||||
/// It is legal to invoke this method from
|
||||
/// any state except for [AudioPlaybackState.none] and
|
||||
/// [AudioPlaybackState.connecting].
|
||||
Future<void> seek(final Duration position) async {
|
||||
await _invokeMethod('seek', [position.inMilliseconds]);
|
||||
await _invokeMethod(
|
||||
'seek', [position != null ? position.inMilliseconds : -2]);
|
||||
}
|
||||
|
||||
/// Release all resources associated with this player. You must invoke this
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue