// получаем все элементы
var videoEl = document.getElementsByTagName('video')[0],
playBtn = document.getElementById('playBtn'),
vidControls = document.getElementById('controls'),
volumeControl = document.getElementById('volume'),
timePicker = document.getElementById('timer');
// если браузер может воспроизводить видео удаляем класс
videoEl.addEventListener('canplaythrough', function () {
vidControls.classList.remove('hidden');
videoEl.volume = volumeControl.value;
}, false);
// запускам или останавливаем воспроизведение
playBtn.addEventListener('click', function () {
if (videoEl.paused) {
videoEl.play();
} else {
videoEl.pause();
}
}, false);
videoEl.addEventListener('play', function () {
playBtn.innerText = "Pause";
}, false);
videoEl.addEventListener('pause', function () {
playBtn.innerText = "Play";
}, false);
volumeControl.addEventListener('input', function () {
videoEl.volume = volumeControl.value;
}, false);
videoEl.addEventListener('ended', function () {
videoEl.currentTime = 0;
}, false);
videoEl.addEventListener('timeupdate', function () {
timePicker.innerHTML = secondsToTime(videoEl.currentTime);
}, false);
// рассчет отображаемого времени
function secondsToTime(time){
var h = Math.floor(time / (60 * 60)),
dm = time % (60 * 60),
m = Math.floor(dm / 60),
ds = dm % 60,
s = Math.ceil(ds);
if (s === 60) {
s = 0;
m = m + 1;
}
if (s < 10) {
s = '0' + s;
}
if (m === 60) {
m = 0;
h = h + 1;
}
if (m < 10) {
m = '0' + m;
}
if (h === 0) {
fulltime = m + ':' + s;
} else {
fulltime = h + ':' + m + ':' + s;
}
return fulltime;
}
$login = filter_var(trim($_POST['login']), FILTER_SANITIZE_STRING)
$name = filter_var(trim($_POST['name']), FILTER_SANITIZE_STRING)
$pass = filter_var(trim($_POST['pass']), FILTER_SANITIZE_STRING)
;
} else if(mb_strlen($name) < 3 mb_strlen($name) > 12){
&&
} else if(mb_strlen($name) < 3 && mb_strlen($name) > 12){
$mysql = new mysqli('***', '***', '***', '***')
var obj = {
"MapName": "Adeyyo",
"JDVersion": 2019,
"OriginalJDVersion": 2019,
"Artist": "Ece Seçkin",
"Title": "Adeyyo",
"Credits": "Written by Aysen Şimşekyay, Kemal Şimşekyay and arranged by Ozan Doğulu. Published by DMC & PRM. Courtesy of DGL. All rights of the producer and other rightholders to the recorded work reserved. Unless otherwise authorized, the duplication, rental, loan, exchange or use of this video game for public performance, broadcasting and online distribution to the public are prohibited.",
"NumCoach": 1,
"BannerVideo": 0,
"CoachBeat": 1210,
"OnlineMap": 0,
"Tags": [
"main"
],
"PictogramBar": 1,
"PictoDuration": 3000,
"BeatDuration": 3000,
"LyricDuration": 1750,
"PictoResolutionX": 256,
"PictoResolutionY": 256,
"PictoResolutionUHD": 0,
"VideoType": "mp4",
"AudioType": "ogg",
"LyricColors": [111, 255, 182],
"LyricSpeed": 100,
"goldmoves": [166105, 226105],
"Difficulty": 1,
"DefaultColors": {
"lyrics": "0xFF6FFFB6",
"theme": "0xFFFFFFFF",
"songColor_1A": "0xFF010342",
"songColor_1B": "0xFF411554",
"songColor_2A": "0xFF97FAFC",
"songColor_2B": "0xFF11B7C6"
}
}
var value = 0;
for (let key in obj) {
if (key === "LyricDuration") value += obj[key]
}
// value === 1750
element.animate(
[
{ transform: 'scale(1.25)', opacity: 1},
{ transform: 'scale(1)', opacity: 1, offset: 0.25 },
{ transform: 'scale(1.05)', opacity: 1, offset: 0.3},
{ transform: 'scale(0.85)', opacity: 0}
],
2000
);
var audio = new Audio();
audio.src = "http://mus.com/song.mp3";
audio.play();
var lirycs = [{
"time": 5444,
"duration": 121,
"text": "Top ",
"isLineEnding": 0
},
{
"time": 6000,
"duration": 121,
"text": "Top2 ",
"isLineEnding": 0
}];
var next_text = lirycs.shift();
var checker = setInterval(function(){
if(next_text.time<audio.currentTime*1000){
console.log(next_text.text);
next_text = lirycs.shift();
}
if(audio.ended)clearInterval(checker);
});