yemin_player/index.html
2022-02-27 11:21:35 +03:00

59 lines
1.5 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!doctype html>
<html lang="ru">
<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>
<link rel="shortcut icon" href="favicon.ico">
<link href="styles.css" rel="stylesheet">
</head>
<body>
<header>
<p class="title">Специально для мамы с любовью &#9829;</p>
</header>
<div class="container">
<section class="section-episodes">
<div class="episodes">
<ul id="episodeList"></ul>
</div>
</section>
<section class="section-video">
<video id="video" controls>
</video>
</section>
</div>
<script>
'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 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);
videoElement.load();
}
</script>
</body>
</html>