How can I make HTML 5 video playback fit to frame instead of maintaining aspect ratio?

后端 未结 6 1649
渐次进展
渐次进展 2021-02-03 11:14

I\'ve been experimenting with HTML5 video playback. For example I have this video object embedded on my page:

6条回答
  •  执念已碎
    2021-02-03 11:55

    There is currently no way of doing this, but with the CCS3 image-fit property it will become possible. No browser supports it yet, though. Then you could use this to make all videos stretch to width/height:

    video {
      image-fit: fill;
    }
    

    See spec at http://dev.w3.org/csswg/css3-page/#propdef-image-fit

提交回复
热议问题