Add initialPosition and initialIndex parameters to load.

This commit is contained in:
Ryan Heise 2020-10-16 13:28:31 +11:00
parent 556598a663
commit f38ff383f5
9 changed files with 71 additions and 23 deletions

View file

@ -1,3 +1,7 @@
## 1.2.0
- Add initialPosition and initialIndex to LoadRequest.
## 1.1.0
- Player is now disposed via JustAudioPlatform.disposePlayer().

View file

@ -297,11 +297,19 @@ class DisposePlayerResponse {
/// audio source.
class LoadRequest {
final AudioSourceMessage audioSourceMessage;
final Duration initialPosition;
final int initialIndex;
LoadRequest({@required this.audioSourceMessage});
LoadRequest({
@required this.audioSourceMessage,
this.initialPosition,
this.initialIndex,
});
Map<dynamic, dynamic> toMap() => {
'audioSource': audioSourceMessage.toMap(),
'initialPosition': initialPosition?.inMicroseconds,
'initialIndex': initialIndex,
};
}

View file

@ -3,7 +3,7 @@ description: A common platform interface for the just_audio plugin.
homepage: https://github.com/ryanheise/just_audio/tree/master/just_audio_platform_interface
# NOTE: We strongly prefer non-breaking changes, even at the expense of a
# less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes
version: 1.1.0
version: 1.2.0
dependencies:
flutter: