StreamVault is a TV-first free IPTV player for Android TV built with Kotlin, Jetpack Compose, Room, Hilt, and Media3.
Kotlin iptv-player
feat: add live TV clock overlay
David Nashash925ec24b3aa2
diff --git a/data/src/main/java/com/streamvault/data/manager/BackupManagerImpl.kt b/data/src/main/java/com/streamvault/data/manager/BackupManagerImpl.ktindex f0971588..b3ef0166 100644--- a/data/src/main/java/com/streamvault/data/manager/BackupManagerImpl.kt+++ b/data/src/main/java/com/streamvault/data/manager/BackupManagerImpl.kt@@ -260,6 +260,10 @@ class BackupManagerImpl @Inject constructor(put("playerLiveTranslationEndpoint", preferencesRepository.playerLiveTranslationEndpoint.first())put("playerControlsTimeoutSeconds", preferencesRepository.playerControlsTimeoutSeconds.first().toString())put("playerLiveOverlayTimeoutSeconds", preferencesRepository.playerLiveOverlayTimeoutSeconds.first().toString())+ put("playerLiveClockEnabled", preferencesRepository.playerLiveClockEnabled.first().toString())+ put("playerLiveClockPosition", preferencesRepository.playerLiveClockPosition.first().storageValue)+ put("playerLiveClockSize", preferencesRepository.playerLiveClockSize.first().storageValue)+ put("playerLiveClockFont", preferencesRepository.playerLiveClockFont.first().storageValue)put("playerNoticeTimeoutSeconds", preferencesRepository.playerNoticeTimeoutSeconds.first().toString())put("playerDiagnosticsTimeoutSeconds", preferencesRepository.playerDiagnosticsTimeoutSeconds.first().toString())put("playerWifiMaxVideoHeight", (preferencesRepository.playerWifiMaxVideoHeight.first() ?: 0).toString())@@ -3197,6 +3201,10 @@ class BackupManagerImpl @Inject constructor(put("playerLiveTranslationEndpoint", preferencesRepository.playerLiveTranslationEndpoint.first())put("playerControlsTimeoutSeconds", preferencesRepository.playerControlsTimeoutSeconds.first().toString())put("playerLiveOverlayTimeoutSeconds", preferencesRepository.playerLiveOverlayTimeoutSeconds.first().toString())+ put("playerLiveClockEnabled", preferencesRepository.playerLiveClockEnabled.first().toString())+ put("playerLiveClockPosition", preferencesRepository.playerLiveClockPosition.first().storageValue)+ put("playerLiveClockSize", preferencesRepository.playerLiveClockSize.first().storageValue)+ put("playerLiveClockFont", preferencesRepository.playerLiveClockFont.first().storageValue)put("playerNoticeTimeoutSeconds", preferencesRepository.playerNoticeTimeoutSeconds.first().toString())put("playerDiagnosticsTimeoutSeconds", preferencesRepository.playerDiagnosticsTimeoutSeconds.first().toString())put("playerWifiMaxVideoHeight", (preferencesRepository.playerWifiMaxVideoHeight.first() ?: 0).toString())@@ -3787,6 +3795,23 @@ class BackupManagerImpl @Inject constructor(?.let { preferencesRepository.setPlayerControlsTimeoutSeconds(it) }prefs["playerLiveOverlayTimeoutSeconds"]?.toIntOrNull()?.let { preferencesRepository.setPlayerLiveOverlayTimeoutSeconds(it) }+ prefs["playerLiveClockEnabled"]?.toBooleanStrictOrNull()+ ?.let { preferencesRepository.setPlayerLiveClockEnabled(it) }+ prefs["playerLiveClockPosition"]?.let { savedPosition ->+ preferencesRepository.setPlayerLiveClockPosition(+ com.streamvault.domain.model.LiveClockPosition.fromStorage(savedPosition)+ )+ }+ prefs["playerLiveClockSize"]?.let { savedSize ->+ preferencesRepository.setPlayerLiveClockSize(+ com.streamvault.domain.model.LiveClockSize.fromStorage(savedSize)+ )+ }+ prefs["playerLiveClockFont"]?.let { savedFont ->+ preferencesRepository.setPlayerLiveClockFont(+ com.streamvault.domain.model.LiveClockFont.fromStorage(savedFont)+ )+ }prefs["playerNoticeTimeoutSeconds"]?.toIntOrNull()?.let { preferencesRepository.setPlayerNoticeTimeoutSeconds(it) }prefs["playerDiagnosticsTimeoutSeconds"]?.toIntOrNull()diff --git a/data/src/main/java/com/streamvault/data/manager/PreferenceBackupRegistry.kt b/data/src/main/java/com/streamvault/data/manager/PreferenceBackupRegistry.ktindex 52f20b39..2af984eb 100644--- a/data/src/main/java/com/streamvault/data/manager/PreferenceBackupRegistry.kt+++ b/data/src/main/java/com/streamvault/data/manager/PreferenceBackupRegistry.kt@@ -34,6 +34,8 @@ internal object PreferenceBackupRegistry {"player_subtitle_text_color", "player_subtitle_background_color", "player_live_translation_enabled","player_live_translation_endpoint", "player_controls_timeout_seconds","player_live_overlay_timeout_seconds", "player_notice_timeout_seconds",+ "player_live_clock_enabled", "player_live_clock_position", "player_live_clock_size",+ "player_live_clock_font","player_diagnostics_timeout_seconds", "player_wifi_max_video_height","player_ethernet_max_video_height", "player_timeshift_enabled", "player_timeshift_depth_minutes","player_timeshift_backend", "default_stop_playback_timer_minutes",@@ -103,6 +105,7 @@ internal object PreferenceBackupRegistry {"preferredAudioLanguage", "playerSubtitleTextScale", "playerSubtitleTextColor","playerSubtitleBackgroundColor", "playerLiveTranslationEnabled", "playerLiveTranslationEndpoint","playerControlsTimeoutSeconds", "playerLiveOverlayTimeoutSeconds", "playerNoticeTimeoutSeconds",+ "playerLiveClockEnabled", "playerLiveClockPosition", "playerLiveClockSize", "playerLiveClockFont","playerDiagnosticsTimeoutSeconds", "playerWifiMaxVideoHeight", "playerEthernetMaxVideoHeight","playerTimeshiftEnabled", "playerTimeshiftDepthMinutes", "playerTimeshiftBackend","defaultStopPlaybackTimerMinutes", "defaultIdleStandbyTimerMinutes", "preventStandbyDuringPlayback",diff --git a/data/src/main/java/com/streamvault/data/preferences/PreferencesRepository.kt b/data/src/main/java/com/streamvault/data/preferences/PreferencesRepository.ktindex a8d505ef..d5c546ab 100644--- a/data/src/main/java/com/streamvault/data/preferences/PreferencesRepository.kt+++ b/data/src/main/java/com/streamvault/data/preferences/PreferencesRepository.kt@@ -35,6 +35,9 @@ import com.streamvault.domain.model.AppTimeFormatimport com.streamvault.domain.model.AppThemeimport com.streamvault.domain.model.LiveChannelGroupingModeimport com.streamvault.domain.model.LiveChannelObservedQuality+import com.streamvault.domain.model.LiveClockFont+import com.streamvault.domain.model.LiveClockPosition+import com.streamvault.domain.model.LiveClockSizeimport com.streamvault.domain.model.LiveStreamFormatModeimport com.streamvault.domain.model.LiveVariantPreferenceModeimport com.streamvault.domain.model.AppTopLevelDestination@@ -270,6 +273,10 @@ class PreferencesRepository @Inject constructor(val PLAYER_LIVE_TRANSLATION_ENDPOINT = stringPreferencesKey("player_live_translation_endpoint")val PLAYER_CONTROLS_TIMEOUT_SECONDS = intPreferencesKey("player_controls_timeout_seconds")val PLAYER_LIVE_OVERLAY_TIMEOUT_SECONDS = intPreferencesKey("player_live_overlay_timeout_seconds")+ val PLAYER_LIVE_CLOCK_ENABLED = booleanPreferencesKey("player_live_clock_enabled")+ val PLAYER_LIVE_CLOCK_POSITION = stringPreferencesKey("player_live_clock_position")+ val PLAYER_LIVE_CLOCK_SIZE = stringPreferencesKey("player_live_clock_size")+ val PLAYER_LIVE_CLOCK_FONT = stringPreferencesKey("player_live_clock_font")val PLAYER_NOTICE_TIMEOUT_SECONDS = intPreferencesKey("player_notice_timeout_seconds")val PLAYER_DIAGNOSTICS_TIMEOUT_SECONDS = intPreferencesKey("player_diagnostics_timeout_seconds")val PLAYER_WIFI_MAX_VIDEO_HEIGHT = intPreferencesKey("player_wifi_max_video_height")@@ -597,6 +604,22 @@ class PreferencesRepository @Inject constructor((preferences[PreferencesKeys.PLAYER_LIVE_OVERLAY_TIMEOUT_SECONDS] ?: 4).coerceIn(2, 60)}+ override val playerLiveClockEnabled: Flow<Boolean> = context.dataStore.data.map { preferences ->+ preferences[PreferencesKeys.PLAYER_LIVE_CLOCK_ENABLED] ?: false+ }++ override val playerLiveClockPosition: Flow<LiveClockPosition> = context.dataStore.data.map { preferences ->+ LiveClockPosition.fromStorage(preferences[PreferencesKeys.PLAYER_LIVE_CLOCK_POSITION])+ }++ override val playerLiveClockSize: Flow<LiveClockSize> = context.dataStore.data.map { preferences ->+ LiveClockSize.fromStorage(preferences[PreferencesKeys.PLAYER_LIVE_CLOCK_SIZE])+ }++ override val playerLiveClockFont: Flow<LiveClockFont> = context.dataStore.data.map { preferences ->+ LiveClockFont.fromStorage(preferences[PreferencesKeys.PLAYER_LIVE_CLOCK_FONT])+ }+override val playerNoticeTimeoutSeconds: Flow<Int> = context.dataStore.data.map { preferences ->(preferences[PreferencesKeys.PLAYER_NOTICE_TIMEOUT_SECONDS] ?: 6).coerceIn(2, 60)}@@ -1283,6 +1306,30 @@ class PreferencesRepository @Inject constructor(}}+ override suspend fun setPlayerLiveClockEnabled(enabled: Boolean) {+ context.dataStore.edit { preferences ->+ preferences[PreferencesKeys.PLAYER_LIVE_CLOCK_ENABLED] = enabled+ }+ }++ override suspend fun setPlayerLiveClockPosition(position: LiveClockPosition) {+ context.dataStore.edit { preferences ->+ preferences[PreferencesKeys.PLAYER_LIVE_CLOCK_POSITION] = position.storageValue+ }+ }++ override suspend fun setPlayerLiveClockSize(size: LiveClockSize) {+ context.dataStore.edit { preferences ->+ preferences[PreferencesKeys.PLAYER_LIVE_CLOCK_SIZE] = size.storageValue+ }+ }++ override suspend fun setPlayerLiveClockFont(font: LiveClockFont) {+ context.dataStore.edit { preferences ->+ preferences[PreferencesKeys.PLAYER_LIVE_CLOCK_FONT] = font.storageValue+ }+ }+override suspend fun setPlayerNoticeTimeoutSeconds(seconds: Int) {context.dataStore.edit { preferences ->preferences[PreferencesKeys.PLAYER_NOTICE_TIMEOUT_SECONDS] = seconds.coerceIn(2, 60)diff --git a/data/src/test/java/com/streamvault/data/preferences/PreferencesRepositoryLiveClockTest.kt b/data/src/test/java/com/streamvault/data/preferences/PreferencesRepositoryLiveClockTest.ktnew file mode 100644index 00000000..9ecb9a5e--- /dev/null+++ b/data/src/test/java/com/streamvault/data/preferences/PreferencesRepositoryLiveClockTest.kt@@ -0,0 +1,54 @@+package com.streamvault.data.preferences++import android.content.Context+import androidx.datastore.preferences.preferencesDataStoreFile+import com.google.common.truth.Truth.assertThat+import com.streamvault.data.local.dao.ChannelPreferenceDao+import com.streamvault.data.local.dao.SearchHistoryDao+import com.streamvault.domain.model.LiveClockFont+import com.streamvault.domain.model.LiveClockPosition+import com.streamvault.domain.model.LiveClockSize+import kotlinx.coroutines.flow.first+import kotlinx.coroutines.runBlocking+import org.junit.After+import org.junit.Before+import org.junit.Test+import org.junit.runner.RunWith+import org.mockito.kotlin.mock+import org.robolectric.RobolectricTestRunner+import org.robolectric.RuntimeEnvironment++@RunWith(RobolectricTestRunner::class)+class PreferencesRepositoryLiveClockTest {+ private lateinit var context: Context++ @Before+ fun setUp() {+ context = RuntimeEnvironment.getApplication()+ context.preferencesDataStoreFile("user_preferences").delete()+ }++ @After+ fun tearDown() {+ context.preferencesDataStoreFile("user_preferences").delete()+ }++ @Test+ fun `live clock preferences default safely and persist position changes`() = runBlocking {+ val repository = PreferencesRepository(+ context = context,+ channelPreferenceDao = mock<ChannelPreferenceDao>(),+ searchHistoryDao = mock<SearchHistoryDao>(),+ corruptionRecovery = mock<PreferencesCorruptionRecovery>()+ )++ assertThat(repository.playerLiveClockEnabled.first()).isFalse()+ assertThat(repository.playerLiveClockPosition.first()).isEqualTo(LiveClockPosition.TOP_END)+ assertThat(repository.playerLiveClockSize.first()).isEqualTo(LiveClockSize.MEDIUM)+ assertThat(repository.playerLiveClockFont.first()).isEqualTo(LiveClockFont.DIGITAL_MONO)++ repository.setPlayerLiveClockPosition(LiveClockPosition.BOTTOM_START)++ assertThat(repository.playerLiveClockPosition.first()).isEqualTo(LiveClockPosition.BOTTOM_START)+ }+}diff --git a/domain/src/main/java/com/streamvault/domain/model/LiveClockFont.kt b/domain/src/main/java/com/streamvault/domain/model/LiveClockFont.ktnew file mode 100644index 00000000..400b4ffe--- /dev/null+++ b/domain/src/main/java/com/streamvault/domain/model/LiveClockFont.kt@@ -0,0 +1,13 @@+package com.streamvault.domain.model++enum class LiveClockFont(val storageValue: String) {+ CLEAN("clean"),+ DIGITAL_MONO("digital_mono"),+ CLASSIC_SERIF("classic_serif");++ companion object {+ fun fromStorage(value: String?): LiveClockFont =+ entries.firstOrNull { it.storageValue.equals(value?.trim(), ignoreCase = true) }+ ?: DIGITAL_MONO+ }+}diff --git a/domain/src/main/java/com/streamvault/domain/model/LiveClockPosition.kt b/domain/src/main/java/com/streamvault/domain/model/LiveClockPosition.ktnew file mode 100644index 00000000..cf5925b9--- /dev/null+++ b/domain/src/main/java/com/streamvault/domain/model/LiveClockPosition.kt@@ -0,0 +1,14 @@+package com.streamvault.domain.model++enum class LiveClockPosition(val storageValue: String) {+ TOP_START("top_start"),+ TOP_END("top_end"),+ BOTTOM_START("bottom_start"),+ BOTTOM_END("bottom_end");++ companion object {+ fun fromStorage(value: String?): LiveClockPosition =+ entries.firstOrNull { it.storageValue.equals(value?.trim(), ignoreCase = true) }+ ?: TOP_END+ }+}diff --git a/domain/src/main/java/com/streamvault/domain/model/LiveClockSize.kt b/domain/src/main/java/com/streamvault/domain/model/LiveClockSize.ktnew file mode 100644index 00000000..89283332--- /dev/null+++ b/domain/src/main/java/com/streamvault/domain/model/LiveClockSize.kt@@ -0,0 +1,13 @@+package com.streamvault.domain.model++enum class LiveClockSize(val storageValue: String) {+ SMALL("small"),+ MEDIUM("medium"),+ LARGE("large");++ companion object {+ fun fromStorage(value: String?): LiveClockSize =+ entries.firstOrNull { it.storageValue.equals(value?.trim(), ignoreCase = true) }+ ?: MEDIUM+ }+}diff --git a/domain/src/main/java/com/streamvault/domain/settings/SettingsPreferences.kt b/domain/src/main/java/com/streamvault/domain/settings/SettingsPreferences.ktindex d9a3aeba..db0faa04 100644--- a/domain/src/main/java/com/streamvault/domain/settings/SettingsPreferences.kt+++ b/domain/src/main/java/com/streamvault/domain/settings/SettingsPreferences.kt@@ -13,6 +13,9 @@ import com.streamvault.domain.model.AppThemeimport com.streamvault.domain.model.LiveChannelGroupingModeimport com.streamvault.domain.model.LiveStreamFormatModeimport com.streamvault.domain.model.LiveVariantPreferenceMode+import com.streamvault.domain.model.LiveClockFont+import com.streamvault.domain.model.LiveClockPosition+import com.streamvault.domain.model.LiveClockSizeimport com.streamvault.domain.model.AppTopLevelDestinationimport com.streamvault.domain.model.PlaybackBufferModeimport com.streamvault.domain.model.VodDuplicateHandlingMode@@ -78,6 +81,14 @@ interface SettingsPreferences {val playerLiveOverlayTimeoutSeconds: Flow<Int>+ val playerLiveClockEnabled: Flow<Boolean>++ val playerLiveClockPosition: Flow<LiveClockPosition>++ val playerLiveClockSize: Flow<LiveClockSize>++ val playerLiveClockFont: Flow<LiveClockFont>+val playerNoticeTimeoutSeconds: Flow<Int>val playerDiagnosticsTimeoutSeconds: Flow<Int>@@ -242,6 +253,14 @@ interface SettingsPreferences {suspend fun setPlayerLiveOverlayTimeoutSeconds(seconds: Int)+ suspend fun setPlayerLiveClockEnabled(enabled: Boolean)++ suspend fun setPlayerLiveClockPosition(position: LiveClockPosition)++ suspend fun setPlayerLiveClockSize(size: LiveClockSize)++ suspend fun setPlayerLiveClockFont(font: LiveClockFont)+suspend fun setPlayerNoticeTimeoutSeconds(seconds: Int)suspend fun setPlayerDiagnosticsTimeoutSeconds(seconds: Int)diff --git a/domain/src/test/java/com/streamvault/domain/model/LiveClockPreferencesTest.kt b/domain/src/test/java/com/streamvault/domain/model/LiveClockPreferencesTest.ktnew file mode 100644index 00000000..5d02b18c--- /dev/null+++ b/domain/src/test/java/com/streamvault/domain/model/LiveClockPreferencesTest.kt@@ -0,0 +1,35 @@+package com.streamvault.domain.model++import com.google.common.truth.Truth.assertThat+import org.junit.Test++class LiveClockPreferencesTest {++ @Test+ fun `clock position storage values are stable and restore safely`() {+ assertThat(LiveClockPosition.entries.map(LiveClockPosition::storageValue)).containsExactly(+ "top_start",+ "top_end",+ "bottom_start",+ "bottom_end"+ ).inOrder()+ assertThat(LiveClockPosition.fromStorage(" bottom_start ")).isEqualTo(LiveClockPosition.BOTTOM_START)+ assertThat(LiveClockPosition.fromStorage("unknown")).isEqualTo(LiveClockPosition.TOP_END)+ }++ @Test+ fun `clock size and font storage values are stable`() {+ assertThat(LiveClockSize.entries.map(LiveClockSize::storageValue)).containsExactly(+ "small",+ "medium",+ "large"+ ).inOrder()+ assertThat(LiveClockFont.entries.map(LiveClockFont::storageValue)).containsExactly(+ "clean",+ "digital_mono",+ "classic_serif"+ ).inOrder()+ assertThat(LiveClockSize.fromStorage(null)).isEqualTo(LiveClockSize.MEDIUM)+ assertThat(LiveClockFont.fromStorage("digital_mono")).isEqualTo(LiveClockFont.DIGITAL_MONO)+ }+}diff --git a/feature/playback/src/main/java/com/streamvault/feature/playback/player/LiveClockFormatting.kt b/feature/playback/src/main/java/com/streamvault/feature/playback/player/LiveClockFormatting.ktnew file mode 100644index 00000000..632f6cb1--- /dev/null+++ b/feature/playback/src/main/java/com/streamvault/feature/playback/player/LiveClockFormatting.kt@@ -0,0 +1,23 @@+package com.streamvault.feature.playback.player++import com.streamvault.domain.model.AppTimeFormat+import java.text.DateFormat+import java.text.SimpleDateFormat+import java.util.Date+import java.util.Locale+import java.util.TimeZone++internal fun formatLiveClock(+ timestampMs: Long,+ timeFormat: AppTimeFormat,+ locale: Locale = Locale.getDefault(),+ timeZone: TimeZone = TimeZone.getDefault()+): String {+ val formatter: DateFormat = when (timeFormat) {+ AppTimeFormat.SYSTEM -> DateFormat.getTimeInstance(DateFormat.SHORT, locale)+ AppTimeFormat.TWELVE_HOUR -> SimpleDateFormat("h:mm a", locale)+ AppTimeFormat.TWENTY_FOUR_HOUR -> SimpleDateFormat("HH:mm", locale)+ }+ formatter.timeZone = timeZone+ return formatter.format(Date(timestampMs))+}diff --git a/feature/playback/src/main/java/com/streamvault/feature/playback/player/LiveClockOverlay.kt b/feature/playback/src/main/java/com/streamvault/feature/playback/player/LiveClockOverlay.ktnew file mode 100644index 00000000..df876e98--- /dev/null+++ b/feature/playback/src/main/java/com/streamvault/feature/playback/player/LiveClockOverlay.kt@@ -0,0 +1,95 @@+package com.streamvault.feature.playback.player++import androidx.compose.foundation.background+import androidx.compose.foundation.layout.BoxScope+import androidx.compose.foundation.layout.padding+import androidx.compose.foundation.shape.RoundedCornerShape+import androidx.compose.runtime.Composable+import androidx.compose.runtime.LaunchedEffect+import androidx.compose.runtime.getValue+import androidx.compose.runtime.mutableLongStateOf+import androidx.compose.runtime.remember+import androidx.compose.runtime.setValue+import androidx.compose.ui.Alignment+import androidx.compose.ui.Modifier+import androidx.compose.ui.draw.shadow+import androidx.compose.ui.graphics.Color+import androidx.compose.ui.graphics.Shadow+import androidx.compose.ui.text.TextStyle+import androidx.compose.ui.text.font.FontFamily+import androidx.compose.ui.text.font.FontWeight+import androidx.compose.ui.unit.dp+import androidx.compose.ui.unit.sp+import androidx.tv.material3.Text+import com.streamvault.domain.model.AppTimeFormat+import com.streamvault.domain.model.LiveClockFont+import com.streamvault.domain.model.LiveClockPosition+import com.streamvault.domain.model.LiveClockSize+import kotlinx.coroutines.delay++internal fun shouldShowLiveClock(+ contentType: String,+ isCatchUpPlayback: Boolean,+ isInPictureInPictureMode: Boolean,+ enabled: Boolean+): Boolean = enabled &&+ contentType == "LIVE" &&+ !isCatchUpPlayback &&+ !isInPictureInPictureMode++@Composable+internal fun BoxScope.LiveClockOverlay(+ timeFormat: AppTimeFormat,+ position: LiveClockPosition,+ size: LiveClockSize,+ font: LiveClockFont,+ modifier: Modifier = Modifier+) {+ var nowMs by remember { mutableLongStateOf(System.currentTimeMillis()) }++ LaunchedEffect(Unit) {+ while (true) {+ nowMs = System.currentTimeMillis()+ delay(1_000L)+ }+ }++ Text(+ text = formatLiveClock(nowMs, timeFormat),+ style = TextStyle(+ color = Color.White,+ fontSize = size.textSize,+ fontFamily = font.fontFamily,+ fontWeight = FontWeight.Bold,+ letterSpacing = 0.4.sp,+ shadow = Shadow(color = Color.Black, blurRadius = 4f)+ ),+ modifier = modifier+ .align(position.alignment)+ .shadow(elevation = 2.dp, shape = RoundedCornerShape(9.dp))+ .background(Color.Black.copy(alpha = 0.56f), RoundedCornerShape(9.dp))+ .padding(horizontal = 10.dp, vertical = 5.dp)+ )+}++private val LiveClockPosition.alignment: Alignment+ get() = when (this) {+ LiveClockPosition.TOP_START -> Alignment.TopStart+ LiveClockPosition.TOP_END -> Alignment.TopEnd+ LiveClockPosition.BOTTOM_START -> Alignment.BottomStart+ LiveClockPosition.BOTTOM_END -> Alignment.BottomEnd+ }++private val LiveClockSize.textSize+ get() = when (this) {+ LiveClockSize.SMALL -> 18.sp+ LiveClockSize.MEDIUM -> 26.sp+ LiveClockSize.LARGE -> 34.sp+ }++private val LiveClockFont.fontFamily+ get() = when (this) {+ LiveClockFont.CLEAN -> FontFamily.SansSerif+ LiveClockFont.DIGITAL_MONO -> FontFamily.Monospace+ LiveClockFont.CLASSIC_SERIF -> FontFamily.Serif+ }diff --git a/feature/playback/src/main/java/com/streamvault/feature/playback/player/PlayerPreferencesCoordinator.kt b/feature/playback/src/main/java/com/streamvault/feature/playback/player/PlayerPreferencesCoordinator.ktindex 2844298d..082a922f 100644--- a/feature/playback/src/main/java/com/streamvault/feature/playback/player/PlayerPreferencesCoordinator.kt+++ b/feature/playback/src/main/java/com/streamvault/feature/playback/player/PlayerPreferencesCoordinator.kt@@ -20,6 +20,7 @@ class PlayerPreferencesCoordinator @Inject constructor(private val preferencesRepository: PlayerPreferences,) {internal val appLanguage get() = preferencesRepository.appLanguage+ internal val appTimeFormat get() = preferencesRepository.appTimeFormatinternal val autoPlayNextEpisode get() = preferencesRepository.autoPlayNextEpisodeinternal val defaultIdleStandbyTimerMinutes get() = preferencesRepository.defaultIdleStandbyTimerMinutesinternal val defaultStopPlaybackTimerMinutes get() = preferencesRepository.defaultStopPlaybackTimerMinutes@@ -36,6 +37,10 @@ class PlayerPreferencesCoordinator @Inject constructor(internal val playerExternalPlaybackMode get() = preferencesRepository.playerExternalPlaybackModeinternal val playerFastRetryOnTransientFailures get() = preferencesRepository.playerFastRetryOnTransientFailuresinternal val playerLiveOverlayTimeoutSeconds get() = preferencesRepository.playerLiveOverlayTimeoutSeconds+ internal val playerLiveClockEnabled get() = preferencesRepository.playerLiveClockEnabled+ internal val playerLiveClockPosition get() = preferencesRepository.playerLiveClockPosition+ internal val playerLiveClockSize get() = preferencesRepository.playerLiveClockSize+ internal val playerLiveClockFont get() = preferencesRepository.playerLiveClockFontinternal val playerLiveTranslationEnabled get() = preferencesRepository.playerLiveTranslationEnabledinternal val playerLiveTranslationEndpoint get() = preferencesRepository.playerLiveTranslationEndpointinternal val playerMediaSessionEnabled get() = preferencesRepository.playerMediaSessionEnableddiff --git a/feature/playback/src/main/java/com/streamvault/feature/playback/player/PlayerScreen.kt b/feature/playback/src/main/java/com/streamvault/feature/playback/player/PlayerScreen.ktindex 490beabc..ed05edbd 100644--- a/feature/playback/src/main/java/com/streamvault/feature/playback/player/PlayerScreen.kt+++ b/feature/playback/src/main/java/com/streamvault/feature/playback/player/PlayerScreen.kt@@ -86,6 +86,7 @@ import com.streamvault.feature.playback.player.overlay.PlayerNumericInputOverlayimport com.streamvault.feature.playback.player.overlay.PlayerResolutionBadgeimport com.streamvault.feature.playback.player.overlay.PlayerSleepTimerWarningOverlayimport com.streamvault.feature.playback.player.overlay.NextEpisodeCountdownOverlay+import com.streamvault.feature.playback.player.LiveClockOverlayimport com.streamvault.core.navigation.AppDestination@@ -167,6 +168,7 @@ fun PlayerScreen(val playerNotice by viewModel.playerNotice.collectAsStateWithLifecycle()val preventStandbyDuringPlayback by viewModel.preventStandbyDuringPlayback.collectAsStateWithLifecycle()val sleepTimerExitEvent by viewModel.sleepTimerExitEvent.collectAsStateWithLifecycle()+ val playerPreferences by viewModel.playerPreferencesUiState.collectAsStateWithLifecycle()var modalState by remember { mutableStateOf(PlayerModalState()) }var channelInfoSubPanelOpen by remember { mutableStateOf(false) }@@ -702,6 +704,22 @@ fun PlayerScreen()}+ if (shouldShowLiveClock(+ contentType = contentType,+ isCatchUpPlayback = isCatchUpPlayback,+ isInPictureInPictureMode = isInPictureInPictureMode,+ enabled = playerPreferences.liveClockEnabled+ )+ ) {+ LiveClockOverlay(+ timeFormat = playerPreferences.timeFormat,+ position = playerPreferences.liveClockPosition,+ size = playerPreferences.liveClockSize,+ font = playerPreferences.liveClockFont,+ modifier = Modifier.padding(24.dp)+ )+ }+PlayerControlsOverlayHost(playerEngine = playerEngine,viewModel = viewModel,diff --git a/feature/playback/src/main/java/com/streamvault/feature/playback/player/PlayerViewModel.kt b/feature/playback/src/main/java/com/streamvault/feature/playback/player/PlayerViewModel.ktindex 0ae3de17..146d9fe0 100644--- a/feature/playback/src/main/java/com/streamvault/feature/playback/player/PlayerViewModel.kt+++ b/feature/playback/src/main/java/com/streamvault/feature/playback/player/PlayerViewModel.kt@@ -689,10 +689,26 @@ class PlayerViewModel @Inject constructor(activePlayerEngineFlow.flatMapLatest { it.timeshiftState }.collect(::applyTimeshiftState)}viewModelScope.launch {- playerPreferencesCoordinator.playerExternalPlaybackMode.collect { mode ->- _playerPreferencesUiState.value = PlayerPreferencesUiState(- externalPlaybackMode = mode+ combine(+ combine(+ playerPreferencesCoordinator.playerExternalPlaybackMode,+ playerPreferencesCoordinator.appTimeFormat+ ) { externalPlaybackMode, timeFormat -> externalPlaybackMode to timeFormat },+ playerPreferencesCoordinator.playerLiveClockEnabled,+ playerPreferencesCoordinator.playerLiveClockPosition,+ playerPreferencesCoordinator.playerLiveClockSize,+ playerPreferencesCoordinator.playerLiveClockFont+ ) { (externalPlaybackMode, timeFormat), liveClockEnabled, liveClockPosition, liveClockSize, liveClockFont ->+ PlayerPreferencesUiState(+ externalPlaybackMode = externalPlaybackMode,+ timeFormat = timeFormat,+ liveClockEnabled = liveClockEnabled,+ liveClockPosition = liveClockPosition,+ liveClockSize = liveClockSize,+ liveClockFont = liveClockFont)+ }.collect { state ->+ _playerPreferencesUiState.value = state}}viewModelScope.launch {diff --git a/feature/playback/src/main/java/com/streamvault/feature/playback/player/PlayerViewModelModels.kt b/feature/playback/src/main/java/com/streamvault/feature/playback/player/PlayerViewModelModels.ktindex c23469f8..70be4e9e 100644--- a/feature/playback/src/main/java/com/streamvault/feature/playback/player/PlayerViewModelModels.kt+++ b/feature/playback/src/main/java/com/streamvault/feature/playback/player/PlayerViewModelModels.kt@@ -4,8 +4,12 @@ import android.graphics.Bitmapimport com.streamvault.domain.model.Channelimport com.streamvault.domain.model.ChannelQualityOptionimport com.streamvault.domain.model.ContentType+import com.streamvault.domain.model.AppTimeFormatimport com.streamvault.domain.model.Episodeimport com.streamvault.domain.model.ExternalPlaybackMode+import com.streamvault.domain.model.LiveClockFont+import com.streamvault.domain.model.LiveClockPosition+import com.streamvault.domain.model.LiveClockSizeimport com.streamvault.domain.model.Seasonimport com.streamvault.domain.model.Seriesimport com.streamvault.domain.model.DecoderMode@@ -41,7 +45,12 @@ data class SeekPreviewState()data class PlayerPreferencesUiState(- val externalPlaybackMode: ExternalPlaybackMode = ExternalPlaybackMode.INTERNAL_PLAYER+ val externalPlaybackMode: ExternalPlaybackMode = ExternalPlaybackMode.INTERNAL_PLAYER,+ val timeFormat: AppTimeFormat = AppTimeFormat.SYSTEM,+ val liveClockEnabled: Boolean = false,+ val liveClockPosition: LiveClockPosition = LiveClockPosition.TOP_END,+ val liveClockSize: LiveClockSize = LiveClockSize.MEDIUM,+ val liveClockFont: LiveClockFont = LiveClockFont.DIGITAL_MONO)data class PlayerDiagnosticsUiState(diff --git a/feature/playback/src/test/java/com/streamvault/feature/playback/player/LiveClockFormattingTest.kt b/feature/playback/src/test/java/com/streamvault/feature/playback/player/LiveClockFormattingTest.ktnew file mode 100644index 00000000..23b878c6--- /dev/null+++ b/feature/playback/src/test/java/com/streamvault/feature/playback/player/LiveClockFormattingTest.kt@@ -0,0 +1,39 @@+package com.streamvault.feature.playback.player++import com.google.common.truth.Truth.assertThat+import com.streamvault.domain.model.AppTimeFormat+import java.time.Instant+import java.time.ZoneId+import java.util.Locale+import java.util.TimeZone+import org.junit.Test++class LiveClockFormattingTest {++ private val timestamp = Instant.parse("2026-01-02T17:05:00Z").toEpochMilli()+ private val utc = TimeZone.getTimeZone(ZoneId.of("UTC"))++ @Test+ fun `twelve hour format includes meridiem`() {+ assertThat(formatLiveClock(timestamp, AppTimeFormat.TWELVE_HOUR, Locale.US, utc))+ .isEqualTo("5:05 PM")+ }++ @Test+ fun `twenty four hour format uses leading hour`() {+ assertThat(formatLiveClock(timestamp, AppTimeFormat.TWENTY_FOUR_HOUR, Locale.US, utc))+ .isEqualTo("17:05")+ }++ @Test+ fun `clock is only visible for enabled non catch up live playback`() {+ assertThat(shouldShowLiveClock("LIVE", isCatchUpPlayback = false, isInPictureInPictureMode = false, enabled = true))+ .isTrue()+ assertThat(shouldShowLiveClock("LIVE", isCatchUpPlayback = true, isInPictureInPictureMode = false, enabled = true))+ .isFalse()+ assertThat(shouldShowLiveClock("MOVIE", isCatchUpPlayback = false, isInPictureInPictureMode = false, enabled = true))+ .isFalse()+ assertThat(shouldShowLiveClock("LIVE", isCatchUpPlayback = false, isInPictureInPictureMode = true, enabled = true))+ .isFalse()+ }+}diff --git a/feature/settings/src/main/java/com/streamvault/feature/settings/presentation/SettingsPlaybackSection.kt b/feature/settings/src/main/java/com/streamvault/feature/settings/presentation/SettingsPlaybackSection.ktindex 851117b3..9ab75324 100644--- a/feature/settings/src/main/java/com/streamvault/feature/settings/presentation/SettingsPlaybackSection.kt+++ b/feature/settings/src/main/java/com/streamvault/feature/settings/presentation/SettingsPlaybackSection.kt@@ -30,6 +30,9 @@ import com.streamvault.core.ui.theme.OnBackgroundimport com.streamvault.core.ui.theme.OnSurfaceimport com.streamvault.core.ui.theme.Primaryimport com.streamvault.domain.model.LiveStreamFormatMode+import com.streamvault.domain.model.LiveClockFont+import com.streamvault.domain.model.LiveClockPosition+import com.streamvault.domain.model.LiveClockSizepublic fun LazyListScope.settingsPlaybackSection(uiState: SettingsUiState,@@ -114,6 +117,136 @@ public fun LazyListScope.settingsPlaybackSection(}}}+ var showLiveClockPositionDialog by rememberSaveable { mutableStateOf(false) }+ var showLiveClockSizeDialog by rememberSaveable { mutableStateOf(false) }+ var showLiveClockFontDialog by rememberSaveable { mutableStateOf(false) }++ if (showLiveClockPositionDialog) {+ val positionLabels = mapOf(+ LiveClockPosition.TOP_START to stringResource(R.string.settings_live_clock_position_top_left),+ LiveClockPosition.TOP_END to stringResource(R.string.settings_live_clock_position_top_right),+ LiveClockPosition.BOTTOM_START to stringResource(R.string.settings_live_clock_position_bottom_left),+ LiveClockPosition.BOTTOM_END to stringResource(R.string.settings_live_clock_position_bottom_right)+ )+ PremiumSelectionDialog(+ title = stringResource(R.string.settings_select_live_clock_position),+ onDismiss = { showLiveClockPositionDialog = false }+ ) {+ LiveClockPosition.entries.forEachIndexed { index, position ->+ LevelOption(+ level = index,+ text = positionLabels.getValue(position),+ currentLevel = if (uiState.playerLiveClockPosition == position) index else -1,+ onSelect = {+ viewModel.setPlayerLiveClockPosition(position)+ showLiveClockPositionDialog = false+ }+ )+ }+ }+ }++ if (showLiveClockSizeDialog) {+ val sizeLabels = mapOf(+ LiveClockSize.SMALL to stringResource(R.string.settings_live_clock_size_small),+ LiveClockSize.MEDIUM to stringResource(R.string.settings_live_clock_size_medium),+ LiveClockSize.LARGE to stringResource(R.string.settings_live_clock_size_large)+ )+ PremiumSelectionDialog(+ title = stringResource(R.string.settings_select_live_clock_size),+ onDismiss = { showLiveClockSizeDialog = false }+ ) {+ LiveClockSize.entries.forEachIndexed { index, size ->+ LevelOption(+ level = index,+ text = sizeLabels.getValue(size),+ currentLevel = if (uiState.playerLiveClockSize == size) index else -1,+ onSelect = {+ viewModel.setPlayerLiveClockSize(size)+ showLiveClockSizeDialog = false+ }+ )+ }+ }+ }++ if (showLiveClockFontDialog) {+ val fontLabels = mapOf(+ LiveClockFont.CLEAN to stringResource(R.string.settings_live_clock_font_clean),+ LiveClockFont.DIGITAL_MONO to stringResource(R.string.settings_live_clock_font_digital_mono),+ LiveClockFont.CLASSIC_SERIF to stringResource(R.string.settings_live_clock_font_classic_serif)+ )+ PremiumSelectionDialog(+ title = stringResource(R.string.settings_select_live_clock_font),+ onDismiss = { showLiveClockFontDialog = false }+ ) {+ LiveClockFont.entries.forEachIndexed { index, font ->+ LevelOption(+ level = index,+ text = fontLabels.getValue(font),+ currentLevel = if (uiState.playerLiveClockFont == font) index else -1,+ onSelect = {+ viewModel.setPlayerLiveClockFont(font)+ showLiveClockFontDialog = false+ }+ )+ }+ }+ }++ TvClickableSurface(+ onClick = { viewModel.setPlayerLiveClockEnabled(!uiState.playerLiveClockEnabled) },+ shape = ClickableSurfaceDefaults.shape(RoundedCornerShape(8.dp)),+ colors = ClickableSurfaceDefaults.colors(+ containerColor = Color.Transparent,+ focusedContainerColor = Primary.copy(alpha = 0.15f)+ ),+ scale = ClickableSurfaceDefaults.scale(focusedScale = 1f),+ modifier = Modifier.fillMaxWidth()+ ) {+ Row(+ modifier = Modifier.fillMaxWidth().padding(horizontal = 8.dp, vertical = 12.dp),+ horizontalArrangement = Arrangement.SpaceBetween,+ verticalAlignment = Alignment.CenterVertically+ ) {+ Column(modifier = Modifier.weight(1f)) {+ Text(text = stringResource(R.string.settings_live_clock), style = MaterialTheme.typography.bodyMedium, color = OnSurface)+ Text(text = stringResource(R.string.settings_live_clock_subtitle), style = MaterialTheme.typography.bodySmall, color = OnBackground.copy(alpha = 0.6f))+ }+ Switch(checked = uiState.playerLiveClockEnabled, onCheckedChange = { viewModel.setPlayerLiveClockEnabled(it) })+ }+ }+ if (uiState.playerLiveClockEnabled) {+ ClickableSettingsRow(+ label = stringResource(R.string.settings_live_clock_position),+ value = when (uiState.playerLiveClockPosition) {+ LiveClockPosition.TOP_START -> stringResource(R.string.settings_live_clock_position_top_left)+ LiveClockPosition.TOP_END -> stringResource(R.string.settings_live_clock_position_top_right)+ LiveClockPosition.BOTTOM_START -> stringResource(R.string.settings_live_clock_position_bottom_left)+ LiveClockPosition.BOTTOM_END -> stringResource(R.string.settings_live_clock_position_bottom_right)+ },+ onClick = { showLiveClockPositionDialog = true }+ )+ ClickableSettingsRow(+ label = stringResource(R.string.settings_live_clock_size),+ value = when (uiState.playerLiveClockSize) {+ LiveClockSize.SMALL -> stringResource(R.string.settings_live_clock_size_small)+ LiveClockSize.MEDIUM -> stringResource(R.string.settings_live_clock_size_medium)+ LiveClockSize.LARGE -> stringResource(R.string.settings_live_clock_size_large)+ },+ onClick = { showLiveClockSizeDialog = true }+ )+ ClickableSettingsRow(+ label = stringResource(R.string.settings_live_clock_font),+ value = when (uiState.playerLiveClockFont) {+ LiveClockFont.CLEAN -> stringResource(R.string.settings_live_clock_font_clean)+ LiveClockFont.DIGITAL_MONO -> stringResource(R.string.settings_live_clock_font_digital_mono)+ LiveClockFont.CLASSIC_SERIF -> stringResource(R.string.settings_live_clock_font_classic_serif)+ },+ onClick = { showLiveClockFontDialog = true }+ )+ }+ HorizontalDivider(color = Color.White.copy(alpha = 0.07f), modifier = Modifier.padding(vertical = 4.dp))TvClickableSurface(onClick = { viewModel.setPreventStandbyDuringPlayback(!uiState.preventStandbyDuringPlayback) },shape = ClickableSurfaceDefaults.shape(RoundedCornerShape(8.dp)),diff --git a/feature/settings/src/main/java/com/streamvault/feature/settings/presentation/SettingsPreferenceModels.kt b/feature/settings/src/main/java/com/streamvault/feature/settings/presentation/SettingsPreferenceModels.ktindex 4d5217c6..af6d40e5 100644--- a/feature/settings/src/main/java/com/streamvault/feature/settings/presentation/SettingsPreferenceModels.kt+++ b/feature/settings/src/main/java/com/streamvault/feature/settings/presentation/SettingsPreferenceModels.kt@@ -19,6 +19,9 @@ import com.streamvault.domain.model.DecoderModeimport com.streamvault.domain.model.GroupedChannelLabelModeimport com.streamvault.domain.model.LiveChannelGroupingModeimport com.streamvault.domain.model.LiveVariantPreferenceMode+import com.streamvault.domain.model.LiveClockFont+import com.streamvault.domain.model.LiveClockPosition+import com.streamvault.domain.model.LiveClockSizeimport com.streamvault.domain.model.PlaybackBufferModeimport com.streamvault.domain.model.VodDuplicateHandlingModeimport com.streamvault.domain.model.VodHttpProtocolMode@@ -72,6 +75,10 @@ data class SettingsPreferenceSnapshot(val multiViewRespectProviderConnectionLimit: Boolean,val playerControlsTimeoutSeconds: Int,val playerLiveOverlayTimeoutSeconds: Int,+ val playerLiveClockEnabled: Boolean = false,+ val playerLiveClockPosition: LiveClockPosition = LiveClockPosition.TOP_END,+ val playerLiveClockSize: LiveClockSize = LiveClockSize.MEDIUM,+ val playerLiveClockFont: LiveClockFont = LiveClockFont.DIGITAL_MONO,val playerNoticeTimeoutSeconds: Int,val playerDiagnosticsTimeoutSeconds: Int,val subtitleTextScale: Float,diff --git a/feature/settings/src/main/java/com/streamvault/feature/settings/presentation/SettingsPreferenceSnapshotMapper.kt b/feature/settings/src/main/java/com/streamvault/feature/settings/presentation/SettingsPreferenceSnapshotMapper.ktindex 0bf2e8f3..4d40c115 100644--- a/feature/settings/src/main/java/com/streamvault/feature/settings/presentation/SettingsPreferenceSnapshotMapper.kt+++ b/feature/settings/src/main/java/com/streamvault/feature/settings/presentation/SettingsPreferenceSnapshotMapper.kt@@ -34,6 +34,10 @@ fun SettingsUiState.applyPreferenceSnapshot(multiViewRespectProviderConnectionLimit = snapshot.multiViewRespectProviderConnectionLimit,playerControlsTimeoutSeconds = snapshot.playerControlsTimeoutSeconds,playerLiveOverlayTimeoutSeconds = snapshot.playerLiveOverlayTimeoutSeconds,+ playerLiveClockEnabled = snapshot.playerLiveClockEnabled,+ playerLiveClockPosition = snapshot.playerLiveClockPosition,+ playerLiveClockSize = snapshot.playerLiveClockSize,+ playerLiveClockFont = snapshot.playerLiveClockFont,playerNoticeTimeoutSeconds = snapshot.playerNoticeTimeoutSeconds,playerDiagnosticsTimeoutSeconds = snapshot.playerDiagnosticsTimeoutSeconds,subtitleTextScale = snapshot.subtitleTextScale,diff --git a/feature/settings/src/main/java/com/streamvault/feature/settings/presentation/SettingsStateBindings.kt b/feature/settings/src/main/java/com/streamvault/feature/settings/presentation/SettingsStateBindings.ktindex 571851fb..3d7d288a 100644--- a/feature/settings/src/main/java/com/streamvault/feature/settings/presentation/SettingsStateBindings.kt+++ b/feature/settings/src/main/java/com/streamvault/feature/settings/presentation/SettingsStateBindings.kt@@ -70,6 +70,10 @@ fun observeSettingsPreferenceSnapshot(multiViewRespectProviderConnectionLimit = true,playerControlsTimeoutSeconds = 5,playerLiveOverlayTimeoutSeconds = 4,+ playerLiveClockEnabled = false,+ playerLiveClockPosition = com.streamvault.domain.model.LiveClockPosition.TOP_END,+ playerLiveClockSize = com.streamvault.domain.model.LiveClockSize.MEDIUM,+ playerLiveClockFont = com.streamvault.domain.model.LiveClockFont.DIGITAL_MONO,playerNoticeTimeoutSeconds = 6,playerDiagnosticsTimeoutSeconds = 15,subtitleTextScale = 1f,@@ -174,6 +178,14 @@ fun observeSettingsPreferenceSnapshot(snapshot.copy(playerControlsTimeoutSeconds = timeoutSeconds)}.combine(preferencesRepository.playerLiveOverlayTimeoutSeconds) { snapshot, timeoutSeconds ->snapshot.copy(playerLiveOverlayTimeoutSeconds = timeoutSeconds)+ }.combine(preferencesRepository.playerLiveClockEnabled) { snapshot, enabled ->+ snapshot.copy(playerLiveClockEnabled = enabled)+ }.combine(preferencesRepository.playerLiveClockPosition) { snapshot, position ->+ snapshot.copy(playerLiveClockPosition = position)+ }.combine(preferencesRepository.playerLiveClockSize) { snapshot, size ->+ snapshot.copy(playerLiveClockSize = size)+ }.combine(preferencesRepository.playerLiveClockFont) { snapshot, font ->+ snapshot.copy(playerLiveClockFont = font)}.combine(preferencesRepository.playerNoticeTimeoutSeconds) { snapshot, timeoutSeconds ->snapshot.copy(playerNoticeTimeoutSeconds = timeoutSeconds)}.combine(preferencesRepository.playerDiagnosticsTimeoutSeconds) { snapshot, timeoutSeconds ->diff --git a/feature/settings/src/main/java/com/streamvault/feature/settings/presentation/SettingsUiStateModel.kt b/feature/settings/src/main/java/com/streamvault/feature/settings/presentation/SettingsUiStateModel.ktindex c38ed794..9c17dc70 100644--- a/feature/settings/src/main/java/com/streamvault/feature/settings/presentation/SettingsUiStateModel.kt+++ b/feature/settings/src/main/java/com/streamvault/feature/settings/presentation/SettingsUiStateModel.kt@@ -30,6 +30,9 @@ import com.streamvault.domain.model.EpgResolutionSummaryimport com.streamvault.domain.model.GroupedChannelLabelModeimport com.streamvault.domain.model.LiveChannelGroupingModeimport com.streamvault.domain.model.LiveVariantPreferenceMode+import com.streamvault.domain.model.LiveClockFont+import com.streamvault.domain.model.LiveClockPosition+import com.streamvault.domain.model.LiveClockSizeimport com.streamvault.domain.model.PlaybackBufferModeimport com.streamvault.domain.model.VodDuplicateHandlingModeimport com.streamvault.domain.model.VodHttpProtocolMode@@ -97,6 +100,10 @@ data class SettingsUiState(val multiViewRespectProviderConnectionLimit: Boolean = true,val playerControlsTimeoutSeconds: Int = 5,val playerLiveOverlayTimeoutSeconds: Int = 4,+ val playerLiveClockEnabled: Boolean = false,+ val playerLiveClockPosition: LiveClockPosition = LiveClockPosition.TOP_END,+ val playerLiveClockSize: LiveClockSize = LiveClockSize.MEDIUM,+ val playerLiveClockFont: LiveClockFont = LiveClockFont.DIGITAL_MONO,val playerNoticeTimeoutSeconds: Int = 6,val playerDiagnosticsTimeoutSeconds: Int = 15,val subtitleTextScale: Float = 1f,diff --git a/feature/settings/src/main/java/com/streamvault/feature/settings/presentation/SettingsViewModel.kt b/feature/settings/src/main/java/com/streamvault/feature/settings/presentation/SettingsViewModel.ktindex cef47f3b..98e97507 100644--- a/feature/settings/src/main/java/com/streamvault/feature/settings/presentation/SettingsViewModel.kt+++ b/feature/settings/src/main/java/com/streamvault/feature/settings/presentation/SettingsViewModel.kt@@ -927,6 +927,30 @@ class SettingsViewModel @Inject constructor(}}+ fun setPlayerLiveClockEnabled(enabled: Boolean) {+ viewModelScope.launch {+ preferencesRepository.setPlayerLiveClockEnabled(enabled)+ }+ }++ fun setPlayerLiveClockPosition(position: com.streamvault.domain.model.LiveClockPosition) {+ viewModelScope.launch {+ preferencesRepository.setPlayerLiveClockPosition(position)+ }+ }++ fun setPlayerLiveClockSize(size: com.streamvault.domain.model.LiveClockSize) {+ viewModelScope.launch {+ preferencesRepository.setPlayerLiveClockSize(size)+ }+ }++ fun setPlayerLiveClockFont(font: com.streamvault.domain.model.LiveClockFont) {+ viewModelScope.launch {+ preferencesRepository.setPlayerLiveClockFont(font)+ }+ }+fun setPlayerNoticeTimeoutSeconds(seconds: Int) {viewModelScope.launch {preferencesRepository.setPlayerNoticeTimeoutSeconds(seconds)diff --git a/feature/settings/src/main/res/values/strings.xml b/feature/settings/src/main/res/values/strings.xmlindex d3a2a2c5..381456ea 100644--- a/feature/settings/src/main/res/values/strings.xml+++ b/feature/settings/src/main/res/values/strings.xml@@ -168,6 +168,11 @@<string name="settings_live_timeshift_backend_subtitle">Choose whether local live rewind buffers to app storage or bounded memory. Automatic prefers storage and falls back to memory when the storage backend is constrained.</string><string name="settings_live_timeshift_depth">Local Live Rewind Depth</string><string name="settings_live_timeshift_subtitle">Keep a temporary local buffer for pausing and rewinding live TV even when the provider has no catch-up support.</string>+ <string name="settings_live_clock">Show Live TV Clock</string>+ <string name="settings_live_clock_subtitle">Keep the current time visible over live TV. The clock follows the Time Format setting.</string>+ <string name="settings_live_clock_position">Clock Position</string>+ <string name="settings_live_clock_size">Clock Size</string>+ <string name="settings_live_clock_font">Clock Font</string><string name="settings_live_translation_enabled">Enable Live Translation Subtitles</string><string name="settings_live_translation_enabled_subtitle">Translate spoken live-channel audio into English subtitles using your local Whisper service.</string><string name="settings_media_session">System Media Session</string>@@ -259,6 +264,19 @@<string name="settings_live_timeshift_depth_15">15 minutes</string><string name="settings_live_timeshift_depth_30">30 minutes</string><string name="settings_live_timeshift_depth_60">60 minutes</string>+ <string name="settings_live_clock_position_top_left">Top left</string>+ <string name="settings_live_clock_position_top_right">Top right</string>+ <string name="settings_live_clock_position_bottom_left">Bottom left</string>+ <string name="settings_live_clock_position_bottom_right">Bottom right</string>+ <string name="settings_live_clock_size_small">Small</string>+ <string name="settings_live_clock_size_medium">Medium</string>+ <string name="settings_live_clock_size_large">Large</string>+ <string name="settings_live_clock_font_clean">Clean</string>+ <string name="settings_live_clock_font_digital_mono">Digital Mono</string>+ <string name="settings_live_clock_font_classic_serif">Classic Serif</string>+ <string name="settings_select_live_clock_position">Select clock position</string>+ <string name="settings_select_live_clock_size">Select clock size</string>+ <string name="settings_select_live_clock_font">Select clock font</string><string name="settings_live_translation_endpoint">Live Translation Service Endpoint</string><string name="settings_live_translation_endpoint_empty_error">Live translation endpoint cannot be empty.</string><string name="settings_live_translation_endpoint_subtitle">Base URL for the local translation service (emulator default: http://10.0.2.2:8765).</string>