Skip to content

Commit

Permalink
Merge pull request #2127 from runnableAir/fix_player_enable
Browse files Browse the repository at this point in the history
Fix: 右键播放歌曲无法激活播放栏
  • Loading branch information
pan93412 authored Mar 1, 2024
2 parents 1400636 + 61d0b59 commit 741fdc9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/utils/Player.js
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,9 @@ export default class {
this._howler?.once('play', () => {
this._howler?.fade(0, this.volume, PLAY_PAUSE_FADE_DURATION);

// 播放时确保开启player.
// 避免因"忘记设置"导致在播放时播放器不显示的Bug
this._enabled = true;
this._setPlaying(true);
if (this._currentTrack.name) {
setTitle(this._currentTrack);
Expand Down Expand Up @@ -879,7 +882,6 @@ export default class {
autoPlayTrackID = 'first'
) {
this._isPersonalFM = false;
if (!this._enabled) this._enabled = true;
this.list = trackIDs;
this.current = 0;
this._playlistSource = {
Expand Down Expand Up @@ -941,7 +943,6 @@ export default class {
}
playPersonalFM() {
this._isPersonalFM = true;
if (!this._enabled) this._enabled = true;
if (this.currentTrackID !== this._personalFMTrack.id) {
this._replaceCurrentTrack(this._personalFMTrack.id, true);
} else {
Expand Down

0 comments on commit 741fdc9

Please sign in to comment.