gpt4 book ai didi

agora.io - WebRTC 与 Agora.io : SwitchCamera?

转载 作者:行者123 更新时间:2023-12-04 06:29:42 25 4
gpt4 key购买 nike

我正在使用 Agora.io 构建网络应用程序。我希望能够在客户的智能手机上从前置摄像头切换到后置摄像头。我看过 switchCamera 的 agora 文档。我尝试了以下方法:

switchCamera();
myAgoraClient.switchCamera();
localStream.switchCamera();

它们都抛出一个no such function错误。

在 agora.io for web 中切换相机的正确方法是什么?

最佳答案

您可以使用 switchDevice 来做到这一点 2.5 SDK 中的方法

switchDevice(type: string, deviceId: string, onSuccess: function, onFailure: function): void

例如;

localStream.switchDevice("video", "<deviceid>", console.log,console.log)

应该做的工作。我在尝试同样的事情,但示例包含旧的 2.4 js sdk,您需要专门下载 ^2.5

关于agora.io - WebRTC 与 Agora.io : SwitchCamera?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52572229/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com