-
-
Save parzibyte/176729f479b469e538e94c1e9f27c0bb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Cuando se detenga (haciendo click en el botón) se ejecuta esto | |
mediaRecorder.addEventListener("stop", () => { | |
// Pausar vídeo | |
$video.pause(); | |
// Detener el stream | |
stream.getTracks().forEach(track => track.stop()); | |
// Detener la cuenta regresiva | |
detenerConteo(); | |
// Convertir los fragmentos a un objeto binario | |
const blobVideo = new Blob(fragmentosDeAudio); | |
// Crear una URL o enlace para descargar | |
const urlParaDescargar = URL.createObjectURL(blobVideo); | |
// Crear un elemento <a> invisible para descargar el audio | |
let a = document.createElement("a"); | |
document.body.appendChild(a); | |
a.style = "display: none"; | |
a.href = urlParaDescargar; | |
a.download = "grabacion_parzibyte.me.webm"; | |
// Hacer click en el enlace | |
a.click(); | |
// Y remover el objeto | |
window.URL.revokeObjectURL(urlParaDescargar); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment