Showing
1 changed file
with
7 additions
and
0 deletions
| @@ -202,6 +202,13 @@ export class BackgroundAudioController { | @@ -202,6 +202,13 @@ export class BackgroundAudioController { | ||
| 202 | } | 202 | } |
| 203 | 203 | ||
| 204 | if (force == false && this.hasSetupProgress) { | 204 | if (force == false && this.hasSetupProgress) { |
| 205 | + let playbackState: AVSessionManager.AVPlaybackState = { | ||
| 206 | + position: { | ||
| 207 | + elapsedTime: progressDuration, // 已经播放的位置,以ms为单位 | ||
| 208 | + updateTime: new Date().getTime(), // 应用更新当前位置时的时间戳,以ms为单位 | ||
| 209 | + }, | ||
| 210 | + }; | ||
| 211 | + this.lastSession?.setAVPlaybackState(playbackState, (err) => {}); | ||
| 205 | return | 212 | return |
| 206 | } | 213 | } |
| 207 | this.hasSetupProgress = true | 214 | this.hasSetupProgress = true |
-
Please register or login to post a comment