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

Accessibility: after tap play/pause button, the accessibility focus goes to the parent page view #9111

Closed
ryxryx opened this issue Jun 24, 2021 · 2 comments
Assignees
Labels

Comments

@ryxryx
Copy link

ryxryx commented Jun 24, 2021

Steps to reproduce

  • Enable "TalkBack" on your Android device
  • Go to play any video
  • Tap on player area -> TalkBack says "show player controls"
  • Activate it to make Player controls show
  • Tap on pause button -> video is paused, but accessibility focus is not on the player anymore. Ideally the focus should fall on play button. Same thing when tapping on play button.

Here is the xml of my exoplayer controls, the playerPlayPauseContainer is inside the exoplayer control view xml file.

<FrameLayout
            android:id="@+id/playerPlayPauseContainer"
            android:layout_width="46dp"
            android:layout_height="66dp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintHorizontal_bias="0.5"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.5">

            <com.cw.app.ui.playback.PlayerControlButton
                android:id="@id/exo_play"
                style="@style/PlaybackControlButton.PlayPause"
                android:contentDescription="@string/playback_play"
                app:srcCompat="@drawable/ic_playback_hollow_play" />

            <com.cw.app.ui.playback.PlayerControlButton
                android:id="@id/exo_pause"
                style="@style/PlaybackControlButton.PlayPause"
                android:contentDescription="@string/playback_pause"
                app:srcCompat="@drawable/ic_playback_pause" />

        </FrameLayout>

This is causing inconvenience to our users who use TalkBack. After they tap play/pause button, they would need to navigate all the way back to the controls on the player.

I tried to manually set accessibility focus in Google IMA "VideoStreamPlayer" onPlay() and onPause() events, but didn't work. It looks like the player controls aren't able to be set accessibility focus easily. Is there something we can do? Thanks!

ExoPlayer version number: 2.11.3 and 2.14.1
Android version: Android 10; Android 7
Android device: Samsung Tab A; Nexus 9

@ojw28
Copy link
Contributor

ojw28 commented Jun 25, 2021

Thanks for raising this! There's some logic in PlayerControlView that handles this for key focus, but it doesn't appear to handle the accessibility focus case at the moment. For key focus, we:

  1. Transfer focus from the play button to the pause button (and vice versa) when playback is started (and stopped)
  2. Focus either the play or pause button (depending on the player state) when the controls are made visible.

You're requesting that we enable (1) for accessibility, which we can do. Do you think (2) would also make sense for accessibility? I'm unsure what a user would prefer in this case. Thanks!

@ojw28 ojw28 self-assigned this Jun 25, 2021
@ryxryx
Copy link
Author

ryxryx commented Jun 28, 2021

Hello, thanks for you reply.

For #2, it's probably not needed. The users can choose to select the control they want. The accessibility team I have worked with didn't mention they would prefer a behaviour like this, but this is just our thoughts. Thanks!

ojw28 added a commit that referenced this issue Sep 7, 2021
- Fix focus when pausing and resuming
- Prevent repeated readout of the playback position when paused

#exofixit
#minor-release
Issue #9111

PiperOrigin-RevId: 395301765
@ojw28 ojw28 closed this as completed Sep 7, 2021
christosts pushed a commit that referenced this issue Sep 21, 2021
- Fix focus when pausing and resuming
- Prevent repeated readout of the playback position when paused

Issue #9111

PiperOrigin-RevId: 395301765
@google google locked and limited conversation to collaborators Nov 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants