我试图获得宽度和宽度。通过phonegap捕获的视频的高度。无论我的iphone在拍摄视频时是纵向还是横向,宽度/高度输出始终为480x360。知道为什么吗?
captureSuccess: function(mediaFiles) {
var path, mediaFile;
path = mediaFiles[0].fullPath;
mediaFile = mediaFiles[0];
mediaFile.getFormatData(function(mediaFileData) {
console.log(mediaFileData);
//output for mediaFileData : {"width":480,"duration":1.478333,"bitrate":0,"codecs":null,"height":360}
}, function(error) {
console.log(error);
});
}
答案 0 :(得分:1)
试试这个
$("<video/>").attr("src", "VIDEO_PATH").on('loadedmetadata', function() {
var dimensions = [this.videoWidth, this.videoHeight];
alert(dimensions);
});