-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[video_player_android] Handle BehindLiveWindowException #5869
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
[video_player_android] Handle BehindLiveWindowException #5869
Conversation
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.
Looks good! Just left some nits and a question about forwarding the error code to Dart.
@@ -1,3 +1,7 @@ | |||
## 2.4.12 | |||
|
|||
* Adds error handling for `BehindLiveWindowException` |
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.
Nit:
* Adds error handling for `BehindLiveWindowException` | |
* Adds error handling for `BehindLiveWindowException`, which may occur upon video playback failure. |
// See https://exoplayer.dev/live-streaming.html#behindlivewindowexception-and-error_code_behind_live_window | ||
exoPlayer.seekToDefaultPosition(); | ||
exoPlayer.prepare(); | ||
} else if (eventSink != null) { |
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.
Would we not still want to forward the video error to Dart?
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.
I think not, since it's basically un-actionable from Dart. It could make sense if there was an option to disable this error handling logic from Dart, but it would require a change in platform interface - this seems to be an overkill for this fix.
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.
Longer term it would make more sense to have no handling here, and forward more structured errors to the clients so they could decide how to handle them, but we can start with this and see if there are requests for more control.
@@ -278,4 +281,28 @@ public void onIsPlayingChangedSendsExpectedEvent() { | |||
assertEquals(event2.get("event"), "isPlayingStateUpdate"); | |||
assertEquals(event2.get("isPlaying"), false); | |||
} | |||
|
|||
@Test | |||
public void behindLiveWindowErrorResets() { |
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.
Nit: can this be slightly more descriptive to describe what we expect? Something like:
public void behindLiveWindowErrorResets() { | |
public void behindLiveWindowErrorResetsPlaybackPositionToDefault() { |
…g_exception_fix # Conflicts: # packages/video_player/video_player_android/CHANGELOG.md
…_fix' into video_player_streaming_exception_fix
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.
LGTM!
@camsim99 Is there any further action needed from my side? Or you'll just need to add the autosubmit label? |
Ah sorry I didn't realize I needed to add it! |
auto label is removed for flutter/packages/5869, due to This PR has not met approval requirements for merging. The PR author is not a member of flutter-hackers and needs 1 more review(s) in order to merge this PR.
|
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.
LGTM
// See https://exoplayer.dev/live-streaming.html#behindlivewindowexception-and-error_code_behind_live_window | ||
exoPlayer.seekToDefaultPosition(); | ||
exoPlayer.prepare(); | ||
} else if (eventSink != null) { |
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.
Longer term it would make more sense to have no handling here, and forward more structured errors to the clients so they could decide how to handle them, but we can start with this and see if there are requests for more control.
flutter/packages@0a69259...9385bbb 2024-02-13 [email protected] Convert startProductRequest(), finishTransaction(), restoreTransactions(), presentCodeRedemptionSheet() to pigeon (flutter/packages#6032) 2024-02-13 49699333+dependabot[bot]@users.noreply.github.com [in_app_pur]: Bump org.json:json from 20231013 to 20240205 in /packages/in_app_purchase/in_app_purchase/example/android/app (flutter/packages#6096) 2024-02-12 [email protected] [local_auth] Rename iOS classes (flutter/packages#6108) 2024-02-12 [email protected] [video_player_android] Handle BehindLiveWindowException (flutter/packages#5869) 2024-02-12 [email protected] [in_app_purchase] Add alternative billing apis for android (flutter/packages#6056) 2024-02-12 [email protected] [webview_flutter] Update compileSdk to 34 (flutter/packages#6106) 2024-02-12 [email protected] [cupertino_icons] Add example to cupertino icons (flutter/packages#5312) 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 [email protected],[email protected] 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
This PR adds error handling for BehindLiveWindowException when playing video streams as recommended in ExoPlayer docs
Fixes flutter/flutter#100478
Pre-launch Checklist
dart format
.)[shared_preferences]
pubspec.yaml
with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.md
to add a description of the change, following repository CHANGELOG style.///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.