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

How to prevent and force focus to "skip button" manually use IMA extension #5019

Closed
anhlevfx opened this issue Oct 29, 2018 · 2 comments
Closed
Assignees

Comments

@anhlevfx
Copy link

Issue description

In android TV. Video with ads use exoplayer-IMA extension version 2.8.4 have some codes to focus skip button on skippable ads. I have modified ima extension to can prevent focus or force focus skip button. Because our UX require that behavior. Everything work as I expected. But, when update to version 2.9.0, I can't do that.

Reproduction steps

In version 2.9.0 don't have this declare

 private static final String FOCUS_SKIP_BUTTON_WORKAROUND_JS = "javascript:"
      + "try{ document.getElementsByClassName(\"videoAdUiSkipButton\")[0].focus(); } catch (e) {}";

In version 2.8.4 have this code

case STARTED:
        if (ad.isSkippable()) {
          focusSkipButton();
        }
        break;

so I can prevent focus to button by don't call focusSkipButton(), and call it when I need.

But in version 2.9.0
case STARTED:
it's empty. I guess focus skip button is auto and work without trick like before.

Link to test content

Not provided

Version of ExoPlayer being used

2.9.0

Device(s) and version(s) of Android being used

Android TV version 8, 7.1.

A full bug report captured from the device

Not provided

@andrewlewis andrewlewis self-assigned this Oct 29, 2018
@andrewlewis
Copy link
Collaborator

The IMA SDK takes care of focusing the skip button automatically on Android TV as of IMA SDK version 3.9.4.

At the moment it's not possible to customize the default behavior (focusing the button) because this needs to be set on AdsRenderingSettings and ImaAdsLoader creates this internally. I'll make a change so apps can pass in a value for setFocusSkipButtonWhenAvailable. (That said, I find it difficult to imagine a case where you wouldn't want the default behavior!)

@anhlevfx
Copy link
Author

Thanks you and waiting for your change. In my case, I have layout with a preview video (live tv) in top-right with about 60% width and 40% height of screen. 50% height below for list RowFragment, the list channel. When use press center button on D-pad video preview with resize full screen. But when user still focus to item in list channel and they don't press center button (they maybe press left/right/up/down button to find the channel they want). So, I don't want auto focus skip button when video in preview mode. It's will make loss focus current item in the list and user will be confused.

ojw28 pushed a commit that referenced this issue Oct 31, 2018
Issue: #5019

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=219267048
ojw28 pushed a commit that referenced this issue Oct 31, 2018
Issue: #5019

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=219267048
@ojw28 ojw28 removed the question label Nov 5, 2018
@ojw28 ojw28 closed this as completed Nov 5, 2018
@google google locked and limited conversation to collaborators May 16, 2019
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