-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Better player error handling #7142
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
Better player error handling #7142
Conversation
89a9573
to
0accbb4
Compare
I was thinking about a different approach for exceptions to report in services. I would create a new static method in the |
Having an option to change error reporting mode and showing it to the user seems complicated for them, and also introduces a new setting the user has to know about |
Should I change anything now here in this PR? Or do you want to do a followup? |
9fbda16
to
79152e3
Compare
Exoplayer sometimes throws exception that are not serializable, e.g.:
So I guess we have to do some kind of workaround here... |
79152e3
to
e34b2eb
Compare
Added a workaround by converting the affected exceptions into a serializable ones. Can be tested using #7302 |
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.
Or do you want to do a followup?
Yes, I'll do a followup
app/src/main/java/org/schabi/newpipe/player/playererror/PlayerErrorHandler.java
Show resolved
Hide resolved
app/src/main/java/org/schabi/newpipe/player/playererror/PlayerErrorHandler.java
Show resolved
Hide resolved
app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailPlayerCrasher.java
Outdated
Show resolved
Hide resolved
app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailPlayerCrasher.java
Show resolved
Hide resolved
* Added a new setting so that player errors are reported (under Video and Audio > Player) * Moved the player error logic to separate class specially created for this purpose
beeaba6
to
0d51eef
Compare
@Stypox I think it would be better to have this kind of discussion here in the main PR comments instead of code review comments. You're not really reviewing "code". You're commenting on a general design/logic decision taken by the author, which can get lost among all the other actual code review comments. (Plus Github notifications can't properly link to the exact comment. You're just taken to the PR page and have to find it yourself, unlike a main PR comment, where you're taken to the actual comment.) Also, you were kicked by the IRC bot for being idle. Pls rejoin. |
@Stypox |
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 it would be better to have this kind of discussion here in the main PR comments instead of code review comments.
You are right, sorry
I am unable to test whether the crasher works since I keep getting this unrelated exception when I click on the crash button, but before the selection menu shows up:
Exception
- User Action: ui error
- Request: ACRA report
- Content Language: en-GB
- Service: none
- Version: 0.21.13
- OS: Linux Android 10 - 29
Crash log
android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running?
at android.view.ViewRootImpl.setView(ViewRootImpl.java:928)
at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:387)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:95)
at android.app.Dialog.show(Dialog.java:342)
at org.schabi.newpipe.fragments.detail.VideoDetailPlayerCrasher.onCrashThePlayer(VideoDetailPlayerCrasher.java:133)
at org.schabi.newpipe.fragments.detail.VideoDetailFragment.lambda$initListeners$1$org-schabi-newpipe-fragments-detail-VideoDetailFragment(VideoDetailFragment.java:660)
at org.schabi.newpipe.fragments.detail.VideoDetailFragment$$ExternalSyntheticLambda18.onClick(Unknown Source:2)
at android.view.View.performClick(View.java:7259)
at android.view.View.performClickInternal(View.java:7236)
at android.view.View.access$3600(View.java:801)
at android.view.View$PerformClick.run(View.java:27892)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:491)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:940)
app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailPlayerCrasher.java
Outdated
Show resolved
Hide resolved
@Stypox |
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 to me, thank you! I will start the followup PR this week :-)
What is it?
Description of the changes in your PR
This PR massively improves the handling of player errors. It consist of 2 parts:
1. Improving the player error handling
Up to this PR player errors are always just reported as
(or similar)

This PR introduces an option (default=off) to report the Error directly (via acra):
NPBetterErrorHandlingDemo.mp4
2. Added an option to simulate player errors
To simulate errors a debug option was introduced to crash the player.
Notes:
DebugSettingsFragment
)VideoDetailFragment
- otherwise at least sometimes there is no UI where the error can be triggered from.Player#onPlayerError
is simply called with an exceptionFixes the following issue(s)
APK testing
The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR.
Due diligence