1
1
import { BoolCodeControl } from "comps/controls/codeControl" ;
2
2
import { dropdownControl } from "comps/controls/dropdownControl" ;
3
- import { IconControl } from "comps/controls/iconControl" ;
3
+ // import { IconControl } from "comps/controls/iconControl";
4
4
import { CompNameContext , EditorContext , EditorState } from "comps/editorState" ;
5
5
import { withDefault } from "comps/generators" ;
6
6
import { UICompBuilder } from "comps/generators/uiCompBuilder" ;
7
7
import ReactResizeDetector from "react-resize-detector" ;
8
- import _ from "lodash" ;
8
+ // import _ from "lodash";
9
9
import {
10
10
CommonBlueLabel ,
11
11
controlItem ,
@@ -61,7 +61,7 @@ const VideoContainer = styled.video`
61
61
width: 100%;
62
62
display: flex;
63
63
align-items: center;
64
- justify-content: center ;
64
+ justify-content: space-around ;
65
65
` ;
66
66
67
67
function getForm ( editorState : EditorState , formName : string ) {
@@ -140,13 +140,14 @@ export const meetingStreamChildren = {
140
140
shareScreen : withDefault ( BoolShareVideoControl , false ) ,
141
141
profilePadding : withDefault ( StringControl , "0px" ) ,
142
142
profileBorderRadius : withDefault ( StringControl , "0px" ) ,
143
+ videoAspectRatio : withDefault ( StringControl , "1 / 1" ) ,
143
144
type : dropdownControl ( typeOptions , "" ) ,
144
145
onEvent : MeetingEventHandlerControl ,
145
146
disabled : BoolCodeControl ,
146
147
loading : BoolCodeControl ,
147
148
form : SelectFormControl ,
148
- prefixIcon : IconControl ,
149
- suffixIcon : IconControl ,
149
+ // prefixIcon: IconControl,
150
+ // suffixIcon: IconControl,
150
151
style : ButtonStyleControl ,
151
152
viewRef : RefControl < HTMLElement > ,
152
153
userId : stringExposingStateControl ( "" ) ,
@@ -169,12 +170,12 @@ let VideoCompBuilder = (function (props) {
169
170
if ( props . userId . value !== "" ) {
170
171
let userData = JSON . parse ( props . userId ?. value ) ;
171
172
if (
172
- userData . user == userId &&
173
- userData . streamingVideo == false &&
173
+ userData . user === userId &&
174
+ userData . streamingVideo === false &&
174
175
videoRef . current &&
175
- videoRef . current ?. id == userId + ""
176
+ videoRef . current ?. id === userId + ""
176
177
) {
177
- if ( videoRef . current && videoRef . current ?. id == userId + "" ) {
178
+ if ( videoRef . current && videoRef . current ?. id === userId + "" ) {
178
179
videoRef . current . srcObject = null ;
179
180
setVideo ( false ) ;
180
181
}
@@ -189,8 +190,8 @@ let VideoCompBuilder = (function (props) {
189
190
let userId = user . uid + "" ;
190
191
if (
191
192
user . hasVideo &&
192
- user . uid + "" != userData . user &&
193
- userData . user != ""
193
+ user . uid + "" !== userData . user &&
194
+ userData . user !== ""
194
195
) {
195
196
props . onEvent ( "videoOn" ) ;
196
197
}
@@ -204,8 +205,8 @@ let VideoCompBuilder = (function (props) {
204
205
const remoteTrack = await client . subscribe ( user , mediaType ) ;
205
206
if (
206
207
user . hasAudio &&
207
- user . uid + "" != userData . user &&
208
- userData . user != ""
208
+ user . uid + "" !== userData . user &&
209
+ userData . user !== ""
209
210
) {
210
211
userData . audiostatus = user . hasVideo ;
211
212
@@ -221,21 +222,21 @@ let VideoCompBuilder = (function (props) {
221
222
if ( mediaType === "audio" ) {
222
223
if (
223
224
! user . hasAudio &&
224
- user . uid + "" != userData . user &&
225
- userData . user != ""
225
+ user . uid + "" !== userData . user &&
226
+ userData . user !== ""
226
227
) {
227
228
userData . audiostatus = user . hasVideo ;
228
229
props . onEvent ( "audioMuted" ) ;
229
230
}
230
231
}
231
232
if ( mediaType === "video" ) {
232
- if ( videoRef . current && videoRef . current ?. id == user . uid + "" ) {
233
+ if ( videoRef . current && videoRef . current ?. id === user . uid + "" ) {
233
234
videoRef . current . srcObject = null ;
234
235
}
235
236
if (
236
237
! user . hasVideo &&
237
- user . uid + "" != userData . user &&
238
- userData . user != ""
238
+ user . uid + "" !== userData . user &&
239
+ userData . user !== ""
239
240
) {
240
241
props . onEvent ( "videoOff" ) ;
241
242
}
@@ -245,7 +246,7 @@ let VideoCompBuilder = (function (props) {
245
246
246
247
setUserId ( userData . user ) ;
247
248
setUsername ( userData . userName ) ;
248
- console . log ( userData ) ;
249
+ // console.log(userData);
249
250
}
250
251
} , [ props . userId . value ] ) ;
251
252
@@ -261,7 +262,7 @@ let VideoCompBuilder = (function (props) {
261
262
height : "100%" ,
262
263
overflow : "hidden" ,
263
264
borderRadius : props . style . radius ,
264
- aspectRatio : "1 / 1" ,
265
+ aspectRatio : props . videoAspectRatio ,
265
266
backgroundColor : props . style . background ,
266
267
padding : props . style . padding ,
267
268
margin : props . style . margin ,
@@ -274,7 +275,7 @@ let VideoCompBuilder = (function (props) {
274
275
ref = { videoRef }
275
276
style = { {
276
277
display : `${ showVideo ? "flex" : "none" } ` ,
277
- aspectRatio : "1 / 1" ,
278
+ aspectRatio : props . videoAspectRatio ,
278
279
borderRadius : props . style . radius ,
279
280
width : "auto" ,
280
281
} }
@@ -290,7 +291,7 @@ let VideoCompBuilder = (function (props) {
290
291
padding : props . profilePadding ,
291
292
} }
292
293
>
293
- < img
294
+ < img alt = ""
294
295
style = { {
295
296
borderRadius : props . profileBorderRadius ,
296
297
width : "100%" ,
@@ -311,7 +312,7 @@ let VideoCompBuilder = (function (props) {
311
312
padding : props . profilePadding ,
312
313
} }
313
314
>
314
- < img
315
+ < img alt = ""
315
316
style = { {
316
317
borderRadius : props . profileBorderRadius ,
317
318
width : "100%" ,
@@ -336,6 +337,10 @@ let VideoCompBuilder = (function (props) {
336
337
{ children . shareScreen . propertyView ( {
337
338
label : trans ( "meeting.shareScreen" ) ,
338
339
} ) }
340
+ { children . profileImageUrl . propertyView ( {
341
+ label : trans ( "meeting.profileImageUrl" ) ,
342
+ placeholder : "https://via.placeholder.com/120" ,
343
+ } ) }
339
344
</ Section >
340
345
341
346
< Section name = { sectionNames . interaction } >
@@ -345,15 +350,14 @@ let VideoCompBuilder = (function (props) {
345
350
{ hiddenPropertyView ( children ) }
346
351
</ Section >
347
352
< Section name = { sectionNames . style } >
348
- { children . profileImageUrl . propertyView ( {
349
- label : trans ( "meeting.profileImageUrl" ) ,
350
- placeholder : "https://via.placeholder.com/120" ,
351
- } ) }
352
353
{ children . profilePadding . propertyView ( {
353
- label : "Profile Padding" ,
354
+ label : "Profile Image Padding" ,
354
355
} ) }
355
356
{ children . profileBorderRadius . propertyView ( {
356
- label : "Profile Border Radius" ,
357
+ label : "Profile Image Border Radius" ,
358
+ } ) }
359
+ { children . videoAspectRatio . propertyView ( {
360
+ label : "Video Aspect Ratio" ,
357
361
} ) }
358
362
{ children . style . getPropertyView ( ) }
359
363
</ Section >
0 commit comments