From f5e83ce1cfba86c503d33f97f905b05549e85b41 Mon Sep 17 00:00:00 2001 From: BrokenFire Date: Mon, 8 Jan 2018 10:46:24 +0100 Subject: [PATCH] Adding duration on web page --- src/main/resources/static/js/init.js | 5 +++++ src/main/resources/templates/music.html | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/resources/static/js/init.js b/src/main/resources/static/js/init.js index 5423536..9e39df9 100644 --- a/src/main/resources/static/js/init.js +++ b/src/main/resources/static/js/init.js @@ -122,6 +122,8 @@ function getCurentMusic() { } $('#music_img').attr("src","/img/no_music.jpg"); + $('#total_time').text("00:00"); + $('#current_time').text("00:00"); break; @@ -258,6 +260,9 @@ function updateControl(data){ } $('#music_img').attr("src","https://img.youtube.com/vi/"+data.info.identifier+"/hqdefault.jpg"); + console.log(data); + $('#total_time').text(msToTime(data.info.length)); + $('#current_time').text(msToTime(data.currentPos)); updateModal(data); } diff --git a/src/main/resources/templates/music.html b/src/main/resources/templates/music.html index ca44919..08e8e68 100644 --- a/src/main/resources/templates/music.html +++ b/src/main/resources/templates/music.html @@ -45,11 +45,15 @@

-
+
+
+
0:00
+
0:00
+