npm i -S flv.js
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title> flvjs Demo</title>
</head>
<body>
<video id="videoElement" class="video-js" controls muted autoplay>
</video>
<script src="https://cdn.bootcdn.net/ajax/libs/flv.js/1.6.2/flv.js"></script>
<script>
if (flvjs.isSupported()) {
var videoElement = document.getElementById('videoElement');
var flvPlayer = flvjs.createPlayer({
type: 'flv',
url: 'https://rivermap-file.oss-cn-hangzhou.aliyuncs.com/video/flv/test.flv'
});
flvPlayer.attachMediaElement(videoElement);
flvPlayer.load();
flvPlayer.play();
}
</script>
</body>
</html>
