MetaCDN / videojs-vr_OLD

A video.js plugin that turns a video element into a HTML5 Panoramic 360 video player.
MIT License
24 stars 16 forks source link

Fix dimensions and ratio calculations for non full window player #33

Closed bplaa-yai closed 7 years ago

bplaa-yai commented 7 years ago

The setup and resizing code assumes that the player is using the full browser window by using window.inner dimensions. This PR uses the video element's or the canvas' size instead, to make dimensions and ratio calculations correct when the player is not using the full window.

jbroberg commented 7 years ago

We typically use the library in a player that is placed inside an iframe. Will it still work as expected in this mode?

bplaa-yai commented 7 years ago

The iframe case is similar to the full browser player case. I just tested the iframe sample with 2 different aspect ratios and it's working fine. Dynamically changing the iframe size also triggers ratio/size recalculations.