plyr音视频播放插件使用示例

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8" />

<title>plyr demo</title>

<script src="https://cdn.plyr.io/3.6.12/plyr.js"></script>
<link rel="stylesheet" href="https://cdn.plyr.io/3.6.12/plyr.css" />

</head>

<body>

<script>
window.onload = function(){
const player = new Plyr('#player');
player.volume=0; //静音允许自动播放
player.play();
//player.volume=0.5; //手动设置音量
}

</script>

<video id="player" controls > <!-- playsinline data-poster="/path/to/poster.jpg" -->

<source src="D:/mv/孤勇者.mp4" type="video/mp4" />

<!-- <source src="/path/to/video.webm" type="video/webm" /> -->

<!-- Captions are optional -->

<!-- <track kind="captions" label="English captions" src="/path/to/captions.vtt" srclang="en" default /> -->

</video>

</body>

</html>

参考文档

https://mp.weixin.qq.com/s/ctEgJ8u7eh3wi8jMAy5rJw