-
Notifications
You must be signed in to change notification settings - Fork 0
/
highlight.html
231 lines (206 loc) · 6.27 KB
/
highlight.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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>IPL 2024 Highlight</title>
<link rel="icon" type="image/svg+xml" href="https://wallpaperaccess.in/public/uploads/preview/tata-ipl-2022-logo-png-images-z.png">
<style>
@font-face {
font-family: "Uni Sans Heavy";
src: url("https://fonts.googleapis.com/css2?family=Uni+Sans+Heavy&display=swap");
}
body {
font-family: "Uni Sans Heavy", Arial, sans-serif;
margin: 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
min-height: 100vh;
background-color: #36393f;
color: #fff;
}
h1 {
margin-bottom: 20px;
}
footer {
display: flex;
justify-content: center;
align-items: center;
height: 80px;
background-color: transparent;
width: 100%;
}
.share-container {
display: flex;
justify-content: center;
align-items: center;
height: 40px;
background-color: #333;
width: 100%;
margin-top: 20px;
}
.share-container a {
text-decoration: none;
color: #fff;
font-size: 20px;
padding: 0 10px;
}
.share-container a:hover {
text-decoration: underline;
}
.share-container img {
height: 20px;
width: 20px;
}
.social-media-icons {
display: flex;
justify-content: center;
align-items: center;
gap: 10px;
}
.social-media-icons a {
text-decoration: none;
color: #fff;
}
.social-media-icons a:hover {
text-decoration: underline;
}
.social-media-icons img {
height: 32px;
width: 32px;
}
#language-select, .button-container {
display: flex;
align-items: center;
justify-content: center;
width: 40%;
margin-bottom: 5px;
}
#language-select {
padding: 10px;
font-size: 16px;
border: none;
background-color: #7289da;
color: #fff;
border-radius: 20px;
margin-right: 10px;
}
.stream-container {
display: flex;
flex-direction: column;
align-items: center;
width: 640px;
height: 459px;
margin: 0 auto;
overflow: hidden;
}
.button-container {
display: flex;
justify-content: center;
width: 500px;
align-items: center;
}
button {
padding: 10px 20px;
font-size: 16px;
border: none;
cursor: pointer;
background-color: #7289da;
color: #fff;
border-radius: 20px;
margin: 2px;
}
video {
width: 100%;
height: 100%;
border-radius: 10px;
box-shadow: rgba(0, 0, 0, 0.25) 0px 14px 28px, rgba(0, 0, 0, 0.22) 0px 10px 10px;
}
</style>
</head>
<body>
<h1>Live Cricket Stream</h1>
<div class="stream-container">
<select id="language-select"></select>
<div class="button-container">
<button id="play-button">Play</button>
<button id="fullscreen-button">Full Screen</button>
<button id="open-vlc">Open With VLC</button>
</div>
<iframe src="https://manifest.prod.boltdns.net/manifest/v1/hls/v4/aes128/3588749423001/4c11cc3b-7c7a-4cbc-9f6d-137d50a50fad/10s/master.m3u8?fastly_token=NjY0MGJhZjFfN2Y5ZmU3ZThkNzcxN2I0OTg5N2M1OWEyMTU2ZjkyNTU1NjY4NzNlOTExMmZlYWNjOGIxYzhhMTgwNDQxMTllOA%3D%3D"
width="640"
height="360"
frameborder="0"
allowfullscreen>
</iframe>
</div>
<script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script>
<script>
document.addEventListener("DOMContentLoaded", async function() {
const response = await fetch("m3u8.json");
const data = await response.json();
const languageSelect = document.getElementById("language-select");
data.streams.forEach(stream => {
const option = document.createElement("option");
option.value = stream.url;
option.textContent = stream.language;
languageSelect.appendChild(option);
});
const videoElement = document.getElementById("stream-video");
const playButton = document.getElementById("play-button");
const fullscreenButton = document.getElementById("fullscreen-button");
const vlcButton = document.getElementById("open-vlc");
let isPlaying = false;
let currentStreamUrl = languageSelect.value;
loadAndPlayStream(currentStreamUrl);
function loadAndPlayStream(streamUrl) {
if (Hls.isSupported()) {
const hls = new Hls();
hls.loadSource(streamUrl);
hls.attachMedia(videoElement);
hls.on(Hls.Events.MANIFEST_PARSED, function() {
videoElement.play();
isPlaying = true;
playButton.textContent = "Pause";
});
} else {
alert("HLS is not supported by your browser.");
}
}
playButton.addEventListener("click", () => {
if (!isPlaying) {
loadAndPlayStream(currentStreamUrl);
} else {
videoElement.pause();
isPlaying = false;
playButton.textContent = "Play";
}
});
fullscreenButton.addEventListener("click", () => {
if (videoElement.requestFullscreen) {
videoElement.requestFullscreen();
} else if (videoElement.webkitRequestFullscreen) {
videoElement.webkitRequestFullscreen();
}
});
vlcButton.addEventListener("click", () => {
var vlcUrl = 'vlc://'+ languageSelect.value;
window.location.href = vlcUrl;
});
languageSelect.addEventListener("change", () => {
currentStreamUrl = languageSelect.value;
loadAndPlayStream(currentStreamUrl);
});
});
</script>
</body>
<footer>
<div class="social-media-icons">
<a href="https://www.github.com/yubrajpandeya" target="_blank"><img src="https://www.svgrepo.com/show/331408/github.svg" alt="Github"></a>
<a href="https://www.instagram.com/yubrajpandeya02" target="_blank"><img src="https://www.svgrepo.com/show/331440/instagram.svg" alt="Instagram"></a>
<a href="https://www.linkedin.com/yubrajpandeya" target="_blank"><img src="https://www.svgrepo.com/show/331463/linkedin.svg" alt="LinkedIn"></a>
</div>
</footer>
</html>