make video responsive to container

This commit is contained in:
sawka 2024-03-14 10:11:48 -07:00
parent e6c41788f5
commit 395a315068
2 changed files with 10 additions and 3 deletions

View File

@ -4,4 +4,11 @@
align-items: center;
justify-content: center;
padding-top: var(--termpad);
video {
object-fit: contain;
object-position: center;
height: 100%;
width: auto;
}
}

View File

@ -46,10 +46,10 @@ class SimpleMediaRenderer extends React.Component<
let fullVideoUrl = GlobalModel.getBaseHostPort() + fileUrl;
const opts = this.props.opts;
const height = opts.idealSize.height - 10;
const width = opts.idealSize.width - 10;
const width = opts.maxSize.width - 10;
return (
<div className="media-renderer">
<video width={width} height={height} controls>
<div className="media-renderer" style={{ height: height, width: width }}>
<video controls>
<source src={fullVideoUrl} />
</video>
</div>