mirror of
https://github.com/ikun0014/lx-music-mobile.git
synced 2025-05-23 22:37:41 +08:00
修复定时播放的问题
This commit is contained in:
parent
be1e9594c3
commit
4561446dfb
@ -1,15 +1,3 @@
|
||||
### 新增
|
||||
|
||||
- 新增我的列表中已收藏的在线列表的更新功能。注意:这将会覆盖本地的目标列表,歌曲将被替换成最新的在线列表(与PC端的同步一样)
|
||||
- 歌曲添加、移动弹窗新增创建新列表功能
|
||||
- 新增定时退出播放
|
||||
|
||||
### 优化
|
||||
|
||||
- 优化应用布局对手机系统字体大小的适配
|
||||
- 调整歌单详情页,现在在歌单详情页按手机上的返回键将会返回歌单列表,而不是直接退出APP
|
||||
- 优化进入播放详情页、歌单详情页的动画效果
|
||||
|
||||
### 修复
|
||||
|
||||
- 尝试修复某些情况下进播放详情歌词界面时报错的问题
|
||||
- 修复定时播放开启歌曲播放完毕再停止时,若倒计时已结束会导致无法播放歌曲的问题
|
||||
|
@ -49,6 +49,14 @@ let errorTime = 0
|
||||
|
||||
// },
|
||||
// }
|
||||
// 销毁播放器并退出
|
||||
const stopPlay = () => {
|
||||
global.isPlayedExit = false
|
||||
TrackPlayer.pause()
|
||||
store.dispatch(playerAction.destroy()).finally(() => {
|
||||
exitApp()
|
||||
})
|
||||
}
|
||||
|
||||
export default async() => {
|
||||
if (isInitialized) return
|
||||
@ -156,16 +164,12 @@ export default async() => {
|
||||
console.log('playback-state', info)
|
||||
break
|
||||
}
|
||||
if (global.isPlayedExit) return stopPlay()
|
||||
})
|
||||
TrackPlayer.addEventListener('playback-track-changed', async info => {
|
||||
// console.log('nextTrack====>', info)
|
||||
if (global.isPlayedExit) { // 销毁播放器并退出
|
||||
TrackPlayer.pause()
|
||||
store.dispatch(playerAction.destroy()).finally(() => {
|
||||
exitApp()
|
||||
})
|
||||
return
|
||||
}
|
||||
if (global.isPlayedExit) return stopPlay()
|
||||
|
||||
trackId = await TrackPlayer.getCurrentTrack()
|
||||
if (trackId && isTempTrack(trackId)) {
|
||||
console.log('====TEMP PAUSE====')
|
||||
|
Loading…
x
Reference in New Issue
Block a user