回报实际播放事件
This commit is contained in:
parent
f42ba2662b
commit
c173f83301
|
@ -108,6 +108,7 @@ class WebAudioPlayer {
|
||||||
playState.reportPlayProgress(0)
|
playState.reportPlayProgress(0)
|
||||||
playState.reportActualPlaying(false)
|
playState.reportActualPlaying(false)
|
||||||
this.currentSource?.stop()
|
this.currentSource?.stop()
|
||||||
|
this.nextSource?.stop()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 将音频 buffer 加载到缓存空间
|
// 将音频 buffer 加载到缓存空间
|
||||||
|
@ -149,6 +150,7 @@ class WebAudioPlayer {
|
||||||
this.currentSource.buffer = this.audioBuffer[playQueue.currentTrack.song.cid]
|
this.currentSource.buffer = this.audioBuffer[playQueue.currentTrack.song.cid]
|
||||||
this.currentSource.connect(this.context.destination)
|
this.currentSource.connect(this.context.destination)
|
||||||
this.currentSource.start(this.context.currentTime, playState.playProgress)
|
this.currentSource.start(this.context.currentTime, playState.playProgress)
|
||||||
|
playState.reportActualPlaying(true)
|
||||||
this.reportProgress()
|
this.reportProgress()
|
||||||
// 开始预先准备无缝播放下一首
|
// 开始预先准备无缝播放下一首
|
||||||
// 获取下一首歌接入的时间点
|
// 获取下一首歌接入的时间点
|
||||||
|
@ -190,6 +192,7 @@ class WebAudioPlayer {
|
||||||
debugPlayer(this.currentSource)
|
debugPlayer(this.currentSource)
|
||||||
this.currentSource?.stop()
|
this.currentSource?.stop()
|
||||||
this.nextSource?.stop()
|
this.nextSource?.stop()
|
||||||
|
playState.reportActualPlaying(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
stop() {
|
stop() {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user