Fixes a problem with receiving presence for start muted video before creating the stream element, which will end up that the muted video element will hide the avatar.

This commit is contained in:
damencho 2015-12-11 14:18:16 -06:00
parent 067de62a6d
commit 303287f7a6
3 changed files with 14 additions and 0 deletions

View File

@ -54,4 +54,8 @@ MediaStream.prototype.setMute = function (value) {
this.muted = value;
};
MediaStream.prototype.getMute = function () {
return this.muted;
};
module.exports = MediaStream;

View File

@ -112,6 +112,13 @@ SmallVideo.createStreamElement = function (stream) {
: document.createElement('audio');
if (isVideo) {
element.setAttribute("muted", "true");
// the presence for muted (start muted) can be received before creating
// the element, so we need to check here and if that is the case
// hide the element
if (stream.getMute()) {
$(element).hide();
}
}
if (!RTCBrowserType.isIExplorer()) {

View File

@ -579,6 +579,9 @@ var VideoLayout = (function (my) {
remoteVideo.showVideoIndicator(value);
var el = remoteVideo.selectVideoElement();
// the presence and trigger of onVideoMute can be earlier than
// creating the stream element. So show and hide can be ignored
// we need to take care for them also on creating the stream elem
if (!value)
el.show();
else