bugfix
This commit is contained in:
parent
e13d4ba4ee
commit
6ab4daddca
@ -259,9 +259,6 @@ bricks.RTCClient = class extends bricks.VBox {
|
|||||||
// 创建 PeerConnection
|
// 创建 PeerConnection
|
||||||
async createPeerConnection(to_info) {
|
async createPeerConnection(to_info) {
|
||||||
this.phone.set_state('using');
|
this.phone.set_state('using');
|
||||||
if (this.role == 'requester'){
|
|
||||||
await this.send_offer();
|
|
||||||
}
|
|
||||||
const configuration = {
|
const configuration = {
|
||||||
iceServers: [
|
iceServers: [
|
||||||
{ urls: this.ice_url },
|
{ urls: this.ice_url },
|
||||||
@ -276,6 +273,13 @@ bricks.RTCClient = class extends bricks.VBox {
|
|||||||
.forEach(track => {
|
.forEach(track => {
|
||||||
this.peerConnection.addTrack(track, this.localVideo.stream);
|
this.peerConnection.addTrack(track, this.localVideo.stream);
|
||||||
});
|
});
|
||||||
|
if (this.peerConnection){
|
||||||
|
console.log('peerConnection is null');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (this.role == 'requester'){
|
||||||
|
await this.send_offer();
|
||||||
|
}
|
||||||
|
|
||||||
// 处理 ICE 候选
|
// 处理 ICE 候选
|
||||||
this.peerConnection.onicecandidate = this.send_candidate.bind(this, to_info);
|
this.peerConnection.onicecandidate = this.send_candidate.bind(this, to_info);
|
||||||
|
Loading…
Reference in New Issue
Block a user