当前位置:网站首页>浏览器中的画中画(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>
边栏推荐
- unicloud cloud development record
- 禅道安装及使用教程
- Jupyter内核正忙、内核挂掉
- Chinese garbled solution in UTF-8 environment in Powershell
- Sqlite column A data is copied to column B
- 拒绝采样小记
- pytorch模型微调finetuning训练image_dog(kaggle)
- ERROR Error: No module factory availabl at Object.PROJECT_CONFIG_JSON_NOT_VALID_OR_NOT_EXIST ‘Error
- This in js points to the prototype object
- wangeditor编辑器内容传至后台服务器存储
猜你喜欢

DSPE-PEG-Thiol DSPE-PEG-SH 磷脂-聚乙二醇-巯基脂质体制备用

Cholesterol-PEG-Acid CLS-PEG-COOH 胆固醇-聚乙二醇-羧基修饰肽类化合物

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

VS connects to MYSQL through ODBC (2)

This in js points to the prototype object

WeChat applet source code acquisition and decompilation method

PyTorch学习笔记08——加载数据集

CAS:1403744-37-5 DSPE-PEG-FA 科研实验用磷脂-聚乙二醇-叶酸

Sourcery插件(自动提升代码质量)

CAS: 1403744-37-5 DSPE-PEG-FA Phospholipid-Polyethylene Glycol-Folic Acid for Scientific Research
随机推荐
VS通过ODBC连接MYSQL(一)
Flutter mixed development module dependencies
pyspark.ml特征变换模块
Cholesterol-PEG-Thiol CLS-PEG-SH 胆固醇-聚乙二醇-巯基
Xiaomi mobile phone SMS location service activation failed
DSPE-PEG-Azide DSPE-PED-N3 磷脂-聚乙二醇-叠氮脂质PFG
二进制转换成十六进制、位运算、结构体
Introduction to CLS-PEG-FITC Fluorescein-PEG-CLS Cholesterol-PEG-Fluorescein
ERROR Error: No module factory availabl at Object.PROJECT_CONFIG_JSON_NOT_VALID_OR_NOT_EXIST ‘Error
DSPE-PEG-Thiol DSPE-PEG-SH 磷脂-聚乙二醇-巯基脂质体制备用
A simple bash to powershell case
MySQL 入门:Case 语句很好用
Tensorflow——demo
Shell/Vim相关list
QT VS中双击ui文件无法打开的问题
MySQL 出现 The table is full 的解决方法
MySQL 免安装版的下载与配置教程
unicloud 云开发记录
活体检测PatchNet学习笔记
ROS 之订阅多个topic时间同步问题