diff --git a/www/js/beauty.js b/www/js/beauty.js index c42eb5e..5344b41 100644 --- a/www/js/beauty.js +++ b/www/js/beauty.js @@ -269,12 +269,13 @@ if ($('#my-player').length > 0 && typeof(videojs) != 'undefined') { myPlayer.one('play', function() { myPlayer.pause(); + var height = myPlayer.videoHeight(), width = myPlayer.videoWidth(), + aspect = height / width; var canvas = document.createElement('canvas'); var video = $('video.vjs-tech').get(0); - //360p - canvas.width = 640; - canvas.height = 360; + canvas.width = Math.ceil(360/aspect); + canvas.height = 360; //360p var ctx = canvas.getContext('2d'); ctx.drawImage( video, 0, 0, canvas.width, canvas.height );