mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-08-29 14:28:34 +02:00
Update:Android disable check for updated progress when playing
This commit is contained in:
parent
f9d408b33f
commit
0448d20583
1 changed files with 7 additions and 6 deletions
|
@ -7,7 +7,7 @@ import com.audiobookshelf.app.device.DeviceManager
|
||||||
import com.google.android.exoplayer2.PlaybackException
|
import com.google.android.exoplayer2.PlaybackException
|
||||||
import com.google.android.exoplayer2.Player
|
import com.google.android.exoplayer2.Player
|
||||||
|
|
||||||
const val PAUSE_LEN_BEFORE_RECHECK = 30000 // 30 seconds
|
//const val PAUSE_LEN_BEFORE_RECHECK = 30000 // 30 seconds
|
||||||
|
|
||||||
class PlayerListener(var playerNotificationService:PlayerNotificationService) : Player.Listener {
|
class PlayerListener(var playerNotificationService:PlayerNotificationService) : Player.Listener {
|
||||||
var tag = "PlayerListener"
|
var tag = "PlayerListener"
|
||||||
|
@ -74,12 +74,13 @@ class PlayerListener(var playerNotificationService:PlayerNotificationService) :
|
||||||
Log.d(tag, "SeekBackTime $seekBackTime")
|
Log.d(tag, "SeekBackTime $seekBackTime")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: this needs to be reworked so that the audio doesn't start playing before it checks for updated progress
|
||||||
// Check if playback session still exists or sync media progress if updated
|
// Check if playback session still exists or sync media progress if updated
|
||||||
val pauseLength: Long = System.currentTimeMillis() - lastPauseTime
|
// val pauseLength: Long = System.currentTimeMillis() - lastPauseTime
|
||||||
if (pauseLength > PAUSE_LEN_BEFORE_RECHECK) {
|
// if (pauseLength > PAUSE_LEN_BEFORE_RECHECK) {
|
||||||
val shouldCarryOn = playerNotificationService.checkCurrentSessionProgress(seekBackTime)
|
// val shouldCarryOn = playerNotificationService.checkCurrentSessionProgress(seekBackTime)
|
||||||
if (!shouldCarryOn) return
|
// if (!shouldCarryOn) return
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (seekBackTime > 0L) {
|
if (seekBackTime > 0L) {
|
||||||
playerNotificationService.seekBackward(seekBackTime)
|
playerNotificationService.seekBackward(seekBackTime)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue