|
|
@@ -1,5 +1,21 @@
|
|
1
|
|
-/* global $ */
|
|
|
1
|
+/* global $, APP */
|
|
2
|
2
|
/* jshint -W101 */
|
|
|
3
|
+import UIEvents from "../../../service/UI/UIEvents";
|
|
|
4
|
+
|
|
|
5
|
+/**
|
|
|
6
|
+ * Store the current ring overlay instance.
|
|
|
7
|
+ * Note: We want to have only 1 instance at a time.
|
|
|
8
|
+ */
|
|
|
9
|
+let overlay = null;
|
|
|
10
|
+
|
|
|
11
|
+/**
|
|
|
12
|
+ * Handler for UIEvents.LARGE_VIDEO_AVATAR_DISPLAYED event.
|
|
|
13
|
+ * @param {boolean} shown indicates whether the avatar on the large video is
|
|
|
14
|
+ * currently displayed or not.
|
|
|
15
|
+ */
|
|
|
16
|
+function onAvatarDisplayed(shown) {
|
|
|
17
|
+ overlay._changeBackground(shown);
|
|
|
18
|
+}
|
|
3
|
19
|
|
|
4
|
20
|
/**
|
|
5
|
21
|
* Shows ring overlay
|
|
|
@@ -19,6 +35,21 @@ class RingOverlay {
|
|
19
|
35
|
this._setAudioTimeout();
|
|
20
|
36
|
}
|
|
21
|
37
|
|
|
|
38
|
+ /**
|
|
|
39
|
+ * Chagnes the background of the ring overlay.
|
|
|
40
|
+ * @param {boolean} solid - if true the new background will be the solid
|
|
|
41
|
+ * one, otherwise the background will be default one.
|
|
|
42
|
+ * NOTE: The method just toggles solidBG css class.
|
|
|
43
|
+ */
|
|
|
44
|
+ _changeBackground(solid) {
|
|
|
45
|
+ const container = $("#" + this._containerId);
|
|
|
46
|
+ if(solid) {
|
|
|
47
|
+ container.addClass("solidBG");
|
|
|
48
|
+ } else {
|
|
|
49
|
+ container.removeClass("solidBG");
|
|
|
50
|
+ }
|
|
|
51
|
+ }
|
|
|
52
|
+
|
|
22
|
53
|
/**
|
|
23
|
54
|
* Builds and appends the ring overlay to the html document
|
|
24
|
55
|
*/
|
|
|
@@ -74,12 +105,6 @@ class RingOverlay {
|
|
74
|
105
|
}
|
|
75
|
106
|
}
|
|
76
|
107
|
|
|
77
|
|
-/**
|
|
78
|
|
- * Store the current ring overlay instance.
|
|
79
|
|
- * Note: We want to have only 1 instance at a time.
|
|
80
|
|
- */
|
|
81
|
|
-let overlay = null;
|
|
82
|
|
-
|
|
83
|
108
|
export default {
|
|
84
|
109
|
/**
|
|
85
|
110
|
* Shows the ring overlay for the passed callee.
|
|
|
@@ -92,6 +117,8 @@ export default {
|
|
92
|
117
|
}
|
|
93
|
118
|
|
|
94
|
119
|
overlay = new RingOverlay(callee);
|
|
|
120
|
+ APP.UI.addListener(UIEvents.LARGE_VIDEO_AVATAR_DISPLAYED,
|
|
|
121
|
+ onAvatarDisplayed);
|
|
95
|
122
|
},
|
|
96
|
123
|
|
|
97
|
124
|
/**
|
|
|
@@ -104,6 +131,8 @@ export default {
|
|
104
|
131
|
}
|
|
105
|
132
|
overlay.destroy();
|
|
106
|
133
|
overlay = null;
|
|
|
134
|
+ APP.UI.removeListener(UIEvents.LARGE_VIDEO_AVATAR_DISPLAYED,
|
|
|
135
|
+ onAvatarDisplayed);
|
|
107
|
136
|
return true;
|
|
108
|
137
|
},
|
|
109
|
138
|
|