Skip to content

Commit

Permalink
Change isCompleted to completed
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaowei-guan committed Nov 7, 2024
1 parent ee4a050 commit c341e39
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions packages/video_player_videohole/lib/video_player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class VideoPlayerValue {
this.volume = 1.0,
this.playbackSpeed = 1.0,
this.errorDescription,
this.isCompleted = false,
this.completed = false,
});

/// Returns an instance for a video that hasn't been loaded.
Expand Down Expand Up @@ -122,7 +122,7 @@ class VideoPlayerValue {
///
/// Reverts to false if video position changes, or video begins playing.
/// Does not update if video is looping.
final bool isCompleted;
final bool completed;

/// The [size] of the currently loaded video.
final Size size;
Expand Down Expand Up @@ -168,7 +168,7 @@ class VideoPlayerValue {
double? volume,
double? playbackSpeed,
String? errorDescription = _defaultErrorDescription,
bool? isCompleted,
bool? completed,
}) {
return VideoPlayerValue(
duration: duration ?? this.duration,
Expand All @@ -187,7 +187,7 @@ class VideoPlayerValue {
errorDescription: errorDescription != _defaultErrorDescription
? errorDescription
: this.errorDescription,
isCompleted: isCompleted ?? this.isCompleted,
completed: completed ?? this.completed,
);
}

Expand All @@ -208,7 +208,7 @@ class VideoPlayerValue {
'volume: $volume, '
'playbackSpeed: $playbackSpeed, '
'errorDescription: $errorDescription, '
'isCompleted: $isCompleted),';
'completed: $completed),';
}
}

Expand Down Expand Up @@ -421,7 +421,7 @@ class VideoPlayerController extends ValueNotifier<VideoPlayerValue> {
size: event.size,
isInitialized: event.duration != null,
errorDescription: null,
isCompleted: false,
completed: false,
);
assert(
!initializingCompleter.isCompleted,
Expand All @@ -446,7 +446,7 @@ class VideoPlayerController extends ValueNotifier<VideoPlayerValue> {
// we use pause() and seekTo() to ensure the platform stops playing
// and seeks to the last frame of the video.
pause().then((void pauseResult) => seekTo(value.duration.end));
value = value.copyWith(isCompleted: true);
value = value.copyWith(completed: true);
_durationTimer?.cancel();
case VideoEventType.bufferingUpdate:
value = value.copyWith(buffered: event.buffered);
Expand Down Expand Up @@ -806,7 +806,7 @@ class VideoPlayerController extends ValueNotifier<VideoPlayerValue> {
value = value.copyWith(
position: position,
caption: _getCaptionAt(position),
isCompleted: position == value.duration.end,
completed: position == value.duration.end,
);
}

Expand Down

0 comments on commit c341e39

Please sign in to comment.