Skip to content

Commit

Permalink
update: record progress complete when player ended
Browse files Browse the repository at this point in the history
  • Loading branch information
muedsa committed Nov 13, 2023
1 parent 6328808 commit d281b73
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ fun PlaybackScreen(

LaunchedEffect(key1 = playerEnd) {
if (playerEnd) {
if (episodeProgress.aid == aid && exoplayerHolder != null) {
val exoPlayer = exoplayerHolder!!
episodeProgress.duration = exoPlayer.duration
episodeProgress.updateAt = System.currentTimeMillis()
playbackViewModel.saveEpisodeProgress(episodeProgress)
}
errorMsgBoxState.error("播放结束,即将返回")
delay(3_000)
activity?.finish()
Expand Down

0 comments on commit d281b73

Please sign in to comment.