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

Function nextTrack

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

Source from the content-addressed store, hash-verified

113 playpause_btn.innerHTML = '<i class="fa fa-play-circle fa-5x"></i>';
114}
115function nextTrack(){
116 if(track_index < music_list.length - 1 && isRandom === false){
117 track_index += 1;
118 }else if(track_index < music_list.length - 1 && isRandom === true){
119 let random_index = Number.parseInt(Math.random() * music_list.length);
120 track_index = random_index;
121 }else{
122 track_index = 0;
123 }
124 loadTrack(track_index);
125 playTrack();
126}
127function prevTrack(){
128 if(track_index > 0){
129 track_index -= 1;

Callers

nothing calls this directly

Calls 2

loadTrackFunction · 0.85
playTrackFunction · 0.85

Tested by

no test coverage detected