diff --git a/app/src/main/kotlin/com/muedsa/compose/tv/widget/player/DanmakuVideoPlayer.kt b/app/src/main/kotlin/com/muedsa/compose/tv/widget/player/DanmakuVideoPlayer.kt index d5fe84f..f60a7ad 100644 --- a/app/src/main/kotlin/com/muedsa/compose/tv/widget/player/DanmakuVideoPlayer.kt +++ b/app/src/main/kotlin/com/muedsa/compose/tv/widget/player/DanmakuVideoPlayer.kt @@ -23,19 +23,19 @@ import com.kuaishou.akdanmaku.data.DanmakuItemData import com.kuaishou.akdanmaku.render.SimpleRenderer import com.kuaishou.akdanmaku.ui.DanmakuPlayer import com.kuaishou.akdanmaku.ui.DanmakuView +import com.muedsa.uitl.AppUtil import kotlin.random.Random @SuppressLint("OpaqueUnitKey") @OptIn(UnstableApi::class) @Composable fun DanmakuVideoPlayer( - debug: Boolean = false, + debug: Boolean = AppUtil.debuggable(LocalContext.current), danmakuConfigSetting: DanmakuConfig.() -> Unit = {}, danmakuPlayerInit: DanmakuPlayer.() -> Unit = {}, videoPlayerBuilderSetting: ExoPlayer.Builder.() -> Unit = {}, videoPlayerInit: ExoPlayer.() -> Unit, ) { - val context = LocalContext.current val playerControlTicker = remember { mutableIntStateOf(0) } diff --git a/app/src/main/kotlin/com/muedsa/jcytv/screens/playback/PlaybackScreen.kt b/app/src/main/kotlin/com/muedsa/jcytv/screens/playback/PlaybackScreen.kt index fd1d8b5..2ae8243 100644 --- a/app/src/main/kotlin/com/muedsa/jcytv/screens/playback/PlaybackScreen.kt +++ b/app/src/main/kotlin/com/muedsa/jcytv/screens/playback/PlaybackScreen.kt @@ -25,7 +25,6 @@ import com.muedsa.compose.tv.useLocalToastMsgBoxController import com.muedsa.compose.tv.widget.player.DanmakuVideoPlayer import com.muedsa.compose.tv.widget.player.mergeDanmaku import com.muedsa.model.LazyType -import com.muedsa.uitl.AppUtil import com.muedsa.uitl.LogUtil import kotlinx.coroutines.delay import kotlin.math.max @@ -124,7 +123,6 @@ fun PlaybackScreen( val danmakuSetting = danmakuSettingLD.data!! DanmakuVideoPlayer( - debug = if(activity != null) AppUtil.debuggable(activity.applicationContext) else false, danmakuConfigSetting = { textSizeScale = danmakuSetting.danmakuSizeScale / 100f alpha = danmakuSetting.danmakuAlpha / 100f