|
@@ -12,6 +12,46 @@ const FilmStrip = {
|
12
|
12
|
init (eventEmitter) {
|
13
|
13
|
this.filmStrip = $('#remoteVideos');
|
14
|
14
|
this.eventEmitter = eventEmitter;
|
|
15
|
+ this.filmStripIsVisible = true;
|
|
16
|
+ this.renderFilmstripToolbar();
|
|
17
|
+ this.activateHideButton();
|
|
18
|
+ },
|
|
19
|
+
|
|
20
|
+ /**
|
|
21
|
+ * Attach 'click' listener to "hide filmstrip" button
|
|
22
|
+ */
|
|
23
|
+ activateHideButton () {
|
|
24
|
+ $('#videospace').on('click', '#hideVideoToolbar', () => {
|
|
25
|
+ var icon = document.querySelector('#hideVideoToolbar i');
|
|
26
|
+
|
|
27
|
+ this.filmStripIsVisible = !this.filmStripIsVisible;
|
|
28
|
+ this.toggleFilmStrip(this.filmStripIsVisible);
|
|
29
|
+
|
|
30
|
+ icon.classList.remove(
|
|
31
|
+ this.filmStripIsVisible ? 'icon-menu-up' : 'icon-menu-down');
|
|
32
|
+ icon.classList.add(
|
|
33
|
+ this.filmStripIsVisible ? 'icon-menu-down' : 'icon-menu-up');
|
|
34
|
+ });
|
|
35
|
+ },
|
|
36
|
+
|
|
37
|
+ /**
|
|
38
|
+ * Shows toolbar on the right of the filmstrip
|
|
39
|
+ */
|
|
40
|
+ renderFilmstripToolbar () {
|
|
41
|
+ // create toolbar
|
|
42
|
+ var container = document.createElement('div');
|
|
43
|
+ container.className = 'filmstripToolbar';
|
|
44
|
+
|
|
45
|
+ container.innerHTML = `
|
|
46
|
+ <button id="hideVideoToolbar">
|
|
47
|
+ <i class="icon-menu-${this.filmStripIsVisible ? 'down' : 'up'}">
|
|
48
|
+ </i>
|
|
49
|
+ </button>
|
|
50
|
+ `;
|
|
51
|
+
|
|
52
|
+ // show toolbar
|
|
53
|
+ document.querySelector('#videospace')
|
|
54
|
+ .insertBefore(container, document.querySelector('#remoteVideos'));
|
15
|
55
|
},
|
16
|
56
|
|
17
|
57
|
/**
|