Commit 692febca by xiongziliang

Merge branch 'master' of github.com:ZLMediaKit/ZLMediaKit

parents 6e445614 c22644af
......@@ -7,11 +7,12 @@ var ZLMRTCClient = (function (exports) {
WEBRTC_OFFER_ANWSER_EXCHANGE_FAILED: 'WEBRTC_OFFER_ANWSER_EXCHANGE_FAILED',
WEBRTC_ON_REMOTE_STREAMS: 'WEBRTC_ON_REMOTE_STREAMS',
WEBRTC_ON_LOCAL_STREAM: 'WEBRTC_ON_LOCAL_STREAM',
WEBRTC_ON_CONNECTION_STATE_CHANGE: 'WEBRTC_ON_CONNECTION_STATE_CHANGE',
CAPTURE_STREAM_FAILED: 'CAPTURE_STREAM_FAILED'
};
const VERSION = '1.0.1';
const BUILD_DATE = 'Fri Sep 17 2021 10:41:58 GMT+0800 (China Standard Time)';
const BUILD_DATE = 'Sat Jan 08 2022 15:24:38 GMT+0800 (China Standard Time)';
// Copyright (C) <2018> Intel Corporation
//
......@@ -7304,7 +7305,8 @@ var ZLMRTCClient = (function (exports) {
this.e = {
onicecandidate: this._onIceCandidate.bind(this),
ontrack: this._onTrack.bind(this),
onicecandidateerror: this._onIceCandidateError.bind(this)
onicecandidateerror: this._onIceCandidateError.bind(this),
onconnectionstatechange: this._onconnectionstatechange.bind(this)
};
this._remoteStream = null;
this._localStream = null;
......@@ -7312,6 +7314,7 @@ var ZLMRTCClient = (function (exports) {
this.pc.onicecandidate = this.e.onicecandidate;
this.pc.onicecandidateerror = this.e.onicecandidateerror;
this.pc.ontrack = this.e.ontrack;
this.pc.onconnectionstatechange = this.e.onconnectionstatechange;
if (!this.options.recvOnly && (this.options.audioEnable || this.options.videoEnable)) this.start();else this.receive();
}
......@@ -7507,6 +7510,10 @@ var ZLMRTCClient = (function (exports) {
this.dispatch(Events$1.WEBRTC_ICE_CANDIDATE_ERROR, event);
}
_onconnectionstatechange(event) {
this.dispatch(Events$1.WEBRTC_ON_CONNECTION_STATE_CHANGE, this.pc.connectionState);
}
close() {
if (this.pc) {
this.pc.close();
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -7,11 +7,12 @@ var ZLMRTCClient = (function (exports) {
WEBRTC_OFFER_ANWSER_EXCHANGE_FAILED: 'WEBRTC_OFFER_ANWSER_EXCHANGE_FAILED',
WEBRTC_ON_REMOTE_STREAMS: 'WEBRTC_ON_REMOTE_STREAMS',
WEBRTC_ON_LOCAL_STREAM: 'WEBRTC_ON_LOCAL_STREAM',
WEBRTC_ON_CONNECTION_STATE_CHANGE: 'WEBRTC_ON_CONNECTION_STATE_CHANGE',
CAPTURE_STREAM_FAILED: 'CAPTURE_STREAM_FAILED'
};
const VERSION = '1.0.1';
const BUILD_DATE = 'Fri Sep 17 2021 10:41:58 GMT+0800 (China Standard Time)';
const BUILD_DATE = 'Sat Jan 08 2022 15:24:38 GMT+0800 (China Standard Time)';
// Copyright (C) <2018> Intel Corporation
//
......@@ -7304,7 +7305,8 @@ var ZLMRTCClient = (function (exports) {
this.e = {
onicecandidate: this._onIceCandidate.bind(this),
ontrack: this._onTrack.bind(this),
onicecandidateerror: this._onIceCandidateError.bind(this)
onicecandidateerror: this._onIceCandidateError.bind(this),
onconnectionstatechange: this._onconnectionstatechange.bind(this)
};
this._remoteStream = null;
this._localStream = null;
......@@ -7312,6 +7314,7 @@ var ZLMRTCClient = (function (exports) {
this.pc.onicecandidate = this.e.onicecandidate;
this.pc.onicecandidateerror = this.e.onicecandidateerror;
this.pc.ontrack = this.e.ontrack;
this.pc.onconnectionstatechange = this.e.onconnectionstatechange;
if (!this.options.recvOnly && (this.options.audioEnable || this.options.videoEnable)) this.start();else this.receive();
}
......@@ -7507,6 +7510,10 @@ var ZLMRTCClient = (function (exports) {
this.dispatch(Events$1.WEBRTC_ICE_CANDIDATE_ERROR, event);
}
_onconnectionstatechange(event) {
this.dispatch(Events$1.WEBRTC_ON_CONNECTION_STATE_CHANGE, this.pc.connectionState);
}
close() {
if (this.pc) {
this.pc.close();
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -159,6 +159,11 @@
console.log('获取本地流失败')
});
player.on(ZLMRTCClient.Events.WEBRTC_ON_CONNECTION_STATE_CHANGE,function(state)
{// RTC 状态变化 ,详情参考 https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/connectionState
console.log('当前状态==>',state)
});
}
function start()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论