gpt4 book ai didi

javascript - id为 X 的 QBWebRTC 目前正忙? QB.webrtc.onRemoteStreamListener 未触发。 Quickblox Javascript SDK + Angular + WebRTC

转载 作者:行者123 更新时间:2023-11-28 04:52:01 24 4
gpt4 key购买 nike

我按照文档操作了三遍以上,但无法接听电话。这是代码:

$scope.occupants = [6184, 6186];
$scope.session = QB.webrtc.createNewSession($scope.occupants, QB.webrtc.CallType.VIDEO);
$scope.localMediaParams = {
audio: true,
video: true,
options: {
muted: true,
mirror: true
},
elemId: 'localVideoEl',
optional: {
minWidth: 240,
maxWidth: 320,
minHeight: 160,
maxHeight: 240
}
};

$scope.startCall = function() {
if (angular.equals($scope.recipients, {})) {
alert('Please choose a person to call');
}else {
if (angular.equals($scope.session, {})) {
console.log('session hasn\'t been started');
$scope.session.stop({});
$scope.session = {};
return false;
}else {
$scope.session.getUserMedia($scope.localMediaParams, function(err, stream) {
if (err){
console.log(err);
}else{
console.log(stream);
$scope.session.call({}, function(error) {
console.log(error);
});
}
});
}
}
};
$scope.answerCall = function() {
$scope.session.getUserMedia($scope.localMediaParams, function(err, stream) {
if (err){
console.log(err);
$scope.session.stop({});
}else{
console.log(stream);
$scope.session.accept({});
}
});
};
QB.webrtc.onRemoteStreamListener = function(session, userID, remoteStream) {
// attach the remote stream to DOM element
console.log('onRemoteStreamListener');
console.log($scope.session);
$scope.session.attachMediaStream('remoteVideoEl', remoteStream);
};

我有两个 ID 为 6184 和 6186 的用户。我正在从用户 6186 发起调用,控制台显示以下内容:

[QBWebRTC]: RTCPeerConnection init. userID: 6186, sessionID: 7e7ea17c-a207-4af0-82e1-744fbcce830e, type: offer
telemed.js:432 null
quickblox.min.js:86149 [QBWebRTC]: getAndSetLocalSessionDescription success
quickblox.min.js:86149 [QBWebRTC]: _startDialingTimer, dialingTimeInterval: 5000
quickblox.min.js:86149 [QBWebRTC]: _dialingCallback, answerTimeInterval: 0
quickblox.min.js:86149 [QBWebRTC]: getAndSetLocalSessionDescription success
quickblox.min.js:86149 [QBWebRTC]: _startDialingTimer, dialingTimeInterval: 5000
quickblox.min.js:86149 [QBWebRTC]: _dialingCallback, answerTimeInterval: 0
quickblox.min.js:86149 [QBWebRTC]: onCall. UserID:6186. SessionID: 7e7ea17c-a207-4af0-82e1-744fbcce830e
quickblox.min.js:86149 [QBWebRTC]: onReject. UserID:6184. SessionID: 7e7ea17c-a207-4af0-82e1-744fbcce830e
quickblox.min.js:86149 [QBWebRTC]: _clearDialingTimer
quickblox.min.js:86149 [QBWebRTC]: All peer connections closed: false
quickblox.min.js:86149 [QBWebRTC]: onIceConnectionStateCallback: closed
quickblox.min.js:86149 [QBWebRTC]: _dialingCallback, answerTimeInterval: 5000
quickblox.min.js:86149 [QBWebRTC]: onCall. UserID:6186. SessionID: 7e7ea17c-a207-4af0-82e1-744fbcce830e
quickblox.min.js:86149 [QBWebRTC]: Stop, extension: {}
quickblox.min.js:86149 [QBWebRTC]: _close
quickblox.min.js:86149 [QBWebRTC]: _clearDialingTimer
quickblox.min.js:86149 [QBWebRTC]: onIceConnectionStateCallback: closed

现在,在接听端,我看到正在生成一个调用,但随后它说发起调用者正忙:

[QBWebRTC]: onCall. UserID:6186. SessionID: 7e7ea17c-a207-4af0-82e1-744fbcce830e
quickblox.min.js:86149 [QBWebRTC]: User with id 6186 is busy at the moment.
quickblox.min.js:86149 [QBWebRTC]: onStop. UserID:6186. SessionID: 7e7ea17c-a207-4af0-82e1-744fbcce830e

有人可以告诉我这里发生了什么以及为什么 QB.webrtc.onRemoteStreamListener 在应答端没有触发?

还有一件事:

在我点击“结束通话”后,我收到此错误,我也不明白,因为它的英语也很糟糕:

[QBWebRTC]: onStop. UserID:6186. SessionID: 7e7ea17c-a207-4af0-82e1-744fbcce830e
quickblox.min.js:86161 [QBWebRTC]: Ignore 'onStop', there is no information about session 7e7ea17c-a207-4af0-82e1-744fbcce830e by some reason.

最佳答案

I am initiating the call from User 6186 and the console

您不必在占用者中列出当前用户的 ID:

所以而不是

$scope.occupants = [6184, 6186];

你应该使用

$scope.occupants = [6184];

关于javascript - id为 X 的 QBWebRTC 目前正忙? QB.webrtc.onRemoteStreamListener 未触发。 Quickblox Javascript SDK + Angular + WebRTC,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42837251/

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