Add config to allow default action for first touch #624
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ticket: https://bitmovin.atlassian.net/browse/PI-2655
Description
Currently, when the small-screen ads UI is used on a touch device, two touches are needed to either hit the "skip ad" button or to open the ad click-through URL. Especially for the "skip ad" button this is a confusing user experience as it is always visible and one touch should be sufficient to tap it.
To fix this, a new configuration option
allowDefaultActionOnFirstTouch
is introduced onUIContainerConfig
that can be used to control whether the default action should be executed after showing the hidden UI on a first touch. TheallowDefaultActionOnFirstTouch
flag is now set totrue
formodernSmallScreenAdsUI
, allowing first touches to trigger the click-through URL and also the "skip ad" button.Discussion
A drawback of this approach is that also buttons from the title bar can receive this first touch now during ads. Specifically, the fullscreen button, which is the only one that is visible there during ad playback.
There would be some ways to improve on this situation:
onClick
event that determines if it is a first touch. Event receiving components could check for this flag and decide on their own if they want to handleonClick
in case they are first touches. The "skip ad" button and the ad click overlay would be then implemented in a way that they acceptonClick
s that are first touches and the fullscreen button would ignore suchonClick
events.UIContainer.touchend
event handler if the default action should be prevented or not based on the event target.(1) seems a bit more elegant than (2) as the components are allowed to decide for themselves if they want to react to first touches.
Tests
Checklist (for PR submitter and reviewers)
CHANGELOG
entry