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:
parent
067de62a6d
commit
303287f7a6
|
@ -54,4 +54,8 @@ MediaStream.prototype.setMute = function (value) {
|
||||||
this.muted = value;
|
this.muted = value;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
MediaStream.prototype.getMute = function () {
|
||||||
|
return this.muted;
|
||||||
|
};
|
||||||
|
|
||||||
module.exports = MediaStream;
|
module.exports = MediaStream;
|
||||||
|
|
|
@ -112,6 +112,13 @@ SmallVideo.createStreamElement = function (stream) {
|
||||||
: document.createElement('audio');
|
: document.createElement('audio');
|
||||||
if (isVideo) {
|
if (isVideo) {
|
||||||
element.setAttribute("muted", "true");
|
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()) {
|
if (!RTCBrowserType.isIExplorer()) {
|
||||||
|
|
|
@ -579,6 +579,9 @@ var VideoLayout = (function (my) {
|
||||||
remoteVideo.showVideoIndicator(value);
|
remoteVideo.showVideoIndicator(value);
|
||||||
|
|
||||||
var el = remoteVideo.selectVideoElement();
|
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)
|
if (!value)
|
||||||
el.show();
|
el.show();
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue