当前位置:网站首页>浏览器中的画中画(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>
边栏推荐
猜你喜欢

pytorch模型微调finetuning训练image_dog(kaggle)

pyspark.ml feature transformation module

活体检测PatchNet学习笔记

Embedding前沿了解

OpenCV中的图像数据格式CV_8U定义

qt:cannot open C:\Users\XX\AppData\Local\Temp\main.obj.15576.16.jom for write

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

DSPE-PEG-Azide DSPE-PED-N3 Phospholipid-Polyethylene Glycol-Azide Lipid PFG

2021年软件测试面试题大全

random.randint函数用法
随机推荐
sql add default constraint
微信小程序源码获取与反编译方式
TransactionTemplate 事务编程式写法
词向量——demo
Data Preprocessing, Feature Engineering, and Feature Learning - Excerpt
Navicat从本地文件中导入sql文件
Introduction to CLS-PEG-FITC Fluorescein-PEG-CLS Cholesterol-PEG-Fluorescein
cocos2d-x implements cross-platform directory traversal
Research reagents Cholesterol-PEG-Maleimide, CLS-PEG-MAL, Cholesterol-PEG-Maleimide
SSH automatic reconnection script
break and continue exit in js
二进制转换成十六进制、位运算、结构体
Pytorch实现ResNet
Tencent Cloud Lightweight Server deletes all firewall rules
np.fliplr与np.flipud
CAS:474922-22-0 Maleimide-PEG-DSPE Phospholipid-Polyethylene Glycol-Maleimide Brief Description
应用usb_cam同时打开多个摄像头方法
VS通过ODBC连接MYSQL(一)
网页截图与反向代理
Cholesterol-PEG-NHS NHS-PEG-CLS cholesterol-polyethylene glycol-active ester can modify small molecular materials