Skip to content

Commit

Permalink
🔥 removed unused properties from YoutubePlayerValue
Browse files Browse the repository at this point in the history
  • Loading branch information
sarbagyastha committed Aug 14, 2022
1 parent 42758fd commit e6d01eb
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 20 deletions.
1 change: 1 addition & 0 deletions packages/youtube_player_iframe/CHANGELOG.md
Expand Up @@ -4,6 +4,7 @@
- Added **Migrating to v3** section in the docs.
- Listed `Swipe up/down to enter/exit fullscreen mode` as a feature in the docs.
- Deprecated `autoPlay` param in **YoutubePlayerParams**, as it's no longer used.
- Removed `hasPlayed`, `position` & `buffered` from **YoutubePlayerValue**, as these values can be accessed through **YoutubePlayerController**.

# 3.0.2
- Improved pub score.
Expand Down
Expand Up @@ -230,9 +230,6 @@ class YoutubePlayerController implements YoutubePlayerIFrameAPI {
/// Creates new [YoutubePlayerValue] with assigned parameters and overrides
/// the old one.
void update({
bool? hasPlayed,
Duration? position,
double? buffered,
FullScreenOption? fullScreenOption,
int? volume,
PlayerState? playerState,
Expand All @@ -242,9 +239,6 @@ class YoutubePlayerController implements YoutubePlayerIFrameAPI {
YoutubeMetaData? metaData,
}) {
final updatedValue = YoutubePlayerValue(
hasPlayed: hasPlayed ?? value.hasPlayed,
position: position ?? value.position,
buffered: buffered ?? value.buffered,
fullScreenOption: fullScreenOption ?? value.fullScreenOption,
volume: volume ?? value.volume,
playerState: playerState ?? value.playerState,
Expand Down
15 changes: 1 addition & 14 deletions packages/youtube_player_iframe/lib/src/player_value.dart
Expand Up @@ -11,9 +11,6 @@ class YoutubePlayerValue {
/// The duration, current position, buffering state, error state and settings
/// of a [YoutubePlayerController].
YoutubePlayerValue({
this.hasPlayed = false,
this.position = const Duration(),
this.buffered = 0.0,
this.fullScreenOption = const FullScreenOption(enabled: false),
this.volume = 100,
this.playerState = PlayerState.unknown,
Expand All @@ -23,15 +20,6 @@ class YoutubePlayerValue {
this.metaData = const YoutubeMetaData(),
});

/// Returns true once the video start playing for the first time.
final bool hasPlayed;

/// The current position of the video.
final Duration position;

/// The position up to which the video is buffered.i
final double buffered;

/// The initial fullscreen option.
final FullScreenOption fullScreenOption;

Expand Down Expand Up @@ -62,12 +50,11 @@ class YoutubePlayerValue {
String toString() {
return '$runtimeType('
'metaData: ${metaData.toString()}, '
'position: ${position.inSeconds} sec. , '
'buffered: $buffered , '
'volume: $volume, '
'playerState: $playerState, '
'playbackRate: $playbackRate, '
'playbackQuality: $playbackQuality, '
'isFullScreen: ${fullScreenOption.enabled}, '
'error: $error)';
}
}
Expand Down

0 comments on commit e6d01eb

Please sign in to comment.