62 lines
1.5 KiB
HTML
62 lines
1.5 KiB
HTML
<!doctype html>
|
||
<html>
|
||
<head>
|
||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||
<title>Клятва - 2 сезон</title>
|
||
</head>
|
||
<body>
|
||
<header>
|
||
<p class="title">Специально для мамы с любовью ♥</p>
|
||
</header>
|
||
|
||
<div class="container">
|
||
<nav>
|
||
<p>Выбери серию =)</p>
|
||
<ul id="episodeList"></ul>
|
||
</nav>
|
||
|
||
<hr>
|
||
|
||
<div class="video">
|
||
<p id="episodeName"> </p>
|
||
<video id="video" controls>
|
||
</video>
|
||
</div>
|
||
</div>
|
||
|
||
<script type="text/javascript">
|
||
'use strict';
|
||
|
||
let episodesList = [177, 178]; // example
|
||
|
||
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);
|
||
});
|
||
|
||
changeEpisode(episodesList[0]);
|
||
}
|
||
|
||
function changeEpisode(episodeId) {
|
||
let episodeName = document.getElementById('episodeName');
|
||
let videoElement = document.getElementById('video');
|
||
|
||
episodeName.innerText = `${episodeId} серия`;
|
||
|
||
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);
|
||
videoElement.load();
|
||
}
|
||
</script>
|
||
</body>
|
||
</html>
|