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

117
Visualizações
Vue - Adding background animation

I'm trying to add some background mp4/gif animation to my webpage, but for some reason it's not working - it only shows some black placeholder for (what seems to be) the animation.

This is the library I've tried to use: https://github.com/pespantelis/vue-videobg

Having followed the instructions, I've ended up with this (only showing relevant sections):

The main.js file:

// eslint-disable-next-line import/extensions
import VideoBg from 'vue-videobg';

Vue.component('video-bg', VideoBg);

The Comp.Vue component file:

<template>
  <div>
    <v-container fluid class="primary">
      <v-row>
        <v-col>
          <video-bg :sources="['../assets/witchcraft-magic.mp4']"
                    img="../assets/vast.png">
          </video-bg>
        </v-col>
      </v-row>
    </v-container>
  </div>
</template>

BTW the same outcome happened to me while trying using other libraries - for example https://github.com/avidofood/vue-responsive-video-background-player so I guess there's something basic I'm doing wrong

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

Sometimes .. in the path does not work. Try giving the complete path like

<video-bg :sources="['<project-name>/assets/witchcraft-magic.mp4']"
                img="<project-name>/assets/vast.png">
      </video-bg>
about 4 years ago · Juan Pablo Isaza Relatório

0

Try :

:sources="[require('@/assets/witchcraft-magic.mp4')]"

:img="require('@/assets/img/vast.png')"
about 4 years ago · Juan Pablo Isaza Relatório
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