Sfoglia il codice sorgente

CSS video changes

master
Roderic Day 5 anni fa
parent
commit
ed5bffc50d
1 ha cambiato i file con 17 aggiunte e 7 eliminazioni
  1. +17
    -7
      apps/streams.js

+ 17
- 7
apps/streams.js Vedi File

@@ -137,18 +137,28 @@ const Video = {
color: 'white',
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%',
height: '100%',
transform: 'scaleX(-1)',
}
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]', {
style: styleInner,
style: styleVideo,
oncreate: this.setUp(username),
onremove: this.tearDown(username),
}),
@@ -174,8 +184,8 @@ const StreamContainer = {
const style = {
overflow: 'hidden',
display: 'grid',
padding: '3px',
gridGap: '3px',
padding: '1px',
gridGap: '1px',
gridTemplateRows: dims[0],
gridTemplateColumns: dims[1],
}

Loading…
Annulla
Salva