crybapp / web

Main web client for Cryb
MIT License
45 stars 14 forks source link

Fix viewer sizing issue #108

Closed Soliel closed 4 years ago

Soliel commented 4 years ago

For a while we've been contending with an issue (#101) these changes should solve the issue.

It works by choosing which size to prioritize with 100% by picking whichever ratio of boundingHeight/streamHeight is smaller. e.g. If StreamWidth = 1280 StreamHeight = 720 BoundingWidth = 951 BoundingHeight = 351 It will set the style to: max-width: 1280px; max-height: 720px; height: 100%; width: auto;

thus ensuring that the video is responsive to any size changes, and never overflows into other elements, while keeping mouse tracking in sync.