修复bug和优化体验

This commit is contained in:
qier222 2020-10-14 21:10:45 +08:00
parent b399d5bbdc
commit 861125ea8c
17 changed files with 120 additions and 72 deletions

View file

@ -51,7 +51,11 @@ export default {
},
methods: {
goToMv(id) {
this.$router.push({ path: "/mv/" + id });
let query = {};
if (this.$parent.player !== undefined) {
query = { autoplay: this.$parent.player.playing };
}
this.$router.push({ path: "/mv/" + id, query });
},
getUrl(mv) {
if (mv.cover !== undefined) return mv.cover;

View file

@ -104,6 +104,7 @@
</template>
<script>
import { updateMediaSessionMetaData } from "@/utils/mediaSession";
import { mapState, mapMutations, mapActions } from "vuex";
import "@/assets/css/slider.css";
@ -152,14 +153,18 @@ export default {
},
methods: {
...mapMutations([
"updatePlayingStatus",
"updateShuffleStatus",
"updatePlayerList",
"shuffleTheList",
"updatePlayerState",
"updateRepeatStatus",
]),
...mapActions(["nextTrack", "previousTrack", "playTrackOnListByID"]),
...mapActions([
"nextTrack",
"previousTrack",
"playTrackOnListByID",
"addNextTrackEvent",
]),
play() {
if (this.playing) {
this.howler.pause();
@ -168,6 +173,10 @@ export default {
this.playTrackOnListByID(this.player.currentTrack.id);
}
this.howler.play();
if (this.howler._onend.length === 0) {
this.addNextTrackEvent();
updateMediaSessionMetaData(this.player.currentTrack);
}
}
},
next() {