Skip to content
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

PlayerView click handling if finger is lifted outside view #9861

Closed
ivk1800 opened this issue Jan 13, 2022 · 2 comments
Closed

PlayerView click handling if finger is lifted outside view #9861

ivk1800 opened this issue Jan 13, 2022 · 2 comments
Assignees

Comments

@ivk1800
Copy link

ivk1800 commented Jan 13, 2022

If drag finger started on player view and end on outside view, triggered MotionEvent.ACTION_UP event and triggered toggle player controls. also if begin drag finger on playerview and end on it, player controls same triggered.

Reproduction steps:

open demo app, modify player_activity.xml set some fixed hegiht for playerview, example 100dp
run on device or emulator. play any example from list.

  • ExoPlayer version number: r2.16.1
  • Android version: any supported version
  • Android device: any supported device
@icbaker
Copy link
Collaborator

icbaker commented Jan 13, 2022

I can reproduce the described behaviour (using StyledPlayerView for completeness) - over to Olly to decide whether both of these are bugs and how to handle them:

  • drag finger starting on player view and end outside view: player controls are shown
  • drag finger starting on player view and elsewhere inside the view: player controls are shown

I note that touching outside the player view and dragging a finger inside it before releasing does not trigger the controls.

@icbaker icbaker assigned ojw28 and unassigned icbaker Jan 13, 2022
icbaker pushed a commit to androidx/media that referenced this issue Mar 9, 2022
Overriding onTouchEvent was causing multiple issues, and
appears to be unnecessary. Removing the override fixes:

1. StyledPlayerView accessibility issue where "hide player
   controls" actually toggled play/pause.
2. Delivery of events to a registered OnClickListener when
   useController is false.
3. Delivery of events to a registered OnLongClickListener
   in all configurations.
4. Incorrectly treating a sequence of touch events that
   exit the bounds of the view before ACTION_UP as a click,
   both for delivery to OnClickListener and for toggling
   the controls.

Note: After this change, control visibility will not be
toggled if the application developer explicitly sets the
view to be non-clickable. I think that's probably working
as intended though. It seems correct that a non-clickable
view would not respond to clicks.

Issue: google/ExoPlayer#8627
Issue: google/ExoPlayer#9605
Issue: google/ExoPlayer#9861
PiperOrigin-RevId: 433016626
icbaker pushed a commit that referenced this issue Mar 9, 2022
Overriding onTouchEvent was causing multiple issues, and
appears to be unnecessary. Removing the override fixes:

1. StyledPlayerView accessibility issue where "hide player
   controls" actually toggled play/pause.
2. Delivery of events to a registered OnClickListener when
   useController is false.
3. Delivery of events to a registered OnLongClickListener
   in all configurations.
4. Incorrectly treating a sequence of touch events that
   exit the bounds of the view before ACTION_UP as a click,
   both for delivery to OnClickListener and for toggling
   the controls.

Note: After this change, control visibility will not be
toggled if the application developer explicitly sets the
view to be non-clickable. I think that's probably working
as intended though. It seems correct that a non-clickable
view would not respond to clicks.

Issue: #8627
Issue: #9605
Issue: #9861
PiperOrigin-RevId: 433016626
@ojw28
Copy link
Contributor

ojw28 commented Mar 15, 2022

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

@ojw28 ojw28 closed this as completed Mar 15, 2022
@google google locked and limited conversation to collaborators May 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants