2017-03-05 10 views
0

私は別のユーザーに電話していますが、すべてうまくいきますが、マイクで話しているときに音が聞こえません。 私はオーディオコールに興味があります。Quickblox Webrtcオーディオコール - 音が聞こえない

ボタンを押して他のユーザーが自動的に応答すると、通話が開始されます。 - Google Chromeの発信者に

(function (window, QB) { 
 
    var CREDENTIALS = { 
 
     appId: , 
 
     authKey: '', 
 
     authSecret: '' 
 
    }; 
 

 
    QB.init(CREDENTIALS.appId, CREDENTIALS.authKey, CREDENTIALS.authSecret); 
 

 
    QB.createSession(function (err, result) { 
 
     // callback function 
 
     console.log("QB Session Created"); 
 

 
     var mediaParams = { 
 
      audio: true 
 
     }; 
 

 
     $("#connect").click(function() { 
 
      var id = $('#usr').val(); 
 
      console.log("start connect"); 
 
      QB.chat.connect({ userId: id, password: "testtest" }, function (err, roster) { 
 
       if (err) { 
 
        console.log(err); 
 
       } else { 
 
        console.log("USER CONNECTED"); 
 

 
        $("#call").click(function() { 
 
         console.log("start call"); 
 
         var calleesIds = [24853124]; //24853088 
 
         var sessionType = QB.webrtc.CallType.AUDIO; 
 

 
         var session = QB.webrtc.createNewSession(calleesIds, sessionType); 
 

 
         session.getUserMedia(mediaParams, function (err, stream) { 
 
          if (err) { 
 
           console.log(err); 
 
          } else { 
 
           console.log("Success get user media"); 
 

 
           var extension = {}; 
 
           session.call(extension, function (error) { 
 
            if (error) { 
 
             console.log(error); 
 
            } 
 
            else 
 
             console.log("Start Call"); 
 
           }); 
 
          } 
 
         }); 
 
        }); 
 

 
       } 
 
      }); 
 
     }); 
 

 
     QB.webrtc.onUserNotAnswerListener = function (session, userId) { 
 
      console.log("User didn't answer: " + userId); 
 
     }; 
 

 
     QB.webrtc.onCallListener = function (session, extension) { 
 
      console.log("Incoming Call"); 
 
      console.log('Session: ', session); 
 
      console.log('Extension: ', extension); 
 
      var ss = session; 
 
      
 
      ss.getUserMedia(mediaParams, function (err, stream) { 
 
       if (err) { 
 
        console.log(err); 
 
       } else { 
 
        console.log("Success get user media"); 
 
        var extension = {}; 
 
        ss.accept(extension); 
 
        ss.unmute('audio'); 
 
       } 
 
      }); 
 
     }; 
 

 
     QB.webrtc.onAcceptCallListener = function (session, userId, extension) { 
 
      console.log("user accepted call: " + userId); 
 
      session.unmute('audio'); 
 
     }; 
 

 
    }); 
 
}(window, window.QB));

ログイン:ここに私のjavascriptのコードです呼び出し先の

QB Session Created 
 
app2.js:30 start connect 
 
app2.js:36 USER CONNECTED 
 
app2.js:39 start call 
 
app2.js:49 Success get user media 
 
quickblox.min.js:40 [QBWebRTC]: Call, extension: {} 
 
quickblox.min.js:40 [QBWebRTC]: _createPeer, iceServers: {"iceServers":[{"url":"stun:stun.l.google.com:19302","urls":"stun:stun.l.google.com:19302"},{"url":"stun:turn.quickblox.com","username":"quickblox","credential":"baccb97ba2d92d71e26eb9886da5f1e0","urls":"stun:turn.quickblox.com"},{"url":"turn:turn.quickblox.com:3478?transport=udp","username":"quickblox","credential":"baccb97ba2d92d71e26eb9886da5f1e0","urls":"turn:turn.quickblox.com:3478?transport=udp"},{"url":"turn:turn.quickblox.com:3478?transport=tcp","username":"quickblox","credential":"baccb97ba2d92d71e26eb9886da5f1e0","urls":"turn:turn.quickblox.com:3478?transport=tcp"},{"url":"turn:turnsingapor.quickblox.com:3478?transport=udp","username":"quickblox","credential":"baccb97ba2d92d71e26eb9886da5f1e0","urls":"turn:turnsingapor.quickblox.com:3478?transport=udp"},{"url":"turn:turnsingapore.quickblox.com:3478?transport=tcp","username":"quickblox","credential":"baccb97ba2d92d71e26eb9886da5f1e0","urls":"turn:turnsingapore.quickblox.com:3478?transport=tcp"},{"url":"turn:turnireland.quickblox.com:3478?transport=udp","username":"quickblox","credential":"baccb97ba2d92d71e26eb9886da5f1e0","urls":"turn:turnireland.quickblox.com:3478?transport=udp"},{"url":"turn:turnireland.quickblox.com:3478?transport=tcp","username":"quickblox","credential":"baccb97ba2d92d71e26eb9886da5f1e0","urls":"turn:turnireland.quickblox.com:3478?transport=tcp"}]} 
 
