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.
Description
Problem
When BAM (Bitmovin Advertising Module) is used on touch devices, two touch interactions are necessary to skip an ad or open the ad click-through URL.
On touch input devices, the first touch is expected to display the UI controls and not be propagated to other components. When buttons are always visible, such as the
AdSkipButton
, the first touch seems as if it's not 'recognized'.Possible approaches which we elaborated
Always show the Ads UI
#622
Was not considered as the solution as other elements which should not be there are also always visible.
Global setting to allow default touch on first touch
#624
Was not considered as the solution as non visible elements, e.g. the fullscreen button, would receive the click and perform their actions.
Using
display: none
Most likely the cleanest solution would be to switch from
opacity: 0;
todisplay: none
which would prevent any click listners completely. However,display: none
is not animatable. Technically there are still ways to achieve adisplay: none
approach but we did not want to do such a 'core' change for this.Respecting the visibility of elements
In a POC I implemented an approach to traverse the view hierarchy and detect the visibility of the target element of the touch event. However, this yield other problems. Mainly with the
PlaybackToggleOverlay
which is strictly speaking not visible but technically still there in the DOM tree (there are other elements too). Those would need changes in their visibility handling which was considered out of scope for this fix.Changes
HTMLElements
#626 acts as pre-work for this PR.A new attribute was added to the
ButtonConfig
(acceptsTouchWithUiHidden
) which indicates if a button wants to receive the first touch input even if the UI is currently not visible. This follows the idea from @hawk23 as outlined in #624 (section1)
) but with an inverted dependency.The idea is that every
Button
component can decide if it wants to receive theclick
(touchend
) even if the UI is hidden.Ths setting is then respected in the
UIContainer
on the first touch input if thetouchend
event should be stop bubbling or not.The
AdSkipButton
and theAdClickOverlay
set this new property totrue
Manual Testing
SmallScreenUI
Checklist (for PR submitter and reviewers)
CHANGELOG
entry