Last active
August 29, 2015 14:14
-
-
Save victorvhpg/05de5b2d183a9fe5f1f3 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
downloadArquivo("./video.ogv", function(progresso, total, perc) { | |
document.querySelector("progress").value = perc; | |
}).then(function(blob) { | |
//cria o elemento video | |
var video = document.createElement("video"); | |
video.autoplay = true; | |
//cria uma URL para o video // blob: xxxxxxx | |
video.src = window.URL.createObjectURL(blob); | |
//apos o video carregar pode remover url window.URL.revokeObjectURL(video.src); | |
//coloca o video no body | |
document.querySelector("body").appendChild(video); | |
document.querySelector("#url").innerHTML = "URL do video: <a href='" + video.src + "' target='_blank'>" + video.src + "</a>"; | |
}).catch(function(erro) { | |
console.log(erro); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment