mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Add a method to focus the 'skip ad' button, if shown
Issue: #8565 #minor-release PiperOrigin-RevId: 356691251
This commit is contained in:
parent
a062075462
commit
41c94edcc2
3 changed files with 23 additions and 0 deletions
|
|
@ -13,6 +13,9 @@
|
||||||
* Fix a bug where an assertion would fail if the player started to buffer
|
* Fix a bug where an assertion would fail if the player started to buffer
|
||||||
an ad media period before the ad URI was known then an ad state update
|
an ad media period before the ad URI was known then an ad state update
|
||||||
arrived that didn't set the ad URI.
|
arrived that didn't set the ad URI.
|
||||||
|
* Add `ImaAdsLoader.focusSkipButton` to allow apps to request that the
|
||||||
|
skip button should receive UI focus, if shown
|
||||||
|
([#8565](https://github.com/google/ExoPlayer/issues/8565)).
|
||||||
* Remove deprecated symbols:
|
* Remove deprecated symbols:
|
||||||
* Remove `Player.DefaultEventListener`. Use `Player.EventListener`
|
* Remove `Player.DefaultEventListener`. Use `Player.EventListener`
|
||||||
instead.
|
instead.
|
||||||
|
|
|
||||||
|
|
@ -281,6 +281,16 @@ import java.util.Map;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Moves UI focus to the skip button (or other interactive elements), if currently shown. See
|
||||||
|
* {@link AdsManager#focus()}.
|
||||||
|
*/
|
||||||
|
public void focusSkipButton() {
|
||||||
|
if (adsManager != null) {
|
||||||
|
adsManager.focus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Starts passing events from this instance (including any pending ad playback state) and
|
* Starts passing events from this instance (including any pending ad playback state) and
|
||||||
* registers obstructions.
|
* registers obstructions.
|
||||||
|
|
|
||||||
|
|
@ -473,6 +473,16 @@ public final class ImaAdsLoader implements Player.EventListener, AdsLoader {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Moves UI focus to the skip button (or other interactive elements), if currently shown. See
|
||||||
|
* {@link AdsManager#focus()}.
|
||||||
|
*/
|
||||||
|
public void focusSkipButton() {
|
||||||
|
if (currentAdTagLoader != null) {
|
||||||
|
currentAdTagLoader.focusSkipButton();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// AdsLoader implementation.
|
// AdsLoader implementation.
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue