From e500af140708c30b1920d002bb1b5e55fc38a97a Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Sun, 29 Mar 2015 12:47:50 +0300 Subject: [PATCH] Improve player --- player.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/player.js b/player.js index bccc451..b91435e 100644 --- a/player.js +++ b/player.js @@ -41,9 +41,10 @@ window.onload = function () { details = document.getElementById("details"); start = document.getElementById("start_player"); - data = JSON.parse(document.getElementById("json").innerHTML); + data = JSON.parse(document.getElementById("json").textContent); audio.style.display = "none"; audio.addEventListener('ended', play_random); + audio.addEventListener('error', play_random); start.addEventListener('click', play_random); }; -- 2.39.2