mirror of https://github.com/OpenVidu/openvidu.git
openvidu-browser: Fixed sendVideoData bug when peerConnection is closed
parent
811409d250
commit
cc02fa4f7a
|
@ -1170,7 +1170,9 @@ export class Session extends EventDispatcher {
|
||||||
platform.isSamsungBrowser() || platform.isIonicAndroid() || (platform.isIPhoneOrIPad() && platform.isIOSWithSafari())
|
platform.isSamsungBrowser() || platform.isIonicAndroid() || (platform.isIPhoneOrIPad() && platform.isIOSWithSafari())
|
||||||
) {
|
) {
|
||||||
const obtainAndSendVideo = async () => {
|
const obtainAndSendVideo = async () => {
|
||||||
const statsMap = await streamManager.stream.getRTCPeerConnection().getStats();
|
const pc = streamManager.stream.getRTCPeerConnection();
|
||||||
|
if (pc.connectionState === 'connected') {
|
||||||
|
const statsMap = await pc.getStats();
|
||||||
const arr: any[] = [];
|
const arr: any[] = [];
|
||||||
statsMap.forEach(stats => {
|
statsMap.forEach(stats => {
|
||||||
if (("frameWidth" in stats) && ("frameHeight" in stats) && (arr.length === 0)) {
|
if (("frameWidth" in stats) && ("frameHeight" in stats) && (arr.length === 0)) {
|
||||||
|
@ -1190,6 +1192,7 @@ export class Session extends EventDispatcher {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (doInterval) {
|
if (doInterval) {
|
||||||
let loops = 1;
|
let loops = 1;
|
||||||
this.videoDataInterval = setInterval(() => {
|
this.videoDataInterval = setInterval(() => {
|
||||||
|
|
Loading…
Reference in New Issue