Created
December 7, 2015 23:01
-
-
Save im7mortal/0fa75618821969620d05 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
$(':file').change(function(){ | |
var file = this.files[0]; | |
var name = file.name; | |
var size = file.size; | |
var type = file.type; | |
console.log(name, size, type, file); | |
var myVideoPlayer = document.createElement('video'); | |
myVideoPlayer.src = URL.createObjectURL(file); | |
myVideoPlayer.addEventListener('loadedmetadata', function() { | |
console.log(myVideoPlayer.duration); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment