You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
StyledPlayerView.setOnClickListener doesn't work when useController=false #9605
As the title suggests, if I set useController to false (either from XML, or code), the click listener just doesn't work.
In onTouchEvent, StyledPlayerView returns false in such a case, so I think it was implemented that way, so I guess the current design is it should not accept a custom OnClickListener if the controller is disabled. Is there any reason why? What should I do to have custom click listener without using the controller?
ExoPlayer version: 2.15.1.
Tested device: LG G7/Android 10.
IMO there are cases where the client doesn't enable the controller but still allows the user to click the video, for example, to switch between portrait and landscape. I'm curious if there is a way to enable such behavior.
I have an idea of using a custom Controller UI that doesn't show anything ... But want to know if there is another approach. Feel free to close this issue if the current decision is fixed.
This doesn't seem ideal. It looks like there are some other broken cases as well. For example, registering a long click listener doesn't work, regardless of whether there's a controller or not. I'm going to try and remove overriding of onTouchEvent to fix this.
Activity
eneim commentedon Oct 25, 2021
I found these 2 related issues that kinda the motivation to disable the touch:
#6340
#1923
IMO there are cases where the client doesn't enable the controller but still allows the user to click the video, for example, to switch between portrait and landscape. I'm curious if there is a way to enable such behavior.
I have an idea of using a custom Controller UI that doesn't show anything ... But want to know if there is another approach. Feel free to close this issue if the current decision is fixed.
ojw28 commentedon Mar 7, 2022
This doesn't seem ideal. It looks like there are some other broken cases as well. For example, registering a long click listener doesn't work, regardless of whether there's a controller or not. I'm going to try and remove overriding of
onTouchEventto fix this.Fix PlayerView touch handling
Fix PlayerView touch handling
ojw28 commentedon Mar 15, 2022
Fixed in
dev-v2. The fix will be included in 2.18.