一篇汇总video事件的文章,方便查阅:
https://blog.csdn.net/xuehu837769474/article/details/107532487
html部分
<div class="content">
<video
width="1416"
height="828"
:poster="paramsdata.imgUrl"
controls="controls"
@loadstart="isactive = true" //开始获取数据
@play="isactive = false"//开始播放前
@pause="isactive = true"//播放暂停
@ended="isactive = false"//播放结束后停止播放
>
>
<source :src="paramsdata.video" type="video/mp4" />
</video>
<img :src="startImg" alt="" v-show="isactive" class="staticImg" />//图片
<span class="totalTime" v-show="isactive">{{
paramsdata.totalTime
}}</span>
</div>
csscss用定位把图片放中间
.staticImg {
width: 122px;
height: 122px;
position: absolute;
top: calc(50% - 61px);
left: calc(50% - 61px);
cursor: pointer;
}
标签:vue,61px,50%,html,video,calc
From: https://www.cnblogs.com/xuelinomen/p/16715978.html