瀏覽代碼

CSS video changes

master
Roderic Day 5 年之前
父節點
當前提交
ed5bffc50d
共有 1 個文件被更改,包括 17 次插入7 次删除
  1. +17
    -7
      apps/streams.js

+ 17
- 7
apps/streams.js 查看文件

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],
} }

Loading…
取消
儲存