WebRTC 流和设备 [英] WebRTC stream and device

查看:37
本文介绍了WebRTC 流和设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于 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.labeltrack.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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