Переглянути джерело

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

master
Avram Tudor 3 роки тому
джерело
коміт
543f273792
Аккаунт користувача з таким Email не знайдено

+ 2
- 0
config.js Переглянути файл

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

+ 4
- 0
lang/main.json Переглянути файл

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

+ 16
- 0
modules/API/API.js Переглянути файл

@@ -1461,6 +1461,22 @@ class API {
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 1481
      * Notify external application of a participant, remote or local, being
1466 1482
      * removed from the conference by another participant.

+ 1
- 0
modules/API/external/external_api.js Переглянути файл

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

+ 3
- 0
react/features/base/icons/svg/dock.svg Переглянути файл

@@ -0,0 +1,3 @@
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 Переглянути файл

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

+ 3
- 0
react/features/base/icons/svg/undock.svg Переглянути файл

@@ -0,0 +1,3 @@
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 Переглянути файл

@@ -0,0 +1,29 @@
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 Переглянути файл

@@ -86,6 +86,7 @@ import HangupButton from '../HangupButton';
86 86
 import HelpButton from '../HelpButton';
87 87
 
88 88
 import AudioSettingsButton from './AudioSettingsButton';
89
+import DockIframeButton from './DockIframeButton';
89 90
 import FullscreenButton from './FullscreenButton';
90 91
 import LinkToSalesforceButton from './LinkToSalesforceButton';
91 92
 import OverflowMenuButton from './OverflowMenuButton';
@@ -93,6 +94,7 @@ import ProfileButton from './ProfileButton';
93 94
 import Separator from './Separator';
94 95
 import ShareDesktopButton from './ShareDesktopButton';
95 96
 import ToggleCameraButton from './ToggleCameraButton';
97
+import UndockIframeButton from './UndockIframeButton';
96 98
 import VideoSettingsButton from './VideoSettingsButton';
97 99
 
98 100
 /**
@@ -765,6 +767,18 @@ class Toolbox extends Component<Props> {
765 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 782
         const speakerStats = {
769 783
             key: 'stats',
770 784
             Content: SpeakerStatsButton,
@@ -829,6 +843,8 @@ class Toolbox extends Component<Props> {
829 843
             shareAudio,
830 844
             etherpad,
831 845
             virtualBackground,
846
+            dockIframe,
847
+            undockIframe,
832 848
             speakerStats,
833 849
             settings,
834 850
             shortcuts,

+ 29
- 0
react/features/toolbox/components/web/UndockIframeButton.js Переглянути файл

@@ -0,0 +1,29 @@
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);

Завантаження…
Відмінити
Зберегти