googleads / videojs-ima

IMA SDK Plugin for Video.js
Apache License 2.0
450 stars 284 forks source link

Player width/height rounding bug causes sizing and UI issues on responsive layouts #819

Closed minasaywhat closed 5 years ago

minasaywhat commented 5 years ago

The videojs-ima plugin uses parseInt to grab the dimensions to pass to the IMA SDK. When using responsive CSS, setting sizes on a percentage bases, results in dimensions being rounded down to the nearest whole number, while the IMA SDK rounds dimensions up to the nearest whole number. The plugin would benefit from getting the player dimensions in a way that doesn't chop off the decimal places for percent-based CSS. Based on testing, parseFloat appears to work better.

This presents a UI/UX issue for our audiences, and our advertisers are asking us to fix the 1 pixel line that appears around the player before campaigns go live.

Is it possible to modify the videojs-ima to use parseFloat instead of parseInt to grab player size dimensions?

See screenshots below for reference. Thank you.

glimmer-div-container-width-height

google-imasdk-div-container-width-height

imasdk-ad-resizing-issue

arnaudcasame commented 5 years ago

Hi,

I identified the code that sets the width and height of the IMA SDK iframe through the videojs-ima plugin, it's indeed using the parseInt function to set the values. I'll share your insights with the rest of the team and I'll get back to you once I have more information.

minasaywhat commented 5 years ago

Thank you for the fix on this!