mirror of
https://github.com/clangen/musikcube.git
synced 2025-01-05 21:55:24 +00:00
Minor cleanups to musikdroid
This commit is contained in:
parent
1382ebe68b
commit
2ac1951e22
@ -274,7 +274,6 @@ class ExoPlayerWrapper : PlayerWrapper() {
|
||||
}
|
||||
|
||||
private val cacheListener = CacheListener { _: File, _: String, percent: Int ->
|
||||
//Log.e("CLCLCL", String.format("%d", percent));
|
||||
percentAvailable = percent
|
||||
|
||||
if (percentAvailable >= 100) {
|
||||
|
@ -78,12 +78,7 @@ class MediaPlayerWrapper : PlayerWrapper() {
|
||||
override var position: Int
|
||||
get() {
|
||||
Preconditions.throwIfNotOnMainThread()
|
||||
|
||||
if (isPreparedOrPlaying) {
|
||||
return this.player.currentPosition
|
||||
}
|
||||
|
||||
return 0
|
||||
return if (isPreparedOrPlaying) this.player.currentPosition else 0
|
||||
}
|
||||
set(millis) {
|
||||
Preconditions.throwIfNotOnMainThread()
|
||||
@ -100,12 +95,7 @@ class MediaPlayerWrapper : PlayerWrapper() {
|
||||
override val duration: Int
|
||||
get() {
|
||||
Preconditions.throwIfNotOnMainThread()
|
||||
|
||||
if (isPreparedOrPlaying) {
|
||||
return this.player.duration
|
||||
}
|
||||
|
||||
return 0
|
||||
return if (isPreparedOrPlaying) this.player.duration else 0
|
||||
}
|
||||
|
||||
override fun resume() {
|
||||
|
@ -23,7 +23,7 @@ interface PlaybackService {
|
||||
fun pause()
|
||||
fun resume()
|
||||
fun prev()
|
||||
operator fun next()
|
||||
fun next()
|
||||
fun stop()
|
||||
|
||||
fun volumeUp()
|
||||
|
Loading…
Reference in New Issue
Block a user