MCPcopy Create free account
hub / github.com/codemistic/Web-Development / setUpdate

Function setUpdate

Music App/index.js:140–159  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

138 curr_track.currentTime = seekto;
139}
140function setUpdate(){
141 let seekPosition = 0;
142 if(!isNaN(curr_track.duration)){
143 seekPosition = curr_track.currentTime * (100 / curr_track.duration);
144 seek_slider.value = seekPosition;
145
146 let currentMinutes = Math.floor(curr_track.currentTime / 60);
147 let currentSeconds = Math.floor(curr_track.currentTime - currentMinutes * 60);
148 let durationMinutes = Math.floor(curr_track.duration / 60);
149 let durationSeconds = Math.floor(curr_track.duration - durationMinutes * 60);
150
151 if(currentSeconds < 10) {currentSeconds = "0" + currentSeconds; }
152 if(durationSeconds < 10) { durationSeconds = "0" + durationSeconds; }
153 if(currentMinutes < 10) {currentMinutes = "0" + currentMinutes; }
154 if(durationMinutes < 10) { durationMinutes = "0" + durationMinutes; }
155
156 curr_time.textContent = currentMinutes + ":" + currentSeconds;
157 // total_duration.textContent = durationMinutes + ":" + durationMinutes;
158 }
159}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected