瀏覽代碼

feat(branding) Add premeeting background image overwrite

master
hmuresan 4 年之前
父節點
當前提交
6c40329f6a

+ 5
- 1
config.js 查看文件

@@ -794,7 +794,11 @@ var config = {
794 794
          // The anchor url used when clicking the logo image
795 795
          logoClickUrl: 'https://example-company.org',
796 796
          // The url used for the image used as logo
797
-         logoImageUrl: 'https://example.com/logo-img.png'
797
+         logoImageUrl: 'https://example.com/logo-img.png',
798
+         // Overwrite for pool of background images for avatars
799
+         avatarBackgrounds: ['url(https://example.com/avatar-background-1.png)', '#FFF'],
800
+         // The lobby/prejoin screen background
801
+         premeetingBackground: 'url(https://example.com/premeeting-background.png)'
798 802
      }
799 803
     */
800 804
     // dynamicBrandingUrl: '',

+ 27
- 13
react/features/base/premeeting/components/web/PreMeetingScreen.js 查看文件

@@ -17,6 +17,11 @@ type Props = {
17 17
      */
18 18
     _buttons: Array<string>,
19 19
 
20
+    /**
21
+     * The branding background of the premeeting screen(lobby/prejoin).
22
+     */
23
+    _premeetingBackground: string,
24
+
20 25
     /**
21 26
      * Children component(s) to be rendered on the screen.
22 27
      */
@@ -91,6 +96,7 @@ class PreMeetingScreen extends PureComponent<Props> {
91 96
     render() {
92 97
         const {
93 98
             _buttons,
99
+            _premeetingBackground,
94 100
             children,
95 101
             className,
96 102
             showDeviceStatus,
@@ -101,23 +107,29 @@ class PreMeetingScreen extends PureComponent<Props> {
101 107
         } = this.props;
102 108
 
103 109
         const containerClassName = `premeeting-screen ${className ? className : ''}`;
110
+        const style = _premeetingBackground ? {
111
+            background: _premeetingBackground,
112
+            backgroundPosition: 'center',
113
+            backgroundSize: 'cover'
114
+        } : {};
104 115
 
105 116
         return (
106 117
             <div className = { containerClassName }>
107
-                <div className = 'content'>
108
-                    <ConnectionStatus />
109
-
110
-                    <div className = 'content-controls'>
111
-                        <h1 className = 'title'>
112
-                            { title }
113
-                        </h1>
114
-                        { children }
115
-                        { _buttons.length && <Toolbox toolbarButtons = { _buttons } /> }
116
-                        { skipPrejoinButton }
117
-                        { showDeviceStatus && <DeviceStatus /> }
118
+                <div style = { style }>
119
+                    <div className = 'content'>
120
+                        <ConnectionStatus />
121
+
122
+                        <div className = 'content-controls'>
123
+                            <h1 className = 'title'>
124
+                                { title }
125
+                            </h1>
126
+                            { children }
127
+                            { _buttons.length && <Toolbox toolbarButtons = { _buttons } /> }
128
+                            { skipPrejoinButton }
129
+                            { showDeviceStatus && <DeviceStatus /> }
130
+                        </div>
118 131
                     </div>
119 132
                 </div>
120
-
121 133
                 <Preview
122 134
                     videoMuted = { videoMuted }
123 135
                     videoTrack = { videoTrack } />
@@ -139,9 +151,11 @@ function mapStateToProps(state, ownProps): Object {
139 151
     const premeetingButtons = ownProps.thirdParty
140 152
         ? THIRD_PARTY_PREJOIN_BUTTONS
141 153
         : PREMEETING_BUTTONS;
154
+    const { premeetingBackground } = state['features/dynamic-branding'];
142 155
 
143 156
     return {
144
-        _buttons: premeetingButtons.filter(b => !hideButtons.includes(b))
157
+        _buttons: premeetingButtons.filter(b => !hideButtons.includes(b)),
158
+        _premeetingBackground: premeetingBackground
145 159
     };
146 160
 }
147 161
 

+ 11
- 1
react/features/dynamic-branding/reducer.js 查看文件

@@ -99,6 +99,14 @@ const DEFAULT_STATE = {
99 99
      */
100 100
     logoImageUrl: '',
101 101
 
102
+    /**
103
+     * The lobby/prejoin background.
104
+     *
105
+     * @public
106
+     * @type {string}
107
+     */
108
+    premeetingBackground: '',
109
+
102 110
     /**
103 111
      * Flag used to signal if the app should use a custom logo or not
104 112
      *
@@ -115,6 +123,7 @@ ReducerRegistry.register(STORE_NAME, (state = DEFAULT_STATE, action) => {
115 123
     switch (action.type) {
116 124
     case SET_DYNAMIC_BRANDING_DATA: {
117 125
         const {
126
+            avatarBackgrounds,
118 127
             backgroundColor,
119 128
             backgroundImageUrl,
120 129
             defaultBranding,
@@ -122,7 +131,7 @@ ReducerRegistry.register(STORE_NAME, (state = DEFAULT_STATE, action) => {
122 131
             inviteDomain,
123 132
             logoClickUrl,
124 133
             logoImageUrl,
125
-            avatarBackgrounds
134
+            premeetingBackground
126 135
         } = action.value;
127 136
 
128 137
         return {
@@ -134,6 +143,7 @@ ReducerRegistry.register(STORE_NAME, (state = DEFAULT_STATE, action) => {
134 143
             inviteDomain,
135 144
             logoClickUrl,
136 145
             logoImageUrl,
146
+            premeetingBackground,
137 147
             customizationFailed: false,
138 148
             customizationReady: true,
139 149
             useDynamicBrandingData: true

Loading…
取消
儲存