From 2b854a4841acf98c2ac9c1542dc3600445c3da69 Mon Sep 17 00:00:00 2001 From: Kiro705 Date: Mon, 9 Sep 2019 11:14:53 -0400 Subject: [PATCH] fix: changed to parseFloat --- src/player-wrapper.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/player-wrapper.js b/src/player-wrapper.js index 679f18d7..31a6f276 100644 --- a/src/player-wrapper.js +++ b/src/player-wrapper.js @@ -384,11 +384,11 @@ PlayerWrapper.prototype.play = function() { PlayerWrapper.prototype.getPlayerWidth = function() { let width = (getComputedStyle(this.vjsPlayer.el()) || {}).width; - if (!width || parseInt(width, 10) === 0) { + if (!width || parseFloat(width, 10) === 0) { width = (this.vjsPlayer.el().getBoundingClientRect() || {}).width; } - return parseInt(width, 10) || this.vjsPlayer.width(); + return parseFloat(width, 10) || this.vjsPlayer.width(); }; @@ -400,11 +400,11 @@ PlayerWrapper.prototype.getPlayerWidth = function() { PlayerWrapper.prototype.getPlayerHeight = function() { let height = (getComputedStyle(this.vjsPlayer.el()) || {}).height; - if (!height || parseInt(height, 10) === 0) { + if (!height || parseFloat(height, 10) === 0) { height = (this.vjsPlayer.el().getBoundingClientRect() || {}).height; } - return parseInt(height, 10) || this.vjsPlayer.height(); + return parseFloat(height, 10) || this.vjsPlayer.height(); };