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]: create the translation of HTMLMediaElement.sinkId property #21686

Merged
merged 5 commits into from
Jul 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions files/zh-cn/web/api/htmlmediaelement/sinkid/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
title: HTMLMediaElement:sinkId 属性
slug: Web/API/HTMLMediaElement/sinkId
l10n:
sourceCommit: 3df177b401e00e3a855c40fc074b5ef2469b700d
---

{{APIRef("Audio Output Devices API")}}{{securecontext_header}}

{{domxref("HTMLMediaElement")}} 的 **`sinkId`** 只读属性,返回一个作为播放音频输出的设备唯一 ID 的字符串。

这个 ID 应该是从 {{domxref("MediaDevices.enumerateDevices()")}} 返回的 {{domxref("MediaDeviceInfo.deviceId")}} 值之一、`id-multimedia` 或 `id-communications`。如果正在使用用户代理的默认设备,它会返回一个空字符串。

## 值

一个字符串,表示当前的音频输出设备,或者如果正在使用用户代理的默认输出设备时,则为空字符串。

## 安全要求

对此属性的访问受以下约束:

- 必须在[安全上下文](/zh-CN/docs/Web/Security/Secure_Contexts)中调用该属性。

## 规范

{{Specifications}}

## 浏览器兼容性

{{Compat}}

## 参见

- [音频输出设备 API](/zh-CN/docs/Web/API/Audio_Output_Devices_API)
- {{domxref("MediaDevices.selectAudioOutput()")}}
- {{domxref("HTMLMediaElement.setSinkId()")}}