Browse Source

Toggle cover/contain

master
Roderic Day 5 years ago
parent
commit
77dd944f2a
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      apps/streams.js

+ 5
- 1
apps/streams.js View File

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

Loading…
Cancel
Save