-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvideo.html
95 lines (93 loc) · 2.2 KB
/
video.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>微观中国Vue前端视频教学</title>
</head>
<body>
<div class="video-container">
<video id="video" width="1000" height="700" src="./video/video1.mp4" controls="controls"></video>
<div class="nav-bar">
<span class="choose">选集</span>
<ul>
<li id="video1" onclick="changeVideo(this)">01.微观中国Vue前端复现</li>
<li id="video2" onclick="changeVideo(this)">02.微观中国Vue前端复现</li>
<li id="video3" onclick="changeVideo(this)">03.微观中国Vue前端复现</li>
<li id="video4" onclick="changeVideo(this)">04.微观中国Vue前端复现</li>
</ul>
</div>
</div>
</body>
<script>
function changeVideo(obj){
let idName = obj.id
let videoRef = document.getElementById("video")
console.log(videoRef);
if(idName == 'video1'){
videoRef.src = "./video/video1.mp4"
}
if(idName == 'video2'){
videoRef.src = "./video/video2.mp4"
}
if(idName == 'video3'){
videoRef.src = "./video/video3.mp4"
}
if(idName == 'video4'){
videoRef.src = "./video/video4.mp4"
}
}
</script>
<style>
*{
margin: 0;
padding: 0;
}
.video-container{
position: absolute;
display: flex;
align-items: center;
width: 100%;
height: 100vh;
background-color: #333;
}
.nav-bar{
position: absolute;
right: 0;
top: 0;
bottom: 0;
width: 20%;
background-color: white;
display: flex;
flex-flow: column;
align-items: center;
padding-top: 20px;
}
#video{
width: 80%;
}
.choose{
height: 50px;
font-size: larger;
font-weight: 1000;
letter-spacing: 5px;
font-family: 'SIMSUN';
}
li{
list-style-type: none;
width: 250px;
height: 50px;
background-color: #f1f3f4;
text-align: center;
letter-spacing: 2px;
line-height: 50px;
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
li:hover{
background-color: #dee1e6;
color: #0079ce;
cursor: pointer;
}
</style>
</html>