html5 video 自动拉伸,HTML 5视频拉伸

the spec for :

Video content should be rendered inside the element’s playback area such that the video content is shown centered in the playback area at the largest possible size that fits completely within it, with the video content’s aspect ratio being preserved. Thus, if the aspect ratio of the playback area does not match the aspect ratio of the video, the video will be shown letterboxed or pillarboxed. Areas of the element’s playback area that do not contain the video represent nothing.

没有规定拉伸视频,而不是letterboxing它。这可能是因为拉伸给出了非常糟糕的用户体验,并且大多数时间不是预期的。默认情况下,图像会拉伸到合适的大小,因此,您会看到许多在线严重扭曲的图像,最有可能是由于指定高度和宽度的错误。

您可以使用CSS 3 transforms实现拉伸效果,虽然那些没有完全标准化或在所有浏览器中实现,以及实现它的那些,您需要使用供应商前缀,如-webkit-或-moz-。这里有一个例子:

video {

-webkit-transform: scaleX(2);

-moz-transform: scaleX(2);

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值