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

134
Visualizações
How to enable audio by default in embedded videos with javascipt?

Is it possible to activate audio in my website for any embedded videos using a javascript/jquery plugin?

I have a website which plays Vimeo videos. Many of these videos have its trailer playing in the background and we want to play the sound of the trailer when the page loads.

I wanted something like asking visitors their approval to play sound on those embedded trailers when they reach the site. Something like setting a cookie with the approval:

<p class="audio-notice">
    This site works better with audio enabled by default
    <button onClick="enable_video_sound()">Enable sound on video tailers</button>
</p>

<script>
    var play_sound = <?php echo isset( $_SESSION['enable_video_sound'] ) && ( $_SESSION['enable_video_sound'] == 0 ) ? 'true' : 'false'; ?>;

    function enable_video_sound(){
        if( play_sound == false ){
            // Set the SESSION variable
            play_sound = true;
        }
    }

    $(document).ready(function(){
        // When a video is plays
        // Do something to set the volume of the playing clip at 100%
        // 
    });
</script>
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