<?php
ini_set('error_reporting', E_ALL); // включаем отображение ошибок
ini_set('display_errors', 1); // включаем отображение ошибок
ini_set('display_startup_errors', 1); // включаем отображение ошибок
header('Content-Type: text/html; charset=utf-8'); // назначаем кодировку
p.im {
font-weight: bold;
position: relative;
padding-left: 20px;
}
p.im:before {
content: "\f041";
font-family: FontAwesome;
position: absolute;
top: 0;
left: 0;
}
vlink = document.querySelector('video > source').getAttribute('src'); // Запишет в переменную vlink ссылку на видео
if(!localStorage.getItem(vlink)) {
localStorage.setItem(vlink, '0');
}else{
video.currentTime = localStorage.getItem(vlink);
}
let setVideoTime = function () {
video.volume = 0.1;
setInterval(function () {
let videoTime = video.currentTime;
localStorage.setItem(vlink, videoTime);
}, 1000);
video.addEventListener('pause', function () {
let videoTime = video.currentTime;
localStorage.setItem(vlink, videoTime);
});
}
setVideoTime();