WebRTC 流和设备 [英] WebRTC stream and device
问题描述
对于 WebRTC 流,我怎样才能获得传输它的设备?每个流都有 getAudio/VideoTracks(),每个轨道都有 getCapabilities().deviceId,但 getCapabilities() 似乎没有实现.
For a WebRTC stream, how can I get the devices that streams it? For each stream there's getAudio/VideoTracks() and for each track there's getCapabilities().deviceId, but getCapabilities() doesn't seem to be implemented.
我在 Firefox 和 Chrome 中进行了测试.
I tested in Firefox and Chrome.
推荐答案
你说得对,getCapabilities
尚未实现.
You are right, getCapabilities
has not been implemented yet.
同时使用 track.label
和 track.kind
并将其与从 enumerateDevices
获得的设备标签和种类进行比较.适用于 Chrome 和 Firefox 46(Firefox 开发者版).
In the meantime use track.label
and track.kind
and compare it against the device label and kind you get from enumerateDevices
. Works in Chrome and Firefox 46 (Firefox Developer Edition).
这篇关于WebRTC 流和设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!