diff --git a/platypush/backend/http/static/js/widgets/music.js b/platypush/backend/http/static/js/widgets/music.js index 866ffa18..ab146501 100644 --- a/platypush/backend/http/static/js/widgets/music.js +++ b/platypush/backend/http/static/js/widgets/music.js @@ -105,14 +105,24 @@ $(document).ready(function() { }; var refreshStatus = function(status) { - setState(state=status.state); + if ('state' in status) { + setState(state=status.state); + } + if ('elapsed' in status) { setTrackElapsed(status.elapsed); } + + if ('position' in status) { + setTrackElapsed(status.position); + } }; var refreshTrack = function(track) { - setTrackTime(track.time); + if ('time' in track) { + setTrackTime(track.time); + } + $artistElement.text(track.artist); $titleElement.text(track.title); };