openvidu-browser BUG FIX: no videoDimensions change interval when only audio

pull/88/merge
pabloFuente 2018-07-04 12:25:56 +02:00
parent 5844ddcd5f
commit ae52864e42
1 changed files with 63 additions and 59 deletions

View File

@ -300,7 +300,8 @@ export class Publisher extends StreamManager {
}
delete this.firstVideoElement;
if (!this.stream.isSendScreen() && !!mediaStream.getVideoTracks()[0]) {
if (this.stream.isSendVideo()) {
if (!this.stream.isSendScreen()) {
// With no screen share, video dimension can be set directly from MediaStream (getSettings)
// Orientation must be checked for mobile devices (width and height are reversed)
const { width, height } = mediaStream.getVideoTracks()[0].getSettings();
@ -317,7 +318,6 @@ export class Publisher extends StreamManager {
height: height || 0
};
}
this.stream.isLocalStreamReadyToPublish = true;
this.stream.ee.emitEvent('stream-ready-to-publish', []);
} else {
@ -363,6 +363,10 @@ export class Publisher extends StreamManager {
this.stream.ee.emitEvent('stream-ready-to-publish', []);
};
}
} else {
this.stream.isLocalStreamReadyToPublish = true;
this.stream.ee.emitEvent('stream-ready-to-publish', []);
}
resolve();
};