Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

126
Visualizações
How to align and clip overlay to match iframe video?

I'm trying to align to make some custom ''video player'' thingy based around two iframes acting as double buffers and an overlay that will allow users to perform custom actions, similar to Coursera's modal questions.

All this will be exposed later through and uri that will be used in an external iframe (yea, i know)

The issue i'm facing is that i need the overlay to always match the video inside the iframes but the iframes themselves seem to be bigger than the actual video. For example, by assigning width: 100% to the iframes i manage to get a consistent result accessing this component through another iframe (the one that will be used in the website).

Current html structure using VueJs

  <div id="action-player">

      <!-- Interactive layer -->
      <div class="a-overlay-layer">
        <slot name="overlay-layer"></slot>
      </div>

      <!-- iFrame double buffer -->
      <div class="a-iframe-layer">
        <div id="buffer0" :class="['a-frame-buffer', { 'a-frame-buffer__active': bufferState.active === 0 }]"></div>
        <div id="buffer1" :class="['a-frame-buffer', { 'a_frame-buffer__active': bufferState.active === 1 }]"></div>
      </div>
  </div>

Both buffers are being instanced by vimeo player. Currently in the slot for the overlay i just have a background:red element covering the screen;insira o código aqui

.a_player {
  position: relative;
  width: 100%;
  height: 100%;

  // padding-top: 56.25%; // //Aspect ratio 16:9
}
.a-overlay-layer {
  position: absolute;
  display: block;
  float: right;
  height: 100%;
  width: 100%;
  z-index: 2147483647;
  pointer-events: none;
  // background: transparent;
}
.a-iframe-layer {
  position: relative;
  width: 100%;
  height: 100%;
}
.a-frame-buffer {
  position: absolute;
  z-index: 99;
  display: block;
  height: 100%;
  width: 100%;
  // vimeo iframe
  iframe {
    height: 100%;
    width: 100%;
  }
}
.a-frame-buffer__active {
  z-index: 100 !important;
  animation: smoothTransition 0.425s linear 0s 1 normal both;
}

The double buffer works fine, i just need to find a way to keep the overlay matching the video size not the whole iframe, which i thin, i defaulting to the whole screen cause of width: 100%.

Appreciate the help! o/

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda