video标签在移动端的默认显示为空白,需要手动添加默认图片。
video的poster属性可以为标签添加默认图片
例
data.video_list.forEach(item=>{
var html = '<video poster="/static/img/videoDefault.png" controls src='+item+'></video>';
// var html = '<video poster='+item+"?vframe/jpg/offset/1"+' controls src='+item+'></video>';
$('.video_list').append(html);
})
以上方法可以获取视频的第一帧为图片 ?vframe/jpg/offset/1