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

[zh-cn]: Update translation of autoplay_guide #14663

Merged
merged 10 commits into from
Aug 22, 2023
Merged

[zh-cn]: Update translation of autoplay_guide #14663

merged 10 commits into from
Aug 22, 2023

Conversation

R2h1
Copy link
Contributor

@R2h1 R2h1 commented Jul 28, 2023

[zh-cn]: Update translation of autoplay_guide

Description

Motivation

Additional details

Related issues and pull requests

[zh-cn]: Update translation of autoplay_guide
@R2h1 R2h1 requested a review from a team as a code owner July 28, 2023 03:53
@R2h1 R2h1 requested review from yin1999 and removed request for a team July 28, 2023 03:53
@github-actions github-actions bot added the l10n-zh Issues related to Chinese content. label Jul 28, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jul 28, 2023

Preview URLs

Flaws (2)

URL: /zh-CN/docs/Web/Media/Autoplay_guide
Title: 媒体和 Web Audio API 的自动播放指南
Flaw count: 2

  • macros:
    • /zh-CN/docs/Web/API/HTMLMediaElement/allowedToPlay does not exist
  • broken_links:
    • Can use the English (en-US) link as a fallback

(comment last updated: 2023-08-22 04:45:28)

R2h1 added 2 commits July 28, 2023 12:18
[zh-cn]: Update translation of autoplay_guide
[zh-cn]: Update translation of autoplay_guide
files/zh-cn/web/media/autoplay_guide/index.md Outdated Show resolved Hide resolved
files/zh-cn/web/media/autoplay_guide/index.md Outdated Show resolved Hide resolved
files/zh-cn/web/media/autoplay_guide/index.md Outdated Show resolved Hide resolved
R2h1 and others added 4 commits July 30, 2023 10:36
Update translation of autoplay_guide

Co-authored-by: A1lo <[email protected]>
Update translation of autoplay_guide

Co-authored-by: A1lo <[email protected]>
[zh-cn]: Update translation of autoplay_guide
[zh-cn]: Update translation of autoplay_guide

Autoplay blocking is _not_ applied to {{HTMLElement("video")}} elements when the source media does not have an audio track, or if the audio track is muted. Media with an active audio track are considered to be **audible**, and autoplay blocking applies to them. **Inaudible** media are not affected by autoplay blocking.
当源媒体没有音轨或音轨静音时,阻止自动播放*不会*应用于 {{HTMLElement("video")}} 元素。具有活动音轨的媒体被认为是**可听的**,并且阻止自动播放适用于它们。**听不见的**媒体不受阻止自动播放的影响。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

感觉这里的“audible”有点过于“直译”,考虑一下是否要翻译成“未静音”和“静音”。

files/zh-cn/web/media/autoplay_guide/index.md Outdated Show resolved Hide resolved
files/zh-cn/web/media/autoplay_guide/index.md Outdated Show resolved Hide resolved
files/zh-cn/web/media/autoplay_guide/index.md Outdated Show resolved Hide resolved
files/zh-cn/web/media/autoplay_guide/index.md Outdated Show resolved Hide resolved
files/zh-cn/web/media/autoplay_guide/index.md Outdated Show resolved Hide resolved
files/zh-cn/web/media/autoplay_guide/index.md Outdated Show resolved Hide resolved
files/zh-cn/web/media/autoplay_guide/index.md Outdated Show resolved Hide resolved
Comment on lines 90 to 96
function handleFirstPlay(event) {
let vid = event.target;

vid.onplay = null;

// Start whatever you need to do after playback has started
// 播放开始后开始执行您需要执行的操作
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
```

After getting a reference to the video element from the {{domxref("Event")}} object's {{domxref("Event.target", "target")}}, the element's `onplay` handler is set to `null`. This will prevent any future `play` events from being delivered to the handler. That could happen if the video is paused and resumed by the user or automatically by the browser when the document is in a background tab.
{{domxref("Event")}} 对象的 {{domxref("Event.target", "target")}} 获取对视频元素的引用后,该元素的 `onplay` 处理程序将设置为 `null`。这将阻止任何未来的播放事件被传递给处理程序。当文档位于后台选项卡时,如果用户暂停并恢复视频或浏览器自动暂停和恢复视频,则可能会发生这种情况。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

对照英文更新翻译

@yin1999 yin1999 self-assigned this Aug 22, 2023
Copy link
Member

@yin1999 yin1999 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @R2h1

@R2h1
Copy link
Contributor Author

R2h1 commented Aug 22, 2023 via email

@yin1999 yin1999 merged commit ed8eda3 into mdn:main Aug 22, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
l10n-zh Issues related to Chinese content.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants