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

163
Visualizações
Muted attribute is removed from my video when cloned

Having trouble with the muted attribute on my video when it is cloned.

I have a video I am getting from firebase storage. When cloning the video to another section of my Web app, the muted attribute removes itself and the sound comes back on.

Does anyone know why this is happening and how to get around it?

function getData(folder){
  let newFile = folder.toString().toLowerCase();
  console.log(newFile);
// Create a reference under which you want to list -> variable "newFile" to select what file to load.
const listRef = ref(storage, newFile);

// Find all the prefixes and items.
listAll(listRef)
  .then((res) => {
    res.prefixes.forEach((folderRef) => {
    });
    res.items.forEach((itemRef) => {
      getDownloadURL(itemRef).then((url) =>{
        // Make the videoCard
        let videoCard = document.createElement('div');
        videoCard.classList = "videoCard";
        // Add vid section
        let vid = document.createElement('div');
        vid.classList = "vid";
        videoCard.appendChild(vid);
        // Make videocard
        let newVideo = document.createElement('video');
        newVideo.src =`${url}`
        newVideo.setAttribute('width', 300)
        newVideo.classList.add('videoAdded')
        newVideo.autoplay = true;
        newVideo.muted = true;
        newVideo.loop = true;
        vid.appendChild(newVideo);
        // Make heading and button 
        let headingDiv = document.createElement('div');
        headingDiv.classList = "heading_add"
        let newh2 = document.createElement('h2');
        newh2.innerHTML = itemRef.name;
        headingDiv.appendChild(newh2)
        videoCard.appendChild(headingDiv)
        // Button for h2
        let newBtn = document.createElement('button');
        newBtn.classList = "add_video_btn";
        newBtn.innerHTML = "+";
        headingDiv.appendChild(newBtn);
        videos.appendChild(videoCard);

        newBtn.addEventListener('click', () =>{
          const exercises = document.querySelector('.exercises');
          const clone = videoCard.cloneNode(true);
          
      console.log(clone)
          exercises.appendChild(clone)
        });
      })
    });
  }).catch((error) => {
    // FUCK! An error occurred!
    console.log(error)
  });
}

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