mirror of
https://github.com/samsonjs/media.git
synced 2026-03-30 10:15:48 +00:00
Don't consume touch events if no controller is attached.
Issue:#6109 PiperOrigin-RevId: 255933121
This commit is contained in:
parent
5365272b60
commit
71e0f2e81c
1 changed files with 6 additions and 3 deletions
|
|
@ -1050,6 +1050,9 @@ public class PlayerView extends FrameLayout implements AdsLoader.AdViewProvider
|
|||
|
||||
@Override
|
||||
public boolean onTouchEvent(MotionEvent event) {
|
||||
if (!useController || player == null) {
|
||||
return false;
|
||||
}
|
||||
switch (event.getAction()) {
|
||||
case MotionEvent.ACTION_DOWN:
|
||||
isTouching = true;
|
||||
|
|
@ -1150,9 +1153,6 @@ public class PlayerView extends FrameLayout implements AdsLoader.AdViewProvider
|
|||
// Internal methods.
|
||||
|
||||
private boolean toggleControllerVisibility() {
|
||||
if (!useController || player == null) {
|
||||
return false;
|
||||
}
|
||||
if (!controller.isVisible()) {
|
||||
maybeShowController(true);
|
||||
} else if (controllerHideOnTouch) {
|
||||
|
|
@ -1472,6 +1472,9 @@ public class PlayerView extends FrameLayout implements AdsLoader.AdViewProvider
|
|||
|
||||
@Override
|
||||
public boolean onSingleTapUp(MotionEvent e) {
|
||||
if (!useController || player == null) {
|
||||
return false;
|
||||
}
|
||||
return toggleControllerVisibility();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue