m.redraw() | m.redraw() | ||||
}, | }, | ||||
view() { | view() { | ||||
return ScreenShare.isOff ? [] : | |||||
m('video.screen[playsinline][autoplay]', { | |||||
return ScreenShare.isOff ? [] : m('.screen', | |||||
ScreenShare.isSource | |||||
? m('.video-info', 'Screen sharing') | |||||
: m('video[playsinline][autoplay]', { | |||||
oncreate: ({dom}) => { | oncreate: ({dom}) => { | ||||
dom.srcObject = ScreenShare.stream | dom.srcObject = ScreenShare.stream | ||||
}, | }, | ||||
dom.srcObject = ScreenShare.stream | dom.srcObject = ScreenShare.stream | ||||
} | } | ||||
}, | }, | ||||
}) | |||||
})) | |||||
}, | }, | ||||
} | } | ||||
addEventListener('screen-stop', () => { | addEventListener('screen-stop', () => { |
}) | }) | ||||
const Video = { | const Video = { | ||||
view({attrs: {username}}) { | view({attrs: {username}}) { | ||||
const styleOuter = { | |||||
position: 'relative', | |||||
display: 'block', | |||||
color: 'white', | |||||
overflow: 'hidden', | |||||
} | |||||
const styleMeta = { | |||||
position: 'absolute', | |||||
display: 'flex', | |||||
alignItems: 'center', | |||||
justifyContent: 'center', | |||||
height: '100%', | |||||
width: '100%', | |||||
fontFamily: 'monospace', | |||||
fontSize: 'x-large', | |||||
} | |||||
const styleVideo = { | const styleVideo = { | ||||
objectFit: Settings.get('blackBars') ? 'contain' : 'cover', | objectFit: Settings.get('blackBars') ? 'contain' : 'cover', | ||||
width: '100%', | width: '100%', | ||||
height: '100%', | height: '100%', | ||||
transform: username === State.username ? 'scaleX(-1)' : 'scaleX(1)', | transform: username === State.username ? 'scaleX(-1)' : 'scaleX(1)', | ||||
} | } | ||||
return m('.video-container', {style: styleOuter}, | |||||
m('.video-info', {style: styleMeta}, | |||||
return m('.video-container', | |||||
m('.video-info', | |||||
m(`.label-${username}`, username), | m(`.label-${username}`, username), | ||||
), | ), | ||||
m('video[playsinline][autoplay]', { | m('video[playsinline][autoplay]', { |
deploy: libs/ | deploy: libs/ | ||||
rsync --archive --delete --exclude=.git --exclude=venv . root@roderic.ca:/home/pico.chat/ | rsync --archive --delete --exclude=.git --exclude=venv . root@roderic.ca:/home/pico.chat/ | ||||
ssh root@roderic.ca "cd /home/pico.chat/ && service pico.chat restart" | |||||
# ssh root@roderic.ca "cd /home/pico.chat/ && service pico.chat restart" | |||||
venv/: requirements.txt | venv/: requirements.txt | ||||
rm -rf venv | rm -rf venv |
overflow: hidden; | overflow: hidden; | ||||
display: flex; | display: flex; | ||||
} | } | ||||
.video-container { | |||||
position: relative; | |||||
display: block; | |||||
overflow: hidden; | |||||
} | |||||
.video-info { | |||||
color: white; | |||||
position: absolute; | |||||
display: flex; | |||||
align-items: center; | |||||
justify-content: center; | |||||
height: 100%; | |||||
width: 100%; | |||||
font-family: monospace; | |||||
font-size: x-large; | |||||
} | |||||
.videos { | .videos { | ||||
flex: 1; | flex: 1; | ||||
} | } |