-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move Player.Listener
impl, remove @VisibleForTesting isInitialized
.
#6922
Conversation
Player.Listener
impl, remove @VisibleForTesting isInitialized
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly LGTM just one question about the Player.STATE_BUFFERING
case
public void onPlaybackStateChanged(final int playbackState) { | ||
switch (playbackState) { | ||
case Player.STATE_BUFFERING: | ||
setBuffering(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a slight behavior change, right?
Before we would always invoke videoPlayerEvents.onBufferingUpdate(exoPlayer.getBufferedPosition())
:
setBuffering(true);
sendBufferingUpdate();
but now we only invoke it if we pass the check at the start of the slightly modified setBuffering
.
I don't know enough about video_player
to know if that case (we are in the case of this switch Player.STATE_BUFFERING
while isBuffering
is already true) can happen/matters, so feel free to ignore if it isn't important.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not only was this a good catch, but you caught a bug missed in the previous refactor.
I've fixed this and added a test to catch regressions.
@camsim99 I am going to add auto-submit to fix the previous regression, but please leave comments still and I promise I'll address in a follow-up PR. |
auto label is removed for flutter/packages/6922, due to - The status or check suite Linux_android android_device_tests_shard_1 master has failed. Please fix the issues identified (or deflake) before re-applying this label. |
…`. (flutter#6922) Similar to flutter#6908, as part of flutter/flutter#148417. I'm working on re-landing flutter#6456, this time without using the `ActivityAware` interface (see flutter/flutter#148417). As part of that work, I'll need to better control the `ExoPlayer` lifecycle and save/restore internal state. In this PR, I've removed the concept of the class being "initialized" or not - the only thing "initialized" means is "for a given instance of `ExoPlayer`, has received the `'initialized'` event. As a result I removed the quasi-public API that was used for testing only and replaced it with observing what the real production instance does (`Player.STATE_READY`). After this PR, I'll likely do one more pass around the constructors - the constructor that takes an `ExoPlayer` that is marked `@VisibleForTesting` _also_ doesn't make sense once we'll support suspending/resuming video players, so it will need to get reworked (probably into taking a factory method).
flutter/packages@7805455...dd04ab1 2024-06-13 matanlurey@users.noreply.github.com Move `Player.Listener` impl, remove `@VisibleForTesting isInitialized`. (flutter/packages#6922) 2024-06-13 engine-flutter-autoroll@skia.org Roll Flutter from b1f9d71 to 01db23b (15 revisions) (flutter/packages#6921) 2024-06-13 matanlurey@users.noreply.github.com Refactor `VideoPlayer` to be less exposed to `EventChannel` & related (flutter/packages#6908) 2024-06-13 v.ditsyak@gmail.com [go_router] Added proper `redirect` handling for `ShellRoute.$route` and `StatefulShellRoute.$route` for proper redirection handling in case of code generation (flutter/packages#6841) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC flutter-ecosystem@google.com,rmistry@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
flutter/packages@7805455...dd04ab1 2024-06-13 matanlurey@users.noreply.github.com Move `Player.Listener` impl, remove `@VisibleForTesting isInitialized`. (flutter/packages#6922) 2024-06-13 engine-flutter-autoroll@skia.org Roll Flutter from b1f9d71 to 01db23b (15 revisions) (flutter/packages#6921) 2024-06-13 matanlurey@users.noreply.github.com Refactor `VideoPlayer` to be less exposed to `EventChannel` & related (flutter/packages#6908) 2024-06-13 v.ditsyak@gmail.com [go_router] Added proper `redirect` handling for `ShellRoute.$route` and `StatefulShellRoute.$route` for proper redirection handling in case of code generation (flutter/packages#6841) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC flutter-ecosystem@google.com,rmistry@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
flutter/packages@7805455...dd04ab1 2024-06-13 matanlurey@users.noreply.github.com Move `Player.Listener` impl, remove `@VisibleForTesting isInitialized`. (flutter/packages#6922) 2024-06-13 engine-flutter-autoroll@skia.org Roll Flutter from b1f9d71 to 01db23b (15 revisions) (flutter/packages#6921) 2024-06-13 matanlurey@users.noreply.github.com Refactor `VideoPlayer` to be less exposed to `EventChannel` & related (flutter/packages#6908) 2024-06-13 v.ditsyak@gmail.com [go_router] Added proper `redirect` handling for `ShellRoute.$route` and `StatefulShellRoute.$route` for proper redirection handling in case of code generation (flutter/packages#6841) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC flutter-ecosystem@google.com,rmistry@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…allback`. (#6982) I'm working on re-landing #6456, this time without using the `ActivityAware` interface (see flutter/flutter#148417). As part of that work, I'll need to better control the `ExoPlayer` lifecycle and save/restore internal state. Follows the patterns of some of the previous PRs, i.e. - #6922 - #6908 The changes in this PR are _mostly_ tests, it was extremely difficult to just add more tests to the already very leaky `VideoPlayer` abstraction which had lots of `@VisibleForTesting` methods and other "holes" to observe state. This PR removes all of that, and adds test coverage where it was missing. Namely it: - Adds a new class, `VideoAsset`, that builds and configures the media that `ExoPlayer` uses. - Removes all "testing" state from `VidePlayer`, keeping it nearly immutable. - Added tests for most of the classes I've added since, which were mostly missing. That being said, this is a large change. I'm happy to sit down with either of you and walk through it. --- Opening as a draft for the moment, since there is a pubspec change needing I want to handle first.
…allback`. (flutter#6982) I'm working on re-landing flutter#6456, this time without using the `ActivityAware` interface (see flutter/flutter#148417). As part of that work, I'll need to better control the `ExoPlayer` lifecycle and save/restore internal state. Follows the patterns of some of the previous PRs, i.e. - flutter#6922 - flutter#6908 The changes in this PR are _mostly_ tests, it was extremely difficult to just add more tests to the already very leaky `VideoPlayer` abstraction which had lots of `@VisibleForTesting` methods and other "holes" to observe state. This PR removes all of that, and adds test coverage where it was missing. Namely it: - Adds a new class, `VideoAsset`, that builds and configures the media that `ExoPlayer` uses. - Removes all "testing" state from `VidePlayer`, keeping it nearly immutable. - Added tests for most of the classes I've added since, which were mostly missing. That being said, this is a large change. I'm happy to sit down with either of you and walk through it. --- Opening as a draft for the moment, since there is a pubspec change needing I want to handle first.
Similar to #6908, as part of flutter/flutter#148417.
I'm working on re-landing #6456, this time without using the
ActivityAware
interface (see flutter/flutter#148417). As part of that work, I'll need to better control theExoPlayer
lifecycle and save/restore internal state.In this PR, I've removed the concept of the class being "initialized" or not - the only thing "initialized" means is "for a given instance of
ExoPlayer
, has received the'initialized'
event. As a result I removed the quasi-public API that was used for testing only and replaced it with observing what the real production instance does (Player.STATE_READY
).After this PR, I'll likely do one more pass around the constructors - the constructor that takes an
ExoPlayer
that is marked@VisibleForTesting
also doesn't make sense once we'll support suspending/resuming video players, so it will need to get reworked (probably into taking a factory method).