默认状态下,按钮处于自动播放视频的 aria-pressed 状态。

huangapple go评论66阅读模式
英文:

Default state aria-pressed state of button on auto-playing video

问题

用户访问页面时,尚未与按钮进行交互,因此从技术上讲,aria-pressed属性的状态应为false。但由于视频已经在播放,将aria-pressed状态设置为true是否不正确,存在争议。我可以理解双方的论点,但希望使屏幕阅读器用户感到直观。感谢您的见解。

英文:

Just a general question around some decorative videos that auto-play when a user visits the page, along with buttons that pause/play them. I'm just wondering what the load state of the aria-pressed attribute should be when the user visits the page.

The user hasn't interacted with the button yet so technically aria-pressed state would be false, but since the video is already playing is it wrong to have the aria-pressed state set to true.

I can see arguments for both but want to make it as intuitive to screen-reader users as I can. Thanks for your insights.

<button aria-label="Pause video" aria-pressed="true" class="btn-clean">Pause</button>

答案1

得分: 1

当我发现一个带有标签“暂停”的按键,就像你示例代码中的那样,对我来说意味着视频当前处于暂停状态。无论我是否已经与该按钮交互过,都不会改变我的感知,实际上,按下状态与是否已经与按钮交互没有关系。

为了在所有情况下都清楚明了,你应该在更改视频的播放/暂停状态时执行以下两种操作中的一种,但不要同时执行两种操作:

  • 更改按下或未按下的状态,但不要更改标签
  • 更改标签,但不要更改按下或未按下的状态

在第一种情况下,当视频正在播放时,您将会有“播放,按下”状态,当视频未播放时,将会有“播放,未按下”状态。

在第二种情况下,当视频正在播放时,您将会有“暂停”标签,当视频未播放时,您将会有“播放”标签。

请注意,同时更改标签和按下状态会使事情变得不清楚,尤其是“暂停,按下”这种情况特别不清楚。

额外说明:相同的思考也适用于展开/折叠或显示/隐藏按钮。

英文:

When I find out a pressed button with the label "Pause" as in your example code, to me it means that the video is currently paused.
Whether I have already interacted with the button or not doesn't change anything to my perception, and in fact the pressed state has nothing to do with the fact to have already interacted with the button or not.

To make things clear in all cases, you should do one of the two following things upon changing the playing/paused state of the video, but not both:

  • Change the state pressed or not, but never change the label
  • Change the label, but never change the state pressed or not

In the first case, you will ahve "play, pressed" when the video is playing, and "play, not pressed" when the video isn't playing.

IN the second case, you will have "pause" when the video is playing, and "play" when the video isn't playing.

Notice how changing both the label and the pressed state makes things unclear, and in particular how "pause, pressed" is especially unclear.

Bonus note: The same reflection applies to an expand/collapse or show/hide button.

huangapple
  • 本文由 发表于 2023年6月21日 22:49:47
  • 转载请务必保留本文链接:https://go.coder-hub.com/76524598.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定