Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

Allows UI.toggleFilmStrip() and UIEvents.TOGGLE_FILM_STRIP to act as setters in addition to toggles.

Lyubomir Marinovc35590dbda7d
diff --git a/modules/UI/UI.js b/modules/UI/UI.js
index e68113ff28..c6e0f9cc42 100644
--- a/modules/UI/UI.js
+++ b/modules/UI/UI.js
@@ -583,7 +583,8 @@ UI.toggleSmileys = function () {
* Toggles film strip.
*/
UI.toggleFilmStrip = function () {
- FilmStrip.toggleFilmStrip();
+ var self = FilmStrip;
+ self.toggleFilmStrip.apply(self, arguments);
};
/**
diff --git a/modules/UI/videolayout/FilmStrip.js b/modules/UI/videolayout/FilmStrip.js
index 2e0a8ce50c..ccb1783aa8 100644
--- a/modules/UI/videolayout/FilmStrip.js
+++ b/modules/UI/videolayout/FilmStrip.js
@@ -9,7 +9,20 @@ const FilmStrip = {
this.filmStrip = $('#remoteVideos');
},
- toggleFilmStrip () {
+ /**
+ * Toggles the visibility of the film strip.
+ *
+ * @param visible optional {Boolean} which specifies the desired visibility
+ * of the film strip. If not specified, the visibility will be flipped
+ * (i.e. toggled); otherwise, the visibility will be set to the specified
+ * value.
+ */
+ toggleFilmStrip (visible) {
+ if (typeof visible === 'boolean'
+ && this.isFilmStripVisible() == visible) {
+ return;
+ }
+
this.filmStrip.toggleClass("hidden");
},
diff --git a/service/UI/UIEvents.js b/service/UI/UIEvents.js
index b915b37930..5d15861934 100644
--- a/service/UI/UIEvents.js
+++ b/service/UI/UIEvents.js
@@ -34,6 +34,17 @@ export default {
TOGGLE_CHAT: "UI.toggle_chat",
TOGGLE_SETTINGS: "UI.toggle_settings",
TOGGLE_CONTACT_LIST: "UI.toggle_contact_list",
+ /**
+ * Notifies that a command to toggle the film strip has been issued. The
+ * event may optionally specify a {Boolean} (primitive) value to assign to
+ * the visibility of the film strip (i.e. the event may act as a setter).
+ * The very toggling of the film strip may or may not occurred at the time
+ * of the receipt of the event depending on the position of the receiving
+ * event listener in relation to the event listener which carries out the
+ * command to toggle the film strip.
+ *
+ * @see {TOGGLED_FILM_STRIP}
+ */
TOGGLE_FILM_STRIP: "UI.toggle_film_strip",
TOGGLE_SCREENSHARING: "UI.toggle_screensharing",
CONTACT_CLICKED: "UI.contact_clicked",