INNER CODE UNIT · JavaScript

video

presenta-software/presenta-lib · src/blocks/video/index.js:4

const video = function (el, config) {
  const presentMode = config._mode === 'present'

  const poster = config.poster ? `poster=${config.poster}` : ''
  const loop = config.loop ? 'loop' : ''
  const muted = config.muted ? 'muted' : ''
  const autoplay = config.autoplay && presentMode ? 'autoplay' : ''
  const src = config.url ? `src=${config.url}` : ''

  const child = u.div(`<div class="${css.video}" id="evt_trg_uid_block_video_${config._index}">
    <video ${poster} ${src} ${loop} ${autoplay} ${muted}></video>
  </div>`)

  this.beforeDestroy = () => {
    config._rootElement.removeEventListener('keyup', setKeyListener)
    child.removeEventListener('click', toggleVideo)
  }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…