androidx / media

Jetpack Media3 support libraries for media use cases, including ExoPlayer, an extensible media player for Android
https://developer.android.com/media/media3
Apache License 2.0
1.71k stars 408 forks source link

Feedback issue when Talk back is one in Accessibility Settings Google TV 4K for Media 1.4.1-alpha GitHub (Exoplayer) Wh #1385

Open pooya-mohammadhossein opened 5 months ago

pooya-mohammadhossein commented 5 months ago

Version

Media3 main branch

More version details

Feedback for Media 1.4.1-alpha GitHub (Exoplayer) Issue: Talkback incompatibility in media demo app on Google TV 4K Chromecast with collapsed categories Steps to reproduce:

  1. On Google TV 4K Chrome-cast, navigate to Settings > Accessibility.
  2. Enable Talkback.
  3. Launch the media demo app.
  4. In the media.exolist.json file, collapse a main category.
  5. Expand the collapsed category again. Expected behavior:
    • Talkback should announce the expanded category and maintain the cursor's highlighted position within the channel list. Observed behavior:
    • After expanding the category, Talkback loses track of the previously highlighted item, and the cursor position is reset. Additional information:
    • The issue only occurs with Talkback enabled. Disabling Talkback allows collapsing and expanding categories without problems.
    • Developer mode within Talkback settings ([Settings > Accessibility > Talkback > Advanced]) can be used for debugging. Impact:
    • This incompatibility hinders accessibility for users who rely on Talkback to navigate the media demo app. Recommendation:
    • Investigate the cause of the cursor position being lost when expanding collapsed categories with Talkback enabled.
    • Implement a fix to ensure Talkback maintains focus and announces content changes appropriately. Thank you, Pooya M Note:
    • I've replaced the bracketed text with a more descriptive explanation of the developer mode option. I hope this formatted feedback is helpful for you to forward to the media 1.4.1-alpha GitHub repository.

Devices that reproduce the issue

Google TV 4K Chrome-cast (and also Android TV probably)

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

Yes

Reproduction steps

Steps to reproduce:

On Google TV 4K Chromecast, navigate to Settings > Accessibility. Enable Talkback. Launch the media demo app. In the media.exolist.json file, collapse a main category. Expand the collapsed category again.

Expected result

Talkback should announce the expanded category and maintain the cursor's highlighted position within the channel list.

Actual result

After expanding the category, Talkback loses track of the previously highlighted item, and the cursor position is reset.

Media

Media 1.4.1-alpha GitHub (Exoplayer)

Bug Report

marcbaechinger commented 5 months ago

Thanks for reporting!

Is this problem specific to a TV device or can you repro the same on a mobile device?

After expanding the category, Talkback loses track of the previously highlighted item, and the cursor position is reset.

When trying this on a mobile phone with a Pixel 6 on Android 14 this seems to work. The selected and collapsed/expanded item is kept selected.

When I double tap the header of a category, it reads the category name and says that the category is collapsed. If I double tap it gives an audio feedback that the section is open. When (single) tapping on the item again it announces that it is expanded. So it looks like Talkback is aware of the state of the UI.

Talkback should announce the expanded category and maintain the cursor's highlighted position within the channel list.

As mentioned above, for what I see Talkback is aware of the UI state and I'd assume that it reacts in a standard way that Talkback users are used to.

How did you come to the conclusion that Talkback is expected to announce the expanded category any further than it currently does? Can you give us a hint how to enhance the UI element to work like you describe?

For now I think that the UI/Talkback integration works in a standard way. Or can you give us an example app that has such a UI element that behaves as you expect. If you can educate us that way we would be happy to change this accordingly.

pooya-mohammadhossein commented 5 months ago

@marcbaechinger

You are most welcome. I am using Media Library 1.4.0-alpha1

in SampleChooserActivity.Java I have done set following which work Perfectly and as I expected when Talk back Setting is Off but when I enable the Talk back Settings one with Media Library, the selected item would be messed up:

I will show part of the Java code for your reference:

  private void onPlaylistGroups(final List<PlaylistGroup> groups, boolean sawError) {
….
….
    SharedPreferences preferences = getPreferences(MODE_PRIVATE);
    int groupPosition = preferences.getInt(GROUP_POSITION_PREFERENCE_KEY, /* defValue= */ 0);
    int childPosition = preferences.getInt(CHILD_POSITION_PREFERENCE_KEY, /* defValue= */ 0);

    // Clear the group and child position if either are unset or if either are out of bounds.

    if (
        groupPosition <= groups.size()
        && childPosition < groups.get(groupPosition).playlists.size()) {
      sampleListView.expandGroup((groupPosition)); // shouldExpandGroup does not work without this.
      sampleListView.setSelectedChild(groupPosition , childPosition, /* shouldExpandGroup= */ false);
}
}

To be honest with you I guess it's mostly might related to Shared Preferences issue but this need to me more investigated and montiored : I mean some of The Shared Prefrences following Line on The onPlaylistGroups Methods are completely deprecated ie on following line Context.MODE_WORLD_READABLE are completely Deprecated and if it wiill be set the Media Demo application will crash in the start-up:

SharedPreferences preferences = getPreferences(Context.MODE_WORLD_READABLE); I have also tested another Shared Preferences variable (Context.MODE_APPEND) and make no change when using Talk back Off.

P.S : as i mentioned erlier my Android (which has the all the functionality to play IPTV , Youtube Player Videos and Also Youtube Player Playlists , Radios etc) are perfectly works unless in The Google TV 4K (Chrome-cast) i will set the Talk back one, which still works but it loose the setSelectedChild Child positions when changing the selected item from main Category to Sub Category, I mean when i scroll down to the Sub Category When the talk back is one > and then when i collapse and then right immediately after the expand the sub category it will move the the selected item not as expected when the Talk back is one.

P.S 2: Talk back One settings is new With Android Google TV 4K Chrome-cast and Some Other Enterprise application like Spotify and TikTok Also is not compatible yet with The Talk Back Setting (although Recently Youtube And Netflix Works much better with Talk back Settings one)

it's honestly and seriously very new Settings on Android which is really complicated issue for rare conditions which I hope i well explained it clearly and I am so Sorry for my language barrier. If you have any more questions or concerns as mentioned you and any Senior at Google Are most welcome to ask me.

Thanks in advance! Cheers! All the Best! Kindest And Warm Regards, Pooya M Pooya Mohammadhossein