|
[mw_shl_code=html,true]<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>本地视频播放</title>
<style>
html, body {
height: 100%;
margin: 0;
display: flex;
align-items: center;
justify-content: center;
}
#videoContainer {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
#videoPlayer {
max-width: 100%;
max-height: 100%;
}
</style>
</head>
<body>
<div id="videoContainer">
<input type="file" id="videoFile" accept="video/*">
<div>
<video id="videoPlayer" controls></video>
</div>
</div>
<script>
const videoFileInput = document.getElementById('videoFile');
const videoPlayer = document.getElementById('videoPlayer');
videoFileInput.addEventListener('change', function() {
const file = this.files[0];
const videoURL = URL.createObjectURL(file);
videoPlayer.src = videoURL;
});
</script>
</body>
</html>[/mw_shl_code]
|
盘基地论坛免责声明
1、本站资源来自互联网用户收集发布,仅供用于学习和交流。
2、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。
3、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决。
4、联系邮箱:admin@panjdzy.com
5、官方网址:www.panjdzy.com
6、备用网址:www.panjd.top
上一篇:Java面试题下一篇:Java基础,数组排序
|