|
|
@@ -48,6 +48,8 @@ function LocalVideo(VideoLayout, emitter) {
|
|
48
|
48
|
|
|
49
|
49
|
this.addAudioLevelIndicator();
|
|
50
|
50
|
this.updateIndicators();
|
|
|
51
|
+
|
|
|
52
|
+ this.container.onclick = this._onContainerClick.bind(this);
|
|
51
|
53
|
}
|
|
52
|
54
|
|
|
53
|
55
|
LocalVideo.prototype = Object.create(SmallVideo.prototype);
|
|
|
@@ -95,42 +97,6 @@ LocalVideo.prototype.setDisplayName = function(displayName) {
|
|
95
|
97
|
LocalVideo.prototype.changeVideo = function(stream) {
|
|
96
|
98
|
this.videoStream = stream;
|
|
97
|
99
|
|
|
98
|
|
- const localVideoClick = event => {
|
|
99
|
|
- // TODO Checking the classes is a workround to allow events to bubble
|
|
100
|
|
- // into the DisplayName component if it was clicked. React's synthetic
|
|
101
|
|
- // events will fire after jQuery handlers execute, so stop propogation
|
|
102
|
|
- // at this point will prevent DisplayName from getting click events.
|
|
103
|
|
- // This workaround should be removeable once LocalVideo is a React
|
|
104
|
|
- // Component because then the components share the same eventing system.
|
|
105
|
|
- const $source = $(event.target || event.srcElement);
|
|
106
|
|
- const { classList } = event.target;
|
|
107
|
|
-
|
|
108
|
|
- const clickedOnDisplayName
|
|
109
|
|
- = $source.parents('.displayNameContainer').length > 0;
|
|
110
|
|
- const clickedOnPopover
|
|
111
|
|
- = $source.parents('.connection-info').length > 0;
|
|
112
|
|
- const clickedOnPopoverTrigger
|
|
113
|
|
- = $source.parents('.popover-trigger').length > 0
|
|
114
|
|
- || classList.contains('popover-trigger');
|
|
115
|
|
-
|
|
116
|
|
- const ignoreClick = clickedOnDisplayName
|
|
117
|
|
- || clickedOnPopoverTrigger
|
|
118
|
|
- || clickedOnPopover;
|
|
119
|
|
-
|
|
120
|
|
- // FIXME: with Temasys plugin event arg is not an event, but
|
|
121
|
|
- // the clicked object itself, so we have to skip this call
|
|
122
|
|
- if (event.stopPropagation && !ignoreClick) {
|
|
123
|
|
- event.stopPropagation();
|
|
124
|
|
- }
|
|
125
|
|
-
|
|
126
|
|
- if (!ignoreClick) {
|
|
127
|
|
- this.VideoLayout.handleVideoThumbClicked(this.id);
|
|
128
|
|
- }
|
|
129
|
|
- };
|
|
130
|
|
-
|
|
131
|
|
- this.$container.off('click');
|
|
132
|
|
- this.$container.on('click', localVideoClick);
|
|
133
|
|
-
|
|
134
|
100
|
this.localVideoId = `localVideo_${stream.getId()}`;
|
|
135
|
101
|
|
|
136
|
102
|
const localVideoContainer = document.getElementById('localVideoWrapper');
|
|
|
@@ -246,4 +212,41 @@ LocalVideo.prototype._enableDisableContextMenu = function(enable) {
|
|
246
|
212
|
}
|
|
247
|
213
|
};
|
|
248
|
214
|
|
|
|
215
|
+/**
|
|
|
216
|
+ * Callback invoked when the thumbnail is clicked. Will directly call
|
|
|
217
|
+ * VideoLayout to handle thumbnail click if certain elements have not been
|
|
|
218
|
+ * clicked.
|
|
|
219
|
+ *
|
|
|
220
|
+ * @param {MouseEvent} event - The click event to intercept.
|
|
|
221
|
+ * @private
|
|
|
222
|
+ * @returns {void}
|
|
|
223
|
+ */
|
|
|
224
|
+LocalVideo.prototype._onContainerClick = function(event) {
|
|
|
225
|
+ // TODO Checking the classes is a workround to allow events to bubble into
|
|
|
226
|
+ // the DisplayName component if it was clicked. React's synthetic events
|
|
|
227
|
+ // will fire after jQuery handlers execute, so stop propogation at this
|
|
|
228
|
+ // point will prevent DisplayName from getting click events. This workaround
|
|
|
229
|
+ // should be removeable once LocalVideo is a React Component because then
|
|
|
230
|
+ // the components share the same eventing system.
|
|
|
231
|
+ const $source = $(event.target || event.srcElement);
|
|
|
232
|
+ const { classList } = event.target;
|
|
|
233
|
+
|
|
|
234
|
+ const clickedOnDisplayName
|
|
|
235
|
+ = $source.parents('.displayNameContainer').length > 0;
|
|
|
236
|
+ const clickedOnPopover = $source.parents('.popover').length > 0
|
|
|
237
|
+ || classList.contains('popover');
|
|
|
238
|
+
|
|
|
239
|
+ const ignoreClick = clickedOnDisplayName || clickedOnPopover;
|
|
|
240
|
+
|
|
|
241
|
+ // FIXME: with Temasys plugin event arg is not an event, but the clicked
|
|
|
242
|
+ // object itself, so we have to skip this call
|
|
|
243
|
+ if (event.stopPropagation && !ignoreClick) {
|
|
|
244
|
+ event.stopPropagation();
|
|
|
245
|
+ }
|
|
|
246
|
+
|
|
|
247
|
+ if (!ignoreClick) {
|
|
|
248
|
+ this.VideoLayout.handleVideoThumbClicked(this.id);
|
|
|
249
|
+ }
|
|
|
250
|
+};
|
|
|
251
|
+
|
|
249
|
252
|
export default LocalVideo;
|