Ver código fonte

Toggle cover/contain

master
Roderic Day 5 anos atrás
pai
commit
77dd944f2a
1 arquivos alterados com 5 adições e 1 exclusões
  1. +5
    -1
      apps/streams.js

+ 5
- 1
apps/streams.js Ver arquivo

@@ -148,7 +148,7 @@ const Video = {
fontSize: 'xxx-large',
}
const styleVideo = {
objectFit: 'contain', // cover
objectFit: 'contain',
width: '100%',
height: '100%',
transform: 'scaleX(-1)',
@@ -159,6 +159,10 @@ const Video = {
),
m('video[playsinline][autoplay]', {
style: styleVideo,
onclick: ({target: {style}}) => {
const level = style.objectFit === 'contain'
style.objectFit = ['contain', 'cover'][+level]
},
oncreate: this.setUp(username),
onremove: this.tearDown(username),
}),

Carregando…
Cancelar
Salvar