fix: match parameters of free and nonFree CastServiceImpl

This commit is contained in:
Felix 2020-06-11 21:41:55 +02:00
parent d1877dd924
commit bd77a7bc22
3 changed files with 20 additions and 10 deletions

View file

@ -7,10 +7,15 @@ import de.nicidienase.chaosflix.common.mediadata.entities.recording.persistence.
import de.nicidienase.chaosflix.common.mediadata.entities.recording.persistence.Recording import de.nicidienase.chaosflix.common.mediadata.entities.recording.persistence.Recording
import de.nicidienase.chaosflix.common.mediadata.entities.streaming.StreamUrl import de.nicidienase.chaosflix.common.mediadata.entities.streaming.StreamUrl
import de.nicidienase.chaosflix.common.userdata.entities.progress.PlaybackProgress import de.nicidienase.chaosflix.common.userdata.entities.progress.PlaybackProgress
import de.nicidienase.chaosflix.common.userdata.entities.progress.PlaybackProgressDao
import de.nicidienase.chaosflix.touch.browse.streaming.StreamingItem import de.nicidienase.chaosflix.touch.browse.streaming.StreamingItem
import kotlinx.coroutines.CoroutineScope
@SuppressWarnings("unused") @SuppressWarnings("unused")
class CastServiceImpl : CastService { class CastServiceImpl(
playbackProgressDao: PlaybackProgressDao,
scope: CoroutineScope
) : CastService(playbackProgressDao, scope) {
override val connected: Boolean = false override val connected: Boolean = false

View file

@ -6,13 +6,18 @@ import de.nicidienase.chaosflix.common.mediadata.entities.recording.persistence.
import de.nicidienase.chaosflix.common.mediadata.entities.recording.persistence.Recording import de.nicidienase.chaosflix.common.mediadata.entities.recording.persistence.Recording
import de.nicidienase.chaosflix.common.mediadata.entities.streaming.StreamUrl import de.nicidienase.chaosflix.common.mediadata.entities.streaming.StreamUrl
import de.nicidienase.chaosflix.common.userdata.entities.progress.PlaybackProgress import de.nicidienase.chaosflix.common.userdata.entities.progress.PlaybackProgress
import de.nicidienase.chaosflix.common.userdata.entities.progress.PlaybackProgressDao
import de.nicidienase.chaosflix.touch.browse.streaming.StreamingItem import de.nicidienase.chaosflix.touch.browse.streaming.StreamingItem
import kotlinx.coroutines.CoroutineScope
interface CastService { abstract class CastService(
val connected: Boolean val playbackProgressDao: PlaybackProgressDao,
val scope: CoroutineScope
) {
abstract val connected: Boolean
fun attachToActivity(activity: AppCompatActivity) abstract fun attachToActivity(activity: AppCompatActivity)
fun castStream(streamingItem: StreamingItem, streamUrl: StreamUrl, contentKey: String) abstract fun castStream(streamingItem: StreamingItem, streamUrl: StreamUrl, contentKey: String)
fun loadMediaAndPlay(recording: Recording, event: Event, progress: PlaybackProgress?) abstract fun loadMediaAndPlay(recording: Recording, event: Event, progress: PlaybackProgress?)
fun addMediaRouteMenuItem(menu: Menu) abstract fun addMediaRouteMenuItem(menu: Menu)
} }

View file

@ -25,9 +25,9 @@ import pl.droidsonroids.casty.Casty
import pl.droidsonroids.casty.MediaData import pl.droidsonroids.casty.MediaData
class CastServiceImpl( class CastServiceImpl(
private val playbackProgressDao: PlaybackProgressDao, playbackProgressDao: PlaybackProgressDao,
private val scope: CoroutineScope scope: CoroutineScope
) : LifecycleObserver, CastService { ) : LifecycleObserver, CastService(playbackProgressDao, scope) {
private var currentEvent: Event? = null private var currentEvent: Event? = null