当前位置:网站首页>浏览器中的画中画(Picture-in-Picture)API
浏览器中的画中画(Picture-in-Picture)API
2022-07-31 05:17:00 【Forevermoremo】
画中画的应用随处可见啊,淘宝的直播界面悬浮窗口,哔哩哔哩视频以及豆瓣视频等都有使用到。
<body>
<video controls autoplay loop muted id="video" src="./video.mp4" poster="./poster.png"></video>
<div>
<button id="enter">进入画中画</button>
<button id="exit">退出画中画</button>
<span id="tips"></span>
</div>
<script>
const video = document.getElementById('video');
const enter = document.getElementById('enter');
const exit = document.getElementById('exit');
const tips = document.getElementById('tips');
// 进入画中画
enter.addEventListener('click', (event) => {
video.requestPictureInPicture().catch(error => {
console.log(error);
});
});
// 退出画中画
exit.addEventListener('click', (event) => {
document.exitPictureInPicture().catch(error => {
console.log(error);
});
});
</script>
</body>
边栏推荐
猜你喜欢

CNN的一点理解

softmax函数详解

After unicloud is released, the applet prompts that the connection to the local debugging service failed. Please check whether the client and the host are under the same local area network.

jenkins +miniprogram-ci 一键上传微信小程序

wangeditor富文本编辑器上传图片以及跨域问题解决

VS2017 connects to MYSQL

CAS: 1403744-37-5 DSPE-PEG-FA Phospholipid-Polyethylene Glycol-Folic Acid for Scientific Research

Gradle sync failed: Uninitialized object exists on backward branch 142

2022年SQL大厂高频实战面试题(详细解析)

CAS:474922-22-0 Maleimide-PEG-DSPE 磷脂-聚乙二醇-马来酰亚胺简述
随机推荐
Pytorch常用函数
Navicat从本地文件中导入sql文件
break and continue exit in js
Shell/Vim related list
浅谈对分布式模式下CAP的理解
CNN的一点理解
VS connects to MYSQL through ODBC (2)
MYSQL transaction and lock problem handling
Tencent Cloud Lightweight Server deletes all firewall rules
Cholesterol-PEG-Acid CLS-PEG-COOH Cholesterol-Polyethylene Glycol-Carboxyl Modified Peptides
DSPE-PEG-Azide DSPE-PED-N3 磷脂-聚乙二醇-叠氮脂质PFG
VS connects to MYSQL through ODBC (1)
cv2.resize()是反的
我的训练函数模板(动态修改学习率、参数初始化、优化器选择)
Cholesterol-PEG-Thiol CLS-PEG-SH 胆固醇-聚乙二醇-巯基
Notes on creating a new virtual machine in Hyper-V
MySQL 免安装版的下载与配置教程
wangeditor富文本编辑器上传图片以及跨域问题解决
OpenCV中的图像数据格式CV_8U定义
Tencent Cloud GPU Desktop Server Driver Installation