Browse Source

feat(branding) Add premeeting background image overwrite

master
hmuresan 4 years ago
parent
commit
6c40329f6a

+ 5
- 1
config.js View File

794
          // The anchor url used when clicking the logo image
794
          // The anchor url used when clicking the logo image
795
          logoClickUrl: 'https://example-company.org',
795
          logoClickUrl: 'https://example-company.org',
796
          // The url used for the image used as logo
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
     // dynamicBrandingUrl: '',
804
     // dynamicBrandingUrl: '',

+ 27
- 13
react/features/base/premeeting/components/web/PreMeetingScreen.js View File

17
      */
17
      */
18
     _buttons: Array<string>,
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
      * Children component(s) to be rendered on the screen.
26
      * Children component(s) to be rendered on the screen.
22
      */
27
      */
91
     render() {
96
     render() {
92
         const {
97
         const {
93
             _buttons,
98
             _buttons,
99
+            _premeetingBackground,
94
             children,
100
             children,
95
             className,
101
             className,
96
             showDeviceStatus,
102
             showDeviceStatus,
101
         } = this.props;
107
         } = this.props;
102
 
108
 
103
         const containerClassName = `premeeting-screen ${className ? className : ''}`;
109
         const containerClassName = `premeeting-screen ${className ? className : ''}`;
110
+        const style = _premeetingBackground ? {
111
+            background: _premeetingBackground,
112
+            backgroundPosition: 'center',
113
+            backgroundSize: 'cover'
114
+        } : {};
104
 
115
 
105
         return (
116
         return (
106
             <div className = { containerClassName }>
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
                     </div>
131
                     </div>
119
                 </div>
132
                 </div>
120
-
121
                 <Preview
133
                 <Preview
122
                     videoMuted = { videoMuted }
134
                     videoMuted = { videoMuted }
123
                     videoTrack = { videoTrack } />
135
                     videoTrack = { videoTrack } />
139
     const premeetingButtons = ownProps.thirdParty
151
     const premeetingButtons = ownProps.thirdParty
140
         ? THIRD_PARTY_PREJOIN_BUTTONS
152
         ? THIRD_PARTY_PREJOIN_BUTTONS
141
         : PREMEETING_BUTTONS;
153
         : PREMEETING_BUTTONS;
154
+    const { premeetingBackground } = state['features/dynamic-branding'];
142
 
155
 
143
     return {
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 View File

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

Loading…
Cancel
Save