Update '12/player.js'

master
barkaiavital 5 years ago
parent ee9bc5a3a8
commit c00ca2865b

@ -1,14 +1,14 @@
var track_1 = document.querySelector("track_1"), var track_1 = document.querySelector("track_1"),
track_div_1 = document.getElementById("track_1"); track_div_1 = document.getElementById("track_1");
track.addEventListener('cuechange', function () { track.addEventListener('cuechange', function () {
let cues1 = track.track.activeCues; // array of current cues let cues = track.track_1.activeCues; // array of current cues
console.log("cuechange", cues1, cues1[0].text, cues1[0].startTime, cues1[0].endTime); console.log("cuechange", cues, cues[0].text, cues[0].startTime, cues[0].endTime);
var d1 = JSON.parse(cues[0].text); var d1 = JSON.parse(cues[0].text);
console.log("d1",d1); console.log("d1",d1);
track_div_1.innerHTML = d1.title; track_div_1.innerHTML = d1.title;
var old = document.querySelector(".now_playing"); var old_1 = document.querySelector(".now_playing");
if (old) { if (old_1) {
old.classList.remove("now_playing"); old_1.classList.remove("now_playing");
} }
var playing1 = document.getElementById(d.title); var playing1 = document.getElementById(d.title);
playing1.classList.add("now_playing"); playing1.classList.add("now_playing");

Loading…
Cancel
Save