【发布时间】:2019-02-26 10:33:22
【问题描述】:
我已将两个视频上传到数据库并显示在我的网站上。我试图使它们具有相同的形状和高度。宽度很好,但其中一个形状像正方形,高度较长,而另一个是矩形,高度较短,我知道这是因为视频拍摄的方式,一个是垂直拍摄的,另一个是水平拍摄的。如何使它们具有相同的形状和高度。你能帮帮我吗?
I tried this
<video class="video1" id="cb" preload="auto" video="src="{{$proo->video}}#t=1"" style=" height:80%; max-height:20em; width:100%; max-width:20em; object-fit: cover;
float:left; clear:both;
padding-left:2%; margin-top:0px; cursor:pointer; "><source="video1.jpg" playsinline alt="Video Unavailable" id="" ></source>
</video>
this the javascript part to handle the onclick,onmouseleave
$(document).on('mouseover touchstart', 'video', function() {
$(this).get(0).play();
this.muted=true;
});
//pause video on mouse leave
$(document).on('mouseleave', 'video', function() {
this.currentTime = 1;
$(this).get(0).pause();
});
$(document).on('click touchstart', 'video', function() {
$(this).get(0).play();
this.muted=false;
this.currentTime = 0;
});
【问题讨论】:
标签: php html css laravel html5-video