Tengo una hoja de cálculo de Google con las URL de mis archivos de audio de mi propia carpeta de Google Drive. Realicé un Script de labnol.org ( gracias a @Amit Agarwal ) para abrir un Mini Player en un iframe.
¿Es posible reproducir automáticamente el archivo si el mini reproductor está abierto?
El script de aplicaciones es de aquí: 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'); };Utilice el atributo de autoplay delelemento de audio :
/** * 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) ,"🔊") )()