Update '12/player.js'

master
barkaiavital 5 years ago
parent 97f80713bb
commit 893b0cbc5a

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

Loading…
Cancel
Save