HTMLMediaElement: sinkId property
MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونهکد
{{APIRef("Audio Output Devices API")}}{{securecontext_header}}
The **sinkId** read-only property of the {{domxref("HTMLMediaElement")}} interface returns a string that is the unique ID of the device to be used for playing audio output.
This ID should be one of the {{domxref("MediaDeviceInfo.deviceId")}} values returned from {{domxref("MediaDevices.enumerateDevices()")}}. If the user agent default device is being used, it returns an empty string.
Value
A string indicating the current audio output device, or the empty string if the default user agent output device is being used.
Security requirements
Access to the property is subject to the following constraints:
- The property must be called in a secure context.
Specifications
{{Specifications}}
Browser compatibility
{{Compat}}
See also
- Audio Output Devices API
- {{domxref("MediaDevices.selectAudioOutput()")}}
- {{domxref("HTMLMediaElement.setSinkId()")}}