yaoyuanloo1 2018-11-17 02:24 采纳率: 100%
浏览 2939
已采纳

webrtc 原生的js怎么调用AEC 消除回音模块

//获取音视频.
function getUserMedia() {
try {
navigator.getUserMedia({
'audio' : true,
'video' : pVideo
}, onUserMediaSuccess, onUserMediaError);
} catch (e) {
try {
navigator.getUserMedia("video,audio", onUserMediaSuccess, onUserMediaError);
} catch (e) {
alert(e.message);
console.log(e);
}
}
}

    //加载本地 视频
    function onUserMediaSuccess(stream) {
        console.log("User has granted access to local media.");
        var url = URL.createObjectURL(stream);
        localVideo.style.opacity = 1;
        localVideo.src = url;
        localStream = stream;
        if (initiator)
            maybeStart();
    }

    //创建 PeerConnection
    function createPeerConnection() {

        try {
            pc = new RTCPeerConnection(pc_config);
            pc.onicecandidate = onIceCandidate;
        } catch (e) {
            try {
                var stun_server = "";
                if (pc_config.iceServers.length !== 0) {
                    stun_server = pc_config.iceServers[0].url.replace('stun:', 'STUN ');
                }
                pc = new RTCPeerConnection(stun_server, onIceCandidate);
                isRTCPeerConnection = false;
                console.log("Created webkitPeerConnnection00 with config \"" + stun_server + "\".");
            } catch (e) {
                alert("Failed to create PeerConnection, exception: " + e.message);
                return;
            }
        }
        pc.onconnecting = onSessionConnecting;
        pc.onopen = onSessionOpened;
        pc.onaddstream = onRemoteStreamAdded;
        pc.onremovestream = onRemoteStreamRemoved;
    }

  • 写回答

2条回答 默认 最新

  • yaoyuanloo1 2019-08-08 13:59
    关注

    在video标签里面加了个mute属性

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 有没有整苹果智能分拣线上图像数据
  • ¥20 有没有人会这个东西的
  • ¥15 cfx考虑调整“enforce system memory limit”参数的设置
  • ¥30 航迹分离,航迹增强,误差分析
  • ¥15 Chrome Manifest扩展引用Ajax-hook库拦截请求失败
  • ¥15 用Ros中的Topic通讯方式控制小乌龟的速度,走矩形;编写订阅器代码
  • ¥15 LLM accuracy检测
  • ¥15 pycharm添加远程解释器报错
  • ¥15 如何让子窗口鼠标滚动独立,不要传递消息给主窗口
  • ¥15 如何能达到用ping0.cc检测成这样?如图