Skip to content

StyledPlayerView.setOnClickListener doesn't work when useController=false #9605

Closed

Description

@eneim

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.

Activity

  1. eneim commented on Oct 25, 2021

    @eneim
    ContributorAuthor

    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.

  2. self-assigned this
    on Nov 1, 2021
  3. ojw28 commented on Mar 7, 2022

    @ojw28
    Contributor

    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.

  4. ojw28 commented on Mar 15, 2022

    @ojw28
    Contributor

    Fixed in dev-v2. The fix will be included in 2.18.

  5. locked and limited conversation to collaborators on May 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions