Browse Source

feat(undock) expose buttons for docking / undocking iframe (#11560)

master
Avram Tudor 3 years ago
parent
commit
543f273792
No account linked to committer's email address

+ 2
- 0
config.js View File

618
     //    'chat',
618
     //    'chat',
619
     //    'closedcaptions',
619
     //    'closedcaptions',
620
     //    'desktop',
620
     //    'desktop',
621
+    //    'dock-iframe'
621
     //    'download',
622
     //    'download',
622
     //    'embedmeeting',
623
     //    'embedmeeting',
623
     //    'etherpad',
624
     //    'etherpad',
644
     //    'stats',
645
     //    'stats',
645
     //    'tileview',
646
     //    'tileview',
646
     //    'toggle-camera',
647
     //    'toggle-camera',
648
+    //    'undock-iframe',
647
     //    'videoquality',
649
     //    'videoquality',
648
     //    '__end'
650
     //    '__end'
649
     // ],
651
     // ],

+ 4
- 0
lang/main.json View File

1026
             "chat": "Open / Close chat",
1026
             "chat": "Open / Close chat",
1027
             "clap": "Clap",
1027
             "clap": "Clap",
1028
             "collapse": "Collapse",
1028
             "collapse": "Collapse",
1029
+            "dock": "Dock in main window",
1029
             "document": "Toggle shared document",
1030
             "document": "Toggle shared document",
1030
             "download": "Download our apps",
1031
             "download": "Download our apps",
1031
             "embedMeeting": "Embed meeting",
1032
             "embedMeeting": "Embed meeting",
1076
             "tileView": "Toggle tile view",
1077
             "tileView": "Toggle tile view",
1077
             "toggleCamera": "Toggle camera",
1078
             "toggleCamera": "Toggle camera",
1078
             "toggleFilmstrip": "Toggle filmstrip",
1079
             "toggleFilmstrip": "Toggle filmstrip",
1080
+            "undock": "Undock into separate window",
1079
             "videoblur": "Toggle video blur",
1081
             "videoblur": "Toggle video blur",
1080
             "videomute": "Start / Stop camera"
1082
             "videomute": "Start / Stop camera"
1081
         },
1083
         },
1092
         "closeChat": "Close chat",
1094
         "closeChat": "Close chat",
1093
         "closeReactionsMenu": "Close reactions menu",
1095
         "closeReactionsMenu": "Close reactions menu",
1094
         "disableReactionSounds": "You can disable reaction sounds for this meeting",
1096
         "disableReactionSounds": "You can disable reaction sounds for this meeting",
1097
+        "dock": "Dock in main window",
1095
         "documentClose": "Close shared document",
1098
         "documentClose": "Close shared document",
1096
         "documentOpen": "Open shared document",
1099
         "documentOpen": "Open shared document",
1097
         "download": "Download our apps",
1100
         "download": "Download our apps",
1160
         "talkWhileMutedPopup": "Trying to speak? You are muted.",
1163
         "talkWhileMutedPopup": "Trying to speak? You are muted.",
1161
         "tileViewToggle": "Toggle tile view",
1164
         "tileViewToggle": "Toggle tile view",
1162
         "toggleCamera": "Toggle camera",
1165
         "toggleCamera": "Toggle camera",
1166
+        "undock": "Undock into separate window",
1163
         "videoSettings": "Video settings",
1167
         "videoSettings": "Video settings",
1164
         "videomute": "Start / Stop camera"
1168
         "videomute": "Start / Stop camera"
1165
     },
1169
     },

+ 16
- 0
modules/API/API.js View File

1461
         });
1461
         });
1462
     }
1462
     }
1463
 
1463
 
1464
+    /**
1465
+     * Notify external application (if API is enabled) that the iframe
1466
+     * docked state has been changed. The responsibility for implementing
1467
+     * the dock / undock functionality lies with the external application.
1468
+     *
1469
+     * @param {boolean} docked - Whether or not the iframe has been set to
1470
+     * be docked or undocked.
1471
+     * @returns {void}
1472
+     */
1473
+    notifyIframeDockStateChanged(docked: boolean) {
1474
+        this._sendEvent({
1475
+            name: 'iframe-dock-state-changed',
1476
+            docked
1477
+        });
1478
+    }
1479
+
1464
     /**
1480
     /**
1465
      * Notify external application of a participant, remote or local, being
1481
      * Notify external application of a participant, remote or local, being
1466
      * removed from the conference by another participant.
1482
      * removed from the conference by another participant.

+ 1
- 0
modules/API/external/external_api.js View File

110
     'feedback-submitted': 'feedbackSubmitted',
110
     'feedback-submitted': 'feedbackSubmitted',
111
     'feedback-prompt-displayed': 'feedbackPromptDisplayed',
111
     'feedback-prompt-displayed': 'feedbackPromptDisplayed',
112
     'filmstrip-display-changed': 'filmstripDisplayChanged',
112
     'filmstrip-display-changed': 'filmstripDisplayChanged',
113
+    'iframe-dock-state-changed': 'iframeDockStateChanged',
113
     'incoming-message': 'incomingMessage',
114
     'incoming-message': 'incomingMessage',
114
     'knocking-participant': 'knockingParticipant',
115
     'knocking-participant': 'knockingParticipant',
115
     'log': 'log',
116
     'log': 'log',

+ 3
- 0
react/features/base/icons/svg/dock.svg View File

1
+<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+<path fill-rule="evenodd" clip-rule="evenodd" d="M18.3332 3.33329C18.3332 2.41282 17.587 1.66663 16.6665 1.66663H8.33317C7.4127 1.66663 6.6665 2.41282 6.6665 3.33329V4.99996H3.33317C2.4127 4.99996 1.6665 5.74615 1.6665 6.66663V16.6666C1.6665 17.5871 2.4127 18.3333 3.33317 18.3333H13.3332C14.2536 18.3333 14.9998 17.5871 14.9998 16.6666V15H16.6665C17.587 15 18.3332 14.2538 18.3332 13.3333V3.33329ZM8.33317 3.33329H16.6665L16.6665 13.3333H14.9998V6.66663C14.9998 5.74615 14.2536 4.99996 13.3332 4.99996H8.33317V3.33329ZM3.33317 6.66663V16.6666H13.3332V6.66663H3.33317ZM6.6665 12.1024V9.99996C6.6665 9.53972 6.29341 9.16663 5.83317 9.16663C5.37293 9.16663 4.99984 9.53972 4.99984 9.99996V14.1296V14.1666C4.99984 14.5693 5.28549 14.9053 5.66523 14.983C5.71947 14.9941 5.77564 15 5.83317 15L5.83356 14.9992C5.83397 14.9992 5.83439 14.9992 5.8348 14.9992L5.83445 15H5.87022H9.99984C10.4601 15 10.8332 14.6269 10.8332 14.1666C10.8332 13.7064 10.4601 13.3333 9.99984 13.3333H7.89741L11.4116 9.81913C11.7515 9.47922 11.7515 8.92813 11.4116 8.58822C11.0717 8.24832 10.5206 8.24832 10.1807 8.58822L6.6665 12.1024Z" fill="white"/>
3
+</svg>

+ 2
- 0
react/features/base/icons/svg/index.js View File

45
 export { default as IconDeviceEarpiece } from './phone-talk.svg';
45
 export { default as IconDeviceEarpiece } from './phone-talk.svg';
46
 export { default as IconDeviceHeadphone } from './headset.svg';
46
 export { default as IconDeviceHeadphone } from './headset.svg';
47
 export { default as IconDeviceSpeaker } from './volume.svg';
47
 export { default as IconDeviceSpeaker } from './volume.svg';
48
+export { default as IconDock } from './dock.svg';
48
 export { default as IconDeviceDocument } from './document.svg';
49
 export { default as IconDeviceDocument } from './document.svg';
49
 export { default as IconDominantSpeaker } from './dominant-speaker.svg';
50
 export { default as IconDominantSpeaker } from './dominant-speaker.svg';
50
 export { default as IconDownload } from './download.svg';
51
 export { default as IconDownload } from './download.svg';
131
 export { default as IconTileView } from './tiles-many.svg';
132
 export { default as IconTileView } from './tiles-many.svg';
132
 export { default as IconToggleRecording } from './camera-take-picture.svg';
133
 export { default as IconToggleRecording } from './camera-take-picture.svg';
133
 export { default as IconTrash } from './trash.svg';
134
 export { default as IconTrash } from './trash.svg';
135
+export { default as IconUndock } from './undock.svg';
134
 export { default as IconUnpin } from './unpin.svg';
136
 export { default as IconUnpin } from './unpin.svg';
135
 export { default as IconVideoOff } from './video-off.svg';
137
 export { default as IconVideoOff } from './video-off.svg';
136
 export { default as IconVideoQualityAudioOnly } from './AUD.svg';
138
 export { default as IconVideoQualityAudioOnly } from './AUD.svg';

+ 3
- 0
react/features/base/icons/svg/undock.svg View File

1
+<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+<path fill-rule="evenodd" clip-rule="evenodd" d="M16.6665 1.66663H6.6665C5.74603 1.66663 4.99984 2.41282 4.99984 3.33329V4.99996H3.33317C2.4127 4.99996 1.6665 5.74615 1.6665 6.66663V16.6666C1.6665 17.5871 2.4127 18.3333 3.33317 18.3333H13.3332C14.2536 18.3333 14.9998 17.5871 14.9998 16.6666V15H16.6665C17.587 15 18.3332 14.2538 18.3332 13.3333V3.33329C18.3332 2.41282 17.587 1.66663 16.6665 1.66663ZM13.3332 16.6666V15H6.6665C5.74603 15 4.99984 14.2538 4.99984 13.3333V6.66663H3.33317V16.6666H13.3332ZM6.6665 3.33329V13.3333H16.6665V3.33329H6.6665ZM9.99984 4.99996C9.5396 4.99996 9.1665 5.37306 9.1665 5.83329C9.1665 6.29353 9.5396 6.66663 9.99984 6.66663H12.1023L8.5881 10.1808C8.24819 10.5207 8.24819 11.0718 8.5881 11.4117C8.928 11.7516 9.4791 11.7516 9.819 11.4117L13.3332 7.89753V9.99996C13.3332 10.4602 13.7063 10.8333 14.1665 10.8333C14.6267 10.8333 14.9998 10.4602 14.9998 9.99996V5.83329C14.9998 5.37306 14.6267 4.99996 14.1665 4.99996H14.1295H9.99984Z" fill="white"/>
3
+</svg>

+ 29
- 0
react/features/toolbox/components/web/DockIframeButton.js View File

1
+// @flow
2
+
3
+import { translate } from '../../../base/i18n';
4
+import { IconDock } from '../../../base/icons';
5
+import { AbstractButton, type AbstractButtonProps } from '../../../base/toolbox/components';
6
+
7
+declare var APP: Object;
8
+
9
+/**
10
+ * Implementation of a button for notifying integrators that iframe should be docked.
11
+ */
12
+class DockIframeButton extends AbstractButton<AbstractButtonProps, *> {
13
+    accessibilityLabel = 'toolbar.accessibilityLabel.dock';
14
+    icon = IconDock;
15
+    label = 'toolbar.dock';
16
+    tooltip = 'toolbar.dock';
17
+
18
+    /**
19
+     * Handles clicking / pressing the button by triggering external api event.
20
+     *
21
+     * @protected
22
+     * @returns {void}
23
+     */
24
+    _handleClick() {
25
+        APP.API.notifyIframeDockStateChanged(true);
26
+    }
27
+}
28
+
29
+export default translate(DockIframeButton);

