Skip to content
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,4 @@ Aleksandr Yurkovskiy <[email protected]>
Anton Borries <[email protected]>
Alex Li <[email protected]>
Rahul Raj <[email protected]>
Márton Matuz <[email protected]>
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
## NEXT
## 6.1.0

* Aligns Dart and Flutter SDK constraints.
* Adds the `VideoEventType.isPlayingStateUpdate` event to track changes in play / pause state with
the underlying video player.

## 6.0.2

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ class VideoEvent {
this.size,
this.rotationCorrection,
this.buffered,
this.isPlaying,
});

/// The type of the event.
Expand All @@ -237,6 +238,11 @@ class VideoEvent {
/// Only used if [eventType] is [VideoEventType.bufferingUpdate].
final List<DurationRange>? buffered;

/// Whether the video is currently playing.
///
/// Only used if [eventType] is [VideoEventType.isPlayingStateUpdate].
final bool? isPlaying;

@override
bool operator ==(Object other) {
return identical(this, other) ||
Expand All @@ -246,7 +252,8 @@ class VideoEvent {
duration == other.duration &&
size == other.size &&
rotationCorrection == other.rotationCorrection &&
listEquals(buffered, other.buffered);
listEquals(buffered, other.buffered) &&
isPlaying == other.isPlaying;
}

@override
Expand All @@ -256,13 +263,14 @@ class VideoEvent {
size,
rotationCorrection,
buffered,
isPlaying,
);
}

/// Type of the event.
///
/// Emitted by the platform implementation when the video is initialized or
/// completed or to communicate buffering events.
/// completed or to communicate buffering events or play state changed.
enum VideoEventType {
/// The video has been initialized.
initialized,
Expand All @@ -279,6 +287,12 @@ enum VideoEventType {
/// The video stopped to buffer.
bufferingEnd,

/// The playback state of the video has changed.
///
/// This event is fired when the video starts or pauses due to user actions or
/// phone calls, or other app media such as music players.
isPlayingStateUpdate,

/// An unknown event has been received.
unknown,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ repository: https://github.com/flutter/packages/tree/main/packages/video_player/
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+video_player%22
# 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: 6.0.2
version: 6.1.0

environment:
sdk: ">=2.17.0 <3.0.0"
Expand Down