<div class="taro-pcr-bg">
<video muted loop autoplay>
<source src="/static/pcr/mp4/{{ pcr.UUID }}.mp4" type="video/mp4"/>
</video>
<img src="" id="taro-pcr-video-poster" alt="">
</div>
.taro-pcr-bg {
pointer-events: none;
video, img {
display: none;
width: 100vw;
height: 100vh;
object-fit: cover;
pointer-events: none;
}
}
const video = document.querySelector("video");
const poster = document.getElementById("taro-pcr-video-poster");
video.onloadeddata = async () => {
const frameObj = await getVideoFrame(video);
poster.src= frameObj.url;
poster.style.display = "block";
};
// 获取视频帧
const drawVideo = (video) => {
return new Promise((resolve) => {
const cvs = document.createElement("canvas");
const ctx = cvs.getContext("2d");
cvs.width = video.videoWidth;
cvs.height = video.videoHeight;
ctx.drawImage(video, 0, 0, cvs.width, cvs.height);
cvs.toBlob((blob) => {
resolve({
blob,
url: URL.createObjectURL(blob),
});
});
});
};
video.oncanplay = () => {
if (window.innerWidth > 1080) {
video.style.display = "block";
} else {
video.pause();
video.remove();
}
};
此页面不支持夜间模式!
已进入夜间模式!
已进入普通模式!
搜索框不允许为空
签到成功!经验+5!芋圆币+2!
签到失败!今日已签到!
需要登录社区账号才可以进入!