+ 16
- 0
react/features/toolbox/components/web/Toolbox.js View File

86
 import HelpButton from '../HelpButton';
86
 import HelpButton from '../HelpButton';
87
 
87
 
88
 import AudioSettingsButton from './AudioSettingsButton';
88
 import AudioSettingsButton from './AudioSettingsButton';
89
+import DockIframeButton from './DockIframeButton';
89
 import FullscreenButton from './FullscreenButton';
90
 import FullscreenButton from './FullscreenButton';
90
 import LinkToSalesforceButton from './LinkToSalesforceButton';
91
 import LinkToSalesforceButton from './LinkToSalesforceButton';
91
 import OverflowMenuButton from './OverflowMenuButton';
92
 import OverflowMenuButton from './OverflowMenuButton';
93
 import Separator from './Separator';
94
 import Separator from './Separator';
94
 import ShareDesktopButton from './ShareDesktopButton';
95
 import ShareDesktopButton from './ShareDesktopButton';
95
 import ToggleCameraButton from './ToggleCameraButton';
96
 import ToggleCameraButton from './ToggleCameraButton';
97
+import UndockIframeButton from './UndockIframeButton';
96
 import VideoSettingsButton from './VideoSettingsButton';
98
 import VideoSettingsButton from './VideoSettingsButton';
97
 
99
 
98
 /**
100
 /**
765
             group: 3
767
             group: 3
766
         };
768
         };
767
 
769
 
770
+        const dockIframe = {
771
+            key: 'dock-iframe',
772
+            Content: DockIframeButton,
773
+            group: 3
774
+        };
775
+
776
+        const undockIframe = {
777
+            key: 'undock-iframe',
778
+            Content: UndockIframeButton,
779
+            group: 3
780
+        };
781
+
768
         const speakerStats = {
782
         const speakerStats = {
769
             key: 'stats',
783
             key: 'stats',
770
             Content: SpeakerStatsButton,
784
             Content: SpeakerStatsButton,
829
             shareAudio,
843
             shareAudio,
830
             etherpad,
844
             etherpad,
831
             virtualBackground,
845
             virtualBackground,
846
+            dockIframe,
847
+            undockIframe,
832
             speakerStats,
848
             speakerStats,
833
             settings,
849
             settings,
834
             shortcuts,
850
             shortcuts,

+ 29
- 0
react/features/toolbox/components/web/UndockIframeButton.js View File

1
+// @flow
2
+
3
+import { translate } from '../../../base/i18n';
4
+import { IconUndock } from '../../../base/icons';
5
+import { AbstractButton, type AbstractButtonProps } from '../../../base/toolbox/components';
6
+
7
+declare var APP: Object;
8
+
9
+/**
10
+ * Implementation of a button for notifying integrators that iframe should be undocked.
11
+ */
12
+class UndockIframeButton extends AbstractButton<AbstractButtonProps, *> {
13
+    accessibilityLabel = 'toolbar.accessibilityLabel.undock';
14
+    icon = IconUndock;
15
+    label = 'toolbar.undock';
16
+    tooltip = 'toolbar.undock';
17
+
18
+    /**
19
+     * Handles clicking / pressing the button by triggering external api event.
20
+     *
21
+     * @protected
22
+     * @returns {void}
23
+     */
24
+    _handleClick() {
25
+        APP.API.notifyIframeDockStateChanged(false);
26
+    }
27
+}
28
+
29
+export default translate(UndockIframeButton);

Loading…
Cancel
Save