当前位置:网站首页>浏览器中的画中画(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>
边栏推荐
- RuntimeError: CUDA error: no kernel image is available for execution on the device问题记录
- Pytorch常用函数
- Nmap的下载与安装
- SSH automatic reconnection script
- MySQL 出现 The table is full 的解决方法
- np.fliplr与np.flipud
- Pytorch学习笔记13——Basic_RNN
- Notes on creating a new virtual machine in Hyper-V
- 拒绝采样小记
- Embedding cutting-edge understanding
猜你喜欢

unicloud 发布后小程序提示连接本地调试服务失败,请检查客户端是否和主机在同一局域网下

Pytorch每日一练——预测泰坦尼克号船上的生存乘客

JS写一段代码,判断一个字符串中出现次数最多的字符串,并统计出现的次数JS

Understanding of js arrays

MySQL 主从切换步骤

Fluorescein-PEG-DSPE Phospholipid-Polyethylene Glycol-Fluorescein Fluorescent Phospholipid PEG Derivatives

MW:3400 4-Arm PEG-DSPE 四臂-聚乙二醇-磷脂一种饱和的18碳磷脂

活体检测CDCN学习笔记

Multi-Modal Face Anti-Spoofing Based on Central Difference Networks学习笔记

二进制转换成十六进制、位运算、结构体
随机推荐
Research reagents Cholesterol-PEG-Maleimide, CLS-PEG-MAL, Cholesterol-PEG-Maleimide
PyTorch学习笔记08——加载数据集
360 hardening file path not exists.
Numpy常用函数
活体检测CDCN学习笔记
VS connects to MYSQL through ODBC (2)
Natural language processing related list
多元线性回归方程原理及其推导
Tencent Cloud GPU Desktop Server Driver Installation
unicloud 云开发记录
A simple bash to powershell case
CAS:474922-22-0 Maleimide-PEG-DSPE 磷脂-聚乙二醇-马来酰亚胺简述
cv2.resize()是反的
MySQL 出现 The table is full 的解决方法
Web Screenshots and Reverse Proxy
CNN的一点理解
我的训练函数模板(动态修改学习率、参数初始化、优化器选择)
Principle analysis of famous website msdn.itellyou.cn
Tensorflow——演示
flutter arr dependencies