yemin_player/index.html

59 lines
1.5 KiB
HTML
Raw Normal View History

2022-02-02 23:48:30 +03:00
<!doctype html>
2022-02-27 10:59:47 +03:00
<html lang="ru">
2022-02-02 23:48:30 +03:00
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
2022-02-23 20:21:32 +03:00
<meta name="viewport" content="width=device-width, initial-scale=1">
2022-02-02 23:48:30 +03:00
<title>Клятва - 2 сезон</title>
2022-02-27 11:21:35 +03:00
<link rel="shortcut icon" href="favicon.ico">
2022-02-27 11:19:00 +03:00
<link href="styles.css" rel="stylesheet">
2022-02-02 23:48:30 +03:00
</head>
<body>
<header>
<p class="title">Специально для мамы с любовью &#9829;</p>
</header>
<div class="container">
2022-03-21 20:10:58 +03:00
<div class="section-episodes">
2022-02-27 10:59:47 +03:00
<div class="episodes">
<ul id="episodeList"></ul>
</div>
2022-03-21 20:10:58 +03:00
</div>
2022-02-02 23:48:30 +03:00
2022-03-21 20:10:58 +03:00
<div class="section-video">
2022-02-02 23:48:30 +03:00
<video id="video" controls>
</video>
2022-03-21 20:10:58 +03:00
</div>
2022-02-02 23:48:30 +03:00
</div>
2022-02-27 10:59:47 +03:00
<script>
2022-02-02 23:48:30 +03:00
'use strict';
2022-03-21 20:10:58 +03:00
let episodesList = [177, 178]; /* episodes number list */
2022-02-02 23:48:30 +03:00
window.onload = function() {
let episodeListElement = document.getElementById('episodeList');
episodesList.forEach(item => {
let episodeItem = document.createElement('li');
episodeItem.setAttribute('onclick', `changeEpisode("${item}");`);
episodeItem.innerText = item;
episodeListElement.appendChild(episodeItem);
});
2022-02-23 21:06:52 +03:00
changeEpisode(episodesList[0]);
2022-02-02 23:48:30 +03:00
}
function changeEpisode(episodeId) {
let videoElement = document.getElementById('video');
videoElement.textContent = '';
let videoSource = document.createElement('source');
2022-03-21 20:10:58 +03:00
videoSource.setAttribute('src', `https://a2s.su/y/ep/${episodeId}.mp4`);
videoSource.setAttribute('type', 'video/mp4');
videoElement.appendChild(videoSource);
2022-02-02 23:48:30 +03:00
videoElement.load();
}
</script>
</body>
</html>