Pressing back button should restart the song rather than sending it to previous song
This commit is contained in:
parent
2c3535fcdc
commit
b492bc7b41
1 changed files with 10 additions and 0 deletions
|
@ -232,6 +232,7 @@ const app = new Vue({
|
||||||
title: "",
|
title: "",
|
||||||
type: ""
|
type: ""
|
||||||
},
|
},
|
||||||
|
prevButtonBackIndicator : false,
|
||||||
currentSongInfo: {},
|
currentSongInfo: {},
|
||||||
page: "browse",
|
page: "browse",
|
||||||
pageHistory: [],
|
pageHistory: [],
|
||||||
|
@ -681,6 +682,15 @@ const app = new Vue({
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
prevButton(){
|
||||||
|
if (!app.prevButtonBackIndicator && app.mk.nowPlayingItem && app.mk.currentPlaybackTime > 2){
|
||||||
|
app.prevButtonBackIndicator = true;
|
||||||
|
app.mk.seekToTime(0);
|
||||||
|
} else {
|
||||||
|
app.prevButtonBackIndicator = false;
|
||||||
|
app.mk.skipToPreviousItem()
|
||||||
|
}
|
||||||
|
},
|
||||||
async getNowPlayingItemDetailed(target) {
|
async getNowPlayingItemDetailed(target) {
|
||||||
let u = await app.mkapi(app.mk.nowPlayingItem.playParams.kind, (app.mk.nowPlayingItem.songId == -1), (app.mk.nowPlayingItem.songId != -1) ? app.mk.nowPlayingItem.songId : app.mk.nowPlayingItem["id"], {"include[songs]": "albums,artists"});
|
let u = await app.mkapi(app.mk.nowPlayingItem.playParams.kind, (app.mk.nowPlayingItem.songId == -1), (app.mk.nowPlayingItem.songId != -1) ? app.mk.nowPlayingItem.songId : app.mk.nowPlayingItem["id"], {"include[songs]": "albums,artists"});
|
||||||
app.searchAndNavigate(u, target)
|
app.searchAndNavigate(u, target)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue