[whatwg] Media sink device selection on <audio>/<video>

Ami Fischman fischman at chromium.org
Tue Dec 17 15:40:15 PST 2013

Recently <https://www.w3.org/Bugs/Public/show_bug.cgi?id=23263> Navigator
acquired the ability to enumerate media output devices (in addition to
input devices):
It would be nice to allow media elements to direct their output to such an
output device.

The primary use-case is to allow app UI/script to select which audio output
device should play the audio track of a <video> or <audio> tag (wired
speakers, bluetooth headset, etc.).

A simple impl (mentioned only in case the above is too vague and would
benefit from concreteness; I have no attachment to this particular version)
would look like: extend html media elements with new
{audio,video}OutputDeviceId attributes which:
- when read provides the last-set value, or if never set, the UA's idea of
a default device (probably influenced by the OS's idea of a default device)
- when set directs the relevant type of output (audio/video) from the
element to the device in question
(specified as deviceId)

(note that the Media Capture spec only specifies an audioOut "kind", not a
videoOut "kind", so it probably makes sense to only offer an
audioOutputDeviceId attribute for now, but naming it "outputDeviceId"
(omitting "audio") might be a regrettable move in the future if/when Media
Capture adds "videoOut" to the kind enum).


More information about the whatwg mailing list