Skip to content

Commit

Permalink
update Player.js to enter React Drag and Drop
Browse files Browse the repository at this point in the history
update track.js to enter React Drag and Drop sorting songs in playlist. This is one of the modified three files. These three files are:
Kaku-1.9.0/src/views/modules/Player.js ,
Kaku-1.9.0/src/views/components/shared/tracks.js  and 
Kaku-1.9.0/src/views/components/shared/track/track.js .
In order for the introduced changes to work, one should install: react-dnd and react-dnd-html5-backend. You also need to create an ItemTypes.js file in Kaku-1.9.0/src/views/components/shared/track/  .
  • Loading branch information
japko36 authored Mar 25, 2018
1 parent 1f80e44 commit 33a2ea7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/views/modules/Player.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ Player.prototype.cleanupTracks = function(noUpdate) {
}
};

Player.prototype.playNextTrack = function(forceIndex) {
Player.prototype.playNextTrack = function(forceIndex,time) {
if (this.disabled) {
return;
}
Expand All @@ -203,7 +203,8 @@ Player.prototype.playNextTrack = function(forceIndex) {
// TODO
// double check this randomIndex later
this.randomIndex = this.trackIndex;
this.play(this.tracks[this.trackIndex]);
let currentTime = time || 0;
this.play(this.tracks[this.trackIndex], currentTime);
return;
}

Expand Down Expand Up @@ -236,7 +237,8 @@ Player.prototype.playNextTrack = function(forceIndex) {
}
else if (this.mode === 'all') {
this.trackIndex = (this.trackIndex + 1) % this.tracks.length;
this.play(this.tracks[this.trackIndex]);
let currentTime = time || 0;
this.play(this.tracks[this.trackIndex], currentTime);
}
};

Expand Down

0 comments on commit 33a2ea7

Please sign in to comment.