The aspect-ratio property can be used to manage the width and height of an element.

Or to create responsive containers that always maintain the configured aspect ratio.

.video {
  width: 100%;
  aspect-ratio: 16/9;
}

Tip found here.