NewPlayer/new-player/src/main/java/net/newpipe/newplayer/model/ViewoPlayerViewModelDummy.kt
Christian Schabesberger 8f78d72a13 make activity brainslug also access uiState
This operation introduces a glitch since the composable and
the views are updated simultaniously. However this leads to a situation
where the embedded view thinkgs its fullscreen and thus renders alike.
Due to this reason the embbedded view breafly jumps up.
2024-08-29 11:09:30 +02:00

87 lines
2.2 KiB
Kotlin

package net.newpipe.newplayer.model
import android.os.Bundle
import androidx.media3.common.Player
import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.asSharedFlow
import net.newpipe.newplayer.NewPlayer
import net.newpipe.newplayer.ui.ContentScale
open class VideoPlayerViewModelDummy : VideoPlayerViewModel {
override var newPlayer: NewPlayer? = null
override val internalPlayer: Player? = null
override val uiState = MutableStateFlow(VideoPlayerUIState.DEFAULT)
override var minContentRatio = 4F / 3F
override var maxContentRatio = 16F / 9F
override var contentFitMode = ContentScale.FIT_INSIDE
override val embeddedPlayerDraggedDownBy = MutableSharedFlow<Float>().asSharedFlow()
override fun initUIState(instanceState: Bundle) {
println("dummy impl")
}
override fun play() {
println("dummy impl")
}
override fun switchToEmbeddedView() {
println("dummy impl")
}
override fun switchToFullscreen() {
println("dummy impl")
}
override fun showUi() {
println("dummy impl")
}
override fun hideUi() {
println("dummy impl")
}
override fun seekPositionChanged(newValue: Float) {
println("dymmy seekPositionChanged: newValue: ${newValue}")
}
override fun seekingFinished() {
println("dummy impl")
}
override fun embeddedDraggedDown(offset: Float) {
println("dymmy embeddedDraggedDown: offset: ${offset}")
}
override fun fastSeek(steps: Int) {
println("dummy impl")
}
override fun finishFastSeek() {
println("dummy impl")
}
override fun brightnessChange(changeRate: Float, systemBrightness: Float) {
println("dummy impl")
}
override fun volumeChange(changeRate: Float) {
println("dummy impl")
}
override fun onReportEmbeddedConfig(embeddedUiConfig: EmbeddedUiConfig?) {
println("dummy impl")
}
override fun pause() {
println("dummy pause")
}
override fun prevStream() {
println("dummy impl")
}
override fun nextStream() {
println("dummy impl")
}
}