Skip to content

Commit 0d2d48f

Browse files
fix(webrtc): limit max view width to VM width or lower (#15)
Co-authored-by: Matt Marangoni <[email protected]> Co-authored-by: Catherine Jue <[email protected]>
1 parent 7974514 commit 0d2d48f

File tree

1 file changed

+2
-1
lines changed
  • unikernels/unikraft-cu/client/src/components

1 file changed

+2
-1
lines changed

unikernels/unikraft-cu/client/src/components/video.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,8 @@
815815
const { offsetWidth, offsetHeight } = !this.fullscreen ? this._component : document.body
816816
this._player.style.width = `${offsetWidth}px`
817817
this._player.style.height = `${offsetHeight}px`
818-
this._container.style.maxWidth = `${(this.horizontal / this.vertical) * offsetHeight}px`
818+
const aspectPreservingMaxWidth = (this.horizontal / this.vertical) * offsetHeight
819+
this._container.style.maxWidth = `${!this.fullscreen ? Math.min(this.width, aspectPreservingMaxWidth) : aspectPreservingMaxWidth}px`
819820
this._aspect.style.paddingBottom = `${(this.vertical / this.horizontal) * 100}%`
820821
}
821822

0 commit comments

Comments
 (0)