Skip to content

Conversation

@Nisarg-18
Copy link
Collaborator

Changes included:

  1. Removed "isPlaying" flag entirely and used the player's rate instead.
  2. Disabled "togglePlayPauseCommand" in the commandCenter.

play will simply play the pause will simply pause

@Nisarg-18 Nisarg-18 self-assigned this Apr 24, 2025
@Nisarg-18 Nisarg-18 requested a review from NicholasNagy April 24, 2025 15:45
Copy link
Owner

@NicholasNagy NicholasNagy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just had a question regarding the scope of the expected changes

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about in the dart layer, and on the Android side? Is the toggle removed there?

throw StateError("The data source has not been initialized");
}
return videoPlayerController!.value.isPlaying;
return videoPlayerController!.isPlaying;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Get the isPlaying value directly from the controller

}

@override
Future<bool> getIsPlaying(int? textureId) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Method channel for getting the isPlaying boolean from the native layer

}
_updatePosition(newPosition, absolutePosition: newAbsolutePosition);
},
);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved play logic directly in the play method instead of calling the toggling (_applyPlayPause) method

if (!_created || _isDisposed) {
return;
}
await _videoPlayerPlatform.pause(_textureId);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved pause logic directly in the pause method instead of calling the toggling (_applyPlayPause) method

@Nisarg-18 Nisarg-18 requested a review from NicholasNagy May 14, 2025 05:42
Copy link
Owner

@NicholasNagy NicholasNagy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a question about the play method, otherwise, the changes look good.

Comment on lines 414 to 427
_timer = Timer.periodic(
const Duration(milliseconds: 500),
(Timer timer) async {
if (_isDisposed) {
return;
}
final Duration? newPosition = await position;
final DateTime? newAbsolutePosition = await absolutePosition;
// ignore: invariant_booleans
if (_isDisposed) {
return;
}
_updatePosition(newPosition, absolutePosition: newAbsolutePosition);
},
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I this code necessary? What is the position and absolute position for?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess these will be useful when we add the skip ahead feature. (seekTo method)

position is for getting the position in the video

absolutePosition is for getting the position in the video stream

We can remove it for now, But maybe we will need it in future

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather remove it and add back when needed, as we can then design it in a way that makes most sense for us

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, I'll remove it then

@NicholasNagy NicholasNagy self-requested a review May 17, 2025 15:08
Copy link
Owner

@NicholasNagy NicholasNagy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm approving in advance

@Nisarg-18 Nisarg-18 merged commit c1a73d9 into master May 17, 2025
0 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants