| color: 'white', | color: 'white', | ||||
| overflow: 'hidden', | overflow: 'hidden', | ||||
| } | } | ||||
| const styleInner = { | |||||
| objectFit: 'cover', | |||||
| const styleMeta = { | |||||
| position: 'absolute', | |||||
| display: 'flex', | |||||
| alignItems: 'center', | |||||
| justifyContent: 'center', | |||||
| height: '100%', | |||||
| width: '100%', | |||||
| fontFamily: 'monospace', | |||||
| fontSize: 'xxx-large', | |||||
| } | |||||
| const styleVideo = { | |||||
| objectFit: 'contain', // cover | |||||
| width: '100%', | width: '100%', | ||||
| height: '100%', | height: '100%', | ||||
| transform: 'scaleX(-1)', | transform: 'scaleX(-1)', | ||||
| } | } | ||||
| return m('.video-container', {style: styleOuter}, | return m('.video-container', {style: styleOuter}, | ||||
| m('.video-info', {style: {position: 'absolute', zIndex: 999}}, | |||||
| m('span', {style: {padding: '5px'}}, username), | |||||
| m('.video-info', {style: styleMeta}, | |||||
| m('.username', username), | |||||
| ), | ), | ||||
| m('video[playsinline][autoplay]', { | m('video[playsinline][autoplay]', { | ||||
| style: styleInner, | |||||
| style: styleVideo, | |||||
| oncreate: this.setUp(username), | oncreate: this.setUp(username), | ||||
| onremove: this.tearDown(username), | onremove: this.tearDown(username), | ||||
| }), | }), | ||||
| const style = { | const style = { | ||||
| overflow: 'hidden', | overflow: 'hidden', | ||||
| display: 'grid', | display: 'grid', | ||||
| padding: '3px', | |||||
| gridGap: '3px', | |||||
| padding: '1px', | |||||
| gridGap: '1px', | |||||
| gridTemplateRows: dims[0], | gridTemplateRows: dims[0], | ||||
| gridTemplateColumns: dims[1], | gridTemplateColumns: dims[1], | ||||
| } | } |