MediaStreamProxy.kt
composeApp/src/commonMain/kotlin/eu/friedcutlet/yokan/services/media/player/MediaStreamProxy.kt
1package eu.friedcutlet.yokan.services.media.player23import eu.friedcutlet.yokan.services.logging.AppLogger456interface MediaStreamProxy {7 fun proxyUrl(url: String, headers: Map<String, String>): String8 fun stop()9 /** Wait for sockets, workers and upstream call finalizers before releasing the owner. */10 suspend fun closeAndJoin() { stop() }11}1213object NoopMediaStreamProxy : MediaStreamProxy {14 override fun proxyUrl(url: String, headers: Map<String, String>): String {15 if (headers.isNotEmpty()) {16 AppLogger.warn("[player-proxy] stream headers are required but this platform has no local stream proxy")17 }18 return url19 }2021 override fun stop() = Unit22}2324expect fun createPlatformMediaStreamProxy(): MediaStreamProxy25