Skip to content

Conversation

@sigurdm
Copy link
Owner

@sigurdm sigurdm commented Nov 30, 2017

No description provided.

@sigurdm sigurdm requested a review from mravn-google November 30, 2017 12:53
}

class _VideoAppLifeCycleObserver extends WidgetsBindingObserver {
bool wasPlayingBeforePause = false;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Make private?

Copy link
Owner Author

Choose a reason for hiding this comment

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

DoneDone

switch (state) {
case AppLifecycleState.paused:
wasPlayingBeforePause = controller.value.isPlaying;
if (controller.value.initialized) controller.pause();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please format single-statement if branches consistently.

Worse: if controller is not yet initialized, we lose the pause signal and may start playing while in background.

Copy link
Owner Author

Choose a reason for hiding this comment

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

I removed the conditional. The controller should take care of delaying the play message till after initialisation is done.

Copy link
Collaborator

@mravn-google mravn-google left a comment

Choose a reason for hiding this comment

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

LGTM

@sigurdm sigurdm merged commit 97695af into import_video_player Nov 30, 2017
sigurdm pushed a commit that referenced this pull request May 15, 2018
Camera Plugin: Refactored UI code of example app and improved it a li…
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