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
Autoplay a mp3 file with Apps Script in Google sheets

I have a Google Sheet with URLs of my audio Files from my own Google Drive Folder. I realised a Script from labnol.org (thanks to @Amit Agarwal) to Open a Mini Player in an iframe.

Is it possible to autoplay the file, if the mini Player is opend?

The Apps script is from Here: https://www.labnol.org/play-mp3-google-sheets-220504:

const openAudioPlayer = () => {
  const cell = SpreadsheetApp.getActiveSheet().getActiveCell().getValue();
  const html = `<iframe src="${cell}" width="480" height="180" frameborder="0" scrolling="no"></iframe>`;
  const dialog = HtmlService.createHtmlOutput(html).setTitle('Play').setWidth(500).setHeight(200);
  SpreadsheetApp.getUi().showModelessDialog(dialog, 'Play Audio');
};
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Use autoplay attribute of audio element:

/**
 * Plays audio from src specified in active cell
 * @OnlyCurrentDoc
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/audio
 * @link https://stackoverflow.com/a/73228860/
 */
(()=>SpreadsheetApp.getUi().showModelessDialog(
      HtmlService.createHtmlOutput(`<audio src="${
       SpreadsheetApp.getActiveRange().getValue()
      }" autoplay>`).setWidth(1).setHeight(1)
     ,"🔊")
)()
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