-
Notifications
You must be signed in to change notification settings - Fork 0
/
videoPage.html
122 lines (115 loc) · 3.36 KB
/
videoPage.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<!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>Video Playing Page</title>
<style>
*{
margin:0px;
padding: 0px;
box-sizing: border-box;
}
#navbar{
display: flex;
align-items: center;
/* border: 2px solid red; */
width: 100%;
height:77px;
}
#navbar>img{
display: block;
width: 150px;
height: 100%;
margin-left: 50px;
}
#navbar>input{
height: 33px;
width: 555px;
margin-left: 333px;
padding-left: 11px;
}
#navbar>button{
height: 33px;
width: 77px;
margin-left: 4px;
}
#container{
/* border: 1px solid red; */
width:50%;
height: 700px;
margin: auto;
display: flex;
justify-content: center;
align-items: center;
}
#container>div{
/* border: 1px solid red; */
width: 100%;
}
#container>div>h3{
margin-left: 11px;
}
#container>div>iframe{
/* display: block; */
width: 100%;
height: 555px;
}
#navbar>div{
display: flex;
align-items: center;
margin-left: 160px;
margin-top: -5px;
}
#navbar>div>img{
width: 66px;
height: 55px;
margin-top: 7px;
}
#navbar>div>button{
width: 100px;
height: 33px;
margin-top: 5px;
}
</style>
</head>
<body>
<hr>
<div id="navbar">
<!-- <h1>YouTube</h1> -->
<img onclick="goToHomePage()" src="https://exchange4media.gumlet.io/news-photo/117105-you.png?format=webp&w=610&dpr=1.3" alt="Yt_Logo">
<input type="text" name="searchBox" id="query" placeholder="Search">
<button onclick="searchVideo()">Search</button>
<div>
<img src="https://scai.org/sites/default/files/styles/image_home/public/2020-08/Whats%20new%20icon.jpg?itok=fb-pdXbH" alt="bell-Icon">
<button><a href="">Log-In</a></button>
</div>
</div>
<hr>
<div id="container">
</div>
</body>
</html>
<script>
let dataObj=JSON.parse(localStorage.getItem("videoData"));
let container=document.getElementById("container");
// console.log(dataObj)
let goToHomePage=()=>{
window.location.href="index.html"
}
let playVideo=(data)=>{
console.log(data);
let video_id=data.id;
let video_title=data.name;
let box=document.createElement("div");
let iframe=document.createElement("iframe");
iframe.src=`https://www.youtube.com/embed/${video_id}`;
iframe.allow="fullscreen";
let title=document.createElement("h3");
title.innerText=`${video_title}`;
box.append(iframe,title);
container.append(box);
}
playVideo(dataObj);
</script>