|
@@ -9,6 +9,9 @@ import { Provider } from 'react-redux';
|
9
|
9
|
import { i18next } from '../../../react/features/base/i18n';
|
10
|
10
|
import { AudioLevelIndicator }
|
11
|
11
|
from '../../../react/features/audio-level-indicator';
|
|
12
|
+import {
|
|
13
|
+ Avatar as AvatarDisplay
|
|
14
|
+} from '../../../react/features/base/participants';
|
12
|
15
|
import {
|
13
|
16
|
ConnectionIndicator
|
14
|
17
|
} from '../../../react/features/connection-indicator';
|
|
@@ -477,7 +480,7 @@ SmallVideo.prototype.selectVideoElement = function () {
|
477
|
480
|
* element which displays the user's avatar.
|
478
|
481
|
*/
|
479
|
482
|
SmallVideo.prototype.$avatar = function () {
|
480
|
|
- return $('#' + this.videoSpanId + ' .userAvatar');
|
|
483
|
+ return $('#' + this.videoSpanId + ' .avatar-container');
|
481
|
484
|
};
|
482
|
485
|
|
483
|
486
|
/**
|
|
@@ -652,21 +655,40 @@ SmallVideo.prototype.updateView = function () {
|
652
|
655
|
|| displayMode === DISPLAY_VIDEO_WITH_NAME));
|
653
|
656
|
};
|
654
|
657
|
|
|
658
|
+/**
|
|
659
|
+ * Updates the react component displaying the avatar with the passed in avatar
|
|
660
|
+ * url.
|
|
661
|
+ *
|
|
662
|
+ * @param {string} avatarUrl - The uri to the avatar image.
|
|
663
|
+ * @returns {void}
|
|
664
|
+ */
|
655
|
665
|
SmallVideo.prototype.avatarChanged = function (avatarUrl) {
|
656
|
|
- var thumbnail = $('#' + this.videoSpanId);
|
657
|
|
- var avatarSel = this.$avatar();
|
|
666
|
+ const thumbnail = this.$avatar().get(0);
|
658
|
667
|
this.hasAvatar = true;
|
659
|
668
|
|
660
|
|
- // set the avatar in the thumbnail
|
661
|
|
- if (avatarSel && avatarSel.length > 0) {
|
662
|
|
- avatarSel[0].src = avatarUrl;
|
663
|
|
- } else {
|
664
|
|
- if (thumbnail && thumbnail.length > 0) {
|
665
|
|
- var avatarElement = document.createElement('img');
|
666
|
|
- avatarElement.className = 'userAvatar';
|
667
|
|
- avatarElement.src = avatarUrl;
|
668
|
|
- thumbnail.append(avatarElement);
|
669
|
|
- }
|
|
669
|
+ if (thumbnail) {
|
|
670
|
+ /* jshint ignore:start */
|
|
671
|
+ ReactDOM.render(
|
|
672
|
+ <AvatarDisplay
|
|
673
|
+ className = 'userAvatar'
|
|
674
|
+ uri = { avatarUrl } />,
|
|
675
|
+ thumbnail
|
|
676
|
+ );
|
|
677
|
+ /* jshint ignore:end */
|
|
678
|
+ }
|
|
679
|
+};
|
|
680
|
+
|
|
681
|
+/**
|
|
682
|
+ * Unmounts any attached react components (particular the avatar image) from
|
|
683
|
+ * the avatar container.
|
|
684
|
+ *
|
|
685
|
+ * @returns {void}
|
|
686
|
+ */
|
|
687
|
+SmallVideo.prototype.removeAvatar = function () {
|
|
688
|
+ const thumbnail = this.$avatar().get(0);
|
|
689
|
+
|
|
690
|
+ if (thumbnail) {
|
|
691
|
+ ReactDOM.unmountComponentAtNode(thumbnail);
|
670
|
692
|
}
|
671
|
693
|
};
|
672
|
694
|
|