quickblox.min.js:40 [QBWebRTC]: RTCPeerConnection init. userID: 24853124, sessionID: 57f5dcc4-70d6-4c93-90c5-7793e580bfa7, type: offer 
 
app2.js:57 Start Call 
 
quickblox.min.js:40 [QBWebRTC]: getAndSetLocalSessionDescription success 
 
quickblox.min.js:40 [QBWebRTC]: _startDialingTimer, dialingTimeInterval: 5000 
 
quickblox.min.js:40 [QBWebRTC]: _dialingCallback, answerTimeInterval: 0 
 
quickblox.min.js:40 [QBWebRTC]: onAccept. UserID:24853124. SessionID: 57f5dcc4-70d6-4c93-90c5-7793e580bfa7 
 
app2.js:91 user accepted call: 24853124 
 
quickblox.min.js:40 [QBWebRTC]: _clearDialingTimer 
 
2quickblox.min.js:40 [QBWebRTC]: onIceCandidates. UserID:24853124. SessionID: 57f5dcc4-70d6-4c93-90c5-7793e580bfa7. ICE candidates count: 1 
 
quickblox.min.js:40 [QBWebRTC]: 'setRemoteSessionDescription' success 
 
quickblox.min.js:40 [QBWebRTC]: onIceConnectionStateCallback: checking 
 
quickblox.min.js:40 [QBWebRTC]: onIceConnectionStateCallback: connected 
 
quickblox.min.js:40 [QBWebRTC]: onIceConnectionStateCallback: completed

ログイン - Googleのカナリア

QB Session Created 
 
app2.js:30 start connect 
 
app2.js:36 USER CONNECTED 
 
quickblox.min.js:40 [QBWebRTC]: onCall. UserID:24853197. SessionID: 57f5dcc4-70d6-4c93-90c5-7793e580bfa7 
 
app2.js:72 Apel primit 
 
app2.js:73 Session: 
 
i {ID: "57f5dcc4-70d6-4c93-90c5-7793e580bfa7", state: 1, initiatorID: 24853197, opponentsIDs: Array(1), callType: 2…} 
 
app2.js:74 Extension: 
 
Object {} 
 
quickblox.min.js:40 [QBWebRTC]: _createPeer, iceServers: {"iceServers":[{"url":"stun:stun.l.google.com:19302","urls":"stun:stun.l.google.com:19302"},{"url":"stun:turn.quickblox.com","username":"quickblox","credential":"baccb97ba2d92d71e26eb9886da5f1e0","urls":"stun:turn.quickblox.com"},{"url":"turn:turn.quickblox.com:3478?transport=udp","username":"quickblox","credential":"baccb97ba2d92d71e26eb9886da5f1e0","urls":"turn:turn.quickblox.com:3478?transport=udp"},{"url":"turn:turn.quickblox.com:3478?transport=tcp","username":"quickblox","credential":"baccb97ba2d92d71e26eb9886da5f1e0","urls":"turn:turn.quickblox.com:3478?transport=tcp"},{"url":"turn:turnsingapor.quickblox.com:3478?transport=udp","username":"quickblox","credential":"baccb97ba2d92d71e26eb9886da5f1e0","urls":"turn:turnsingapor.quickblox.com:3478?transport=udp"},{"url":"turn:turnsingapore.quickblox.com:3478?transport=tcp","username":"quickblox","credential":"baccb97ba2d92d71e26eb9886da5f1e0","urls":"turn:turnsingapore.quickblox.com:3478?transport=tcp"},{"url":"turn:turnireland.quickblox.com:3478?transport=udp","username":"quickblox","credential":"baccb97ba2d92d71e26eb9886da5f1e0","urls":"turn:turnireland.quickblox.com:3478?transport=udp"},{"url":"turn:turnireland.quickblox.com:3478?transport=tcp","username":"quickblox","credential":"baccb97ba2d92d71e26eb9886da5f1e0","urls":"turn:turnireland.quickblox.com:3478?transport=tcp"}]} 
 
quickblox.min.js:40 [QBWebRTC]: RTCPeerConnection init. userID: 24853197, sessionID: 57f5dcc4-70d6-4c93-90c5-7793e580bfa7, type: answer 
 
quickblox.min.js:40 [QBWebRTC]: _startAnswerTimer 
 
app2.js:82 Success get user media 
 
quickblox.min.js:40 [QBWebRTC]: Accept, extension: {} 
 
quickblox.min.js:40 [QBWebRTC]: _clearAnswerTimer 
 
quickblox.min.js:40 [QBWebRTC]: 'setRemoteSessionDescription' success 
 
quickblox.min.js:40 [QBWebRTC]: onIceConnectionStateCallback: checking 
 
quickblox.min.js:40 [QBWebRTC]: onIceConnectionStateCallback: connected 
 
quickblox.min.js:40 [QBWebRTC]: onIceCandidates. UserID:24853197. SessionID: 57f5dcc4-70d6-4c93-90c5-7793e580bfa7. ICE candidates count: 16

私が何か間違ったことをやっていますか?

答えて

1

オーディオ要素にリモートオーディオストリームを追加する必要があります。

関連する問題