支持flv视频预览

This commit is contained in:
陈精华
2019-05-16 17:46:08 +08:00
committed by kl
parent 3f40b60c64
commit 41d9015023
3 changed files with 43 additions and 0 deletions

View File

@ -0,0 +1,30 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>多媒体文件预览</title>
</head>
<style>
body{background-color: #262626}
.m{ margin-left: auto; margin-right: auto; width:1024px; margin-top: 100px; }
</style>
<body>
<div class="m">
<video width="1024" id="videoElement"></video>
</div>
<script src="js/flv.min.js"></script>
<script>
if (flvjs.isSupported()) {
var videoElement = document.getElementById('videoElement');
var flvPlayer = flvjs.createPlayer({
type: 'flv',
url: '${mediaUrl}'
});
flvPlayer.attachMediaElement(videoElement);
flvPlayer.load();
flvPlayer.play();
}
</script>
</body>
</html>