Update '12/player2.js'

master
barkaiavital 5 years ago
parent 31f0f302f9
commit 920d308361

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

Loading…
Cancel
Save