mirror of
https://gitlab.com/ultrasonic/ultrasonic.git
synced 2025-05-17 15:56:36 +03:00
Pass down the autoPlay value to BufferTask()
This commit is contained in:
parent
bf106b0384
commit
970d93bd91
@ -469,7 +469,7 @@ class LocalMediaPlayer(
|
|||||||
private fun bufferAndPlay(fileToPlay: DownloadFile, position: Int, autoStart: Boolean) {
|
private fun bufferAndPlay(fileToPlay: DownloadFile, position: Int, autoStart: Boolean) {
|
||||||
if (playerState !== PlayerState.PREPARED) {
|
if (playerState !== PlayerState.PREPARED) {
|
||||||
reset()
|
reset()
|
||||||
bufferTask = BufferTask(fileToPlay, position)
|
bufferTask = BufferTask(fileToPlay, position, autoStart)
|
||||||
bufferTask!!.start()
|
bufferTask!!.start()
|
||||||
} else {
|
} else {
|
||||||
doPlay(fileToPlay, position, autoStart)
|
doPlay(fileToPlay, position, autoStart)
|
||||||
@ -710,7 +710,8 @@ class LocalMediaPlayer(
|
|||||||
|
|
||||||
private inner class BufferTask(
|
private inner class BufferTask(
|
||||||
private val downloadFile: DownloadFile,
|
private val downloadFile: DownloadFile,
|
||||||
private val position: Int
|
private val position: Int,
|
||||||
|
private val autoStart: Boolean = true
|
||||||
) : CancellableTask() {
|
) : CancellableTask() {
|
||||||
private val expectedFileSize: Long
|
private val expectedFileSize: Long
|
||||||
private val partialFile: File = downloadFile.partialFile
|
private val partialFile: File = downloadFile.partialFile
|
||||||
@ -724,7 +725,7 @@ class LocalMediaPlayer(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
doPlay(downloadFile, position, true)
|
doPlay(downloadFile, position, autoStart)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun bufferComplete(): Boolean {
|
private fun bufferComplete(): Boolean {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user