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-02-27 10:59:47 +03:00
<section class="section-episodes">
<div class="episodes">
<ul id="episodeList"></ul>
</div>
</section>
2022-02-02 23:48:30 +03:00
2022-02-27 10:59:47 +03:00
<section class="section-video">
2022-02-02 23:48:30 +03:00
<video id="video" controls>
</video>
2022-02-27 10:59:47 +03:00
</section>
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-02-23 21:06:52 +03:00
let episodesList = [177, 178]; // example
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');
videoSource.setAttribute('src', `https://iiiypuk.me/y/o/${episodeId}.mp4`);
videoSource.setAttribute('type', 'video/mp4');
videoElement.appendChild(videoSource);
2022-02-02 23:48:30 +03:00
videoElement.load();
}
</script>
</body>
</html>