Skip to content
Open
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
6ad4de4
fix(player): time Up Next from the end of the file, not the credits m…
Rhainland Nov 18, 2026
445ca87
fix(tv): keep returning the series page to the next episode from the …
Rhainland Nov 18, 2026
9a0ef16
feat(player): let viewers turn Next Up off
Rhainland Nov 18, 2026
fa22e02
fix(settings): make a Show Next Up time this device's whole choice
Rhainland Nov 18, 2026
4c481a2
fix(tv): leave a hand-opened Up Next without a countdown at the promp…
Quick104 Nov 19, 2026
c693acd
Merge branch 'review/fix-994' into review/fix-995
Quick104 Nov 19, 2026
85cf2c3
fix(player): keep a Show Next Up time and the final position when Off…
Quick104 Nov 19, 2026
f6fdb38
Merge branch 'main' into feat/next-up-off
Quick104 Nov 23, 2026
de577ed
fix(player): arm no Up Next once Next Up is off while the next episod…
Quick104 Nov 23, 2026
966f8d8
Merge main into feat/next-up-off
Quick104 Nov 24, 2026
635f5ec
chore(settings): re-vendor the settings contract from silo-server#450…
Quick104 Nov 24, 2026
3927ac8
fix(settings): drop the Next Up override marker a server without the …
Quick104 Nov 24, 2026
b48f48b
fix(player): honor Next Up Off in picture-in-picture and on a running…
Quick104 Nov 24, 2026
41e4931
fix(player): leave the player when the last thing holding it open aft…
Quick104 Nov 24, 2026
31647af
fix(player): close when Next Up turns off while the end screen waits …
Quick104 Nov 24, 2026
33ac5cb
fix(player): close when Next Up turns off while an automatic end card…
Quick104 Nov 24, 2026
67d1743
fix(player): clear an automatic Up Next card when Next Up turns off b…
Quick104 Nov 24, 2026
3bea593
fix(player): judge the end of playback by position as well as the end…
Quick104 Nov 24, 2026
7b762e7
fix(player): keep resumed playback open when Next Up turns off after …
Quick104 Nov 24, 2026
bb46caf
fix(player): forget the end when the system media controls seek away …
Quick104 Nov 24, 2026
9f9d2ae
test(tv): cover Next Up Off while the next-episode lookup waits
Quick104 Nov 24, 2026
0e2a454
fix(player): close at the end whatever the last position, and only there
Quick104 Nov 29, 2026
53b6474
fix(player): keep the ended marker when a seek rolls back
Quick104 Nov 29, 2026
ed16560
fix(player): close when a seek pending during Off rolls back
Quick104 Nov 29, 2026
b18ad7a
test(player): start the seek between Off's two hops
Quick104 Nov 29, 2026
72ea43f
fix(tv): keep a viewer-opened overlay when a seek rolls back under Off
Quick104 Nov 29, 2026
a255ed4
test(player): cover Off during a pending seek that leaves the end
Quick104 Nov 29, 2026
5423f7c
fix(player): apply Off the same way when the countdown sees it first
Quick104 Nov 30, 2026
d4af5a9
fix(player): close at the end under Off after the finished card is gone
Quick104 Nov 30, 2026
7f35d33
Merge main into feat/next-up-off
Quick104 Dec 2, 2026
e44df67
fix(player): close at the end under Off whoever dismissed the finishe…
Quick104 Dec 2, 2026
6757e2b
fix(tv): forget the previous end when the player reloads
Quick104 Dec 2, 2026
38a1f21
test(tv): cover Off arriving during a reload from the end
Quick104 Dec 2, 2026
01aca70
fix(player): let a pending seek decide an end under Off
Quick104 Dec 2, 2026
ea74cc4
fix(tv): keep the end through a version switch
Quick104 Dec 2, 2026
b1a8258
chore(settings): re-vendor the settings contract from silo-server#450…
Rhainland Dec 3, 2026
af19cc3
Merge remote-tracking branch 'origin/main' into review/pr-995
Quick104 Dec 4, 2026
b2340c3
fix(tv): mark a viewer's Up Next as ended when a refused seek rolls b…
Quick104 Dec 4, 2026
4b72528
fix(tv): settle an end under Off when a failed version switch keeps t…
Quick104 Dec 4, 2026
a8fae39
fix(player): forget the end once a seek's re-anchor is adopted
Quick104 Dec 4, 2026
5982241
fix(tv): let a seek queued during a failed version switch decide the end
Quick104 Dec 4, 2026
bfc6ff8
docs(tv): put the Next Up Off close doc back on its function
Quick104 Dec 4, 2026
be56968
fix(tv): forget the old end once a replacement load is published
Quick104 Dec 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1314,7 +1314,7 @@ class FileDiagnosticsBundleBuilder : DiagnosticsBundleBuilder {
"catalog.metadata_language", "playback.audio_language", "playback.auto_play_next",
"playback.auto_play_next_preview", "playback.auto_skip_credits", "playback.auto_skip_intro",
"playback.auto_skip_recap", "playback.buffering_quality_mode", "playback.intro_skip_mode",
"playback.max_bitrate_kbps", "playback.next_up_prompt_seconds",
"playback.max_bitrate_kbps", "playback.next_up_enabled", "playback.next_up_prompt_seconds",
"playback.preferred_quality", "playback.show_forced_subtitles", "playback.subtitle_appearance",
"playback.subtitle_language", "playback.subtitle_mode", "player.audio_sync_ms",
"player.dolby_vision_enabled", "player.dv_profile7_hdr10_fallback", "player.hdr_enabled",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,18 +268,21 @@ class AndroidPlayerSettingsStore(
}

/**
* Whether the active server's manifest defines
* `playback.buffering_quality_mode`: null until its manifest is read.
* Whether the active server's manifest defines [key], one of
* [PlaybackSettingsKeys.ManifestDetectedKeys]: null until its manifest is read.
*/
private val bufferingQualityModeDefined: Flow<Boolean?> =
private fun manifestDefines(key: String): Flow<Boolean?> =
if (contractRevision == null) {
flowOf(true)
} else {
combine(currentScopeFlow, contractRevision.known) { scope, _ ->
scope?.let { contractRevision.stores(it.serverUrl, PlaybackSettingsKeys.BufferingQualityMode) }
scope?.let { contractRevision.stores(it.serverUrl, key) }
}.distinctUntilChanged()
}

private val bufferingQualityModeDefined: Flow<Boolean?> =
manifestDefines(PlaybackSettingsKeys.BufferingQualityMode)

// No legacy boolean behind this one: an absent or unknown value is the
// contract default. Until the server's manifest is read, the last mode
// seen here applies; a server without the setting plays the default, and
Expand All @@ -297,6 +300,21 @@ class AndroidPlayerSettingsStore(
override val bufferingQualityModeSupportedFlow: Flow<Boolean> =
bufferingQualityModeDefined.map { it == true }.distinctUntilChanged()

private val nextUpEnabledDefined: Flow<Boolean?> =
manifestDefines(PlaybackSettingsKeys.NextUpEnabled)

// As with the buffering mode: until the manifest is read the last choice
// seen applies, and a server without the setting keeps Next Up on.
override val nextUpEnabledFlow: Flow<Boolean> =
combine(
profileScopedFlow(true) { p, s -> p.boolFor(s, PlaybackSettingsKeys.NextUpEnabled, true) },
nextUpEnabledDefined,
) { enabled, defined -> enabled || defined == false }
.distinctUntilChanged()

override val nextUpEnabledSupportedFlow: Flow<Boolean> =
nextUpEnabledDefined.map { it == true }.distinctUntilChanged()

// ---- Booleans ------------------------------------------------------
override val autoSkipCreditsFlow: Flow<Boolean> =
profileScopedFlow(false) { p, s -> p.boolFor(s, PlaybackSettingsKeys.AutoSkipCredits, false) }
Expand Down Expand Up @@ -525,22 +543,10 @@ class AndroidPlayerSettingsStore(

/**
* Settings offers this only while the server's manifest defines the key
* ([bufferingQualityModeSupportedFlow]). Like [setCellularQuality] it is
* marked unconfirmed, so a write the flusher held while the manifest was
* unknown is sent again by the first refresh rather than replaced with
* the server's default.
* ([bufferingQualityModeSupportedFlow]); [writeString] marks it unconfirmed.
*/
override suspend fun setBufferingQualityMode(value: BufferingQualityMode) {
val key = PlaybackSettingsKeys.BufferingQualityMode
withScope { scope, store ->
store.edit {
it[stringPreferencesKey(scope.keyPrefix + key)] = value.wireValue
markDeviceOverride(it, scope, key)
it[unconfirmedKeysKey(scope)] = it[unconfirmedKeysKey(scope)].orEmpty() + key
}
serverSettingsFlusher.enqueue(scope.profileId, key, value.wireValue, scope.serverUrl, scope.authority)
}
}
override suspend fun setBufferingQualityMode(value: BufferingQualityMode) =
writeString(PlaybackSettingsKeys.BufferingQualityMode, value.wireValue)

override suspend fun setAutoSkipCredits(value: Boolean) =
writeBool(PlaybackSettingsKeys.AutoSkipCredits, value)
Expand Down Expand Up @@ -677,6 +683,9 @@ class AndroidPlayerSettingsStore(
override suspend fun setNextUpPromptSeconds(value: Int) =
writeInt(PlaybackSettingsKeys.NextUpPromptSeconds, value.coerceIn(0, 120))

override suspend fun setNextUpEnabled(value: Boolean) =
writeBool(PlaybackSettingsKeys.NextUpEnabled, value)

override suspend fun setResumeRewindSeconds(value: Int) =
writeIntLocal(PlaybackSettingsKeys.ResumeRewindSeconds, value.coerceIn(0, 30))

Expand Down Expand Up @@ -1130,7 +1139,21 @@ class AndroidPlayerSettingsStore(
// from the response is one this server's contract does not
// know (older revision); the local value is kept rather than
// guessed at.
val entry = effective[key] ?: continue
val entry = effective[key]
if (entry == null) {
// A server whose manifest lacks a manifest-detected key
// holds no row for this device, so the marker a local
// write left (Show Next Up's time choice writes
// next_up_enabled too) would pin its picker to this
// device. The unconfirmed mark stays, so the write is
// still sent once the server stores the key.
if (key in PlaybackSettingsKeys.ManifestDetectedKeys &&
contractRevision?.stores(scope.serverUrl, key) == false
) {
overrides -= key
}
continue
}
if (key in unconfirmed) {
if (entry.scope == SettingScope.PROFILE_DEVICE.wire) {
unconfirmed -= key
Expand Down Expand Up @@ -1240,6 +1263,7 @@ class AndroidPlayerSettingsStore(
store.edit {
it[booleanPreferencesKey(scope.keyPrefix + key)] = value
markDeviceOverride(it, scope, key)
markUnconfirmedIfManifestDetected(it, scope, key)
}
serverSettingsFlusher.enqueue(scope.profileId, key, value.toString(), scope.serverUrl, scope.authority)
}
Expand Down Expand Up @@ -1284,6 +1308,7 @@ class AndroidPlayerSettingsStore(
store.edit {
it[stringPreferencesKey(scope.keyPrefix + key)] = value
markDeviceOverride(it, scope, key)
markUnconfirmedIfManifestDetected(it, scope, key)
}
serverSettingsFlusher.enqueue(scope.profileId, key, value, scope.serverUrl, scope.authority)
}
Expand Down Expand Up @@ -1330,6 +1355,22 @@ class AndroidPlayerSettingsStore(
private fun deviceOverridesKey(scope: Scope): Preferences.Key<Set<String>> =
stringSetPreferencesKey(scope.keyPrefix + DEVICE_OVERRIDE_KEYS)

/**
* A key the server may not store yet ([PlaybackSettingsKeys.ManifestDetectedKeys])
* stays unconfirmed, like the cellular pair, so a write the flusher held while
* the manifest was unknown is sent again by the first refresh rather than
* replaced with the server's default.
*/
private fun markUnconfirmedIfManifestDetected(
prefs: androidx.datastore.preferences.core.MutablePreferences,
scope: Scope,
key: String,
) {
if (key in PlaybackSettingsKeys.ManifestDetectedKeys) {
prefs[unconfirmedKeysKey(scope)] = prefs[unconfirmedKeysKey(scope)].orEmpty() + key
}
}

private fun unconfirmedKeysKey(scope: Scope): Preferences.Key<Set<String>> =
stringSetPreferencesKey(scope.keyPrefix + UNCONFIRMED_GATED_KEYS)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package org.siloserver.silo.common.settings

import androidx.compose.runtime.Composable
import androidx.compose.ui.res.pluralStringResource
import androidx.compose.ui.res.stringResource
import org.siloserver.silo.common.R

/**
* The Show Next Up picker: one control over `playback.next_up_enabled` and
* `playback.next_up_prompt_seconds`. A choice is the seconds before the end
* (0 = at end), or null for Off.
*/
object NextUpChoice {
private val promptSeconds: List<Int?> = listOf(0, 10, 30, 60, 120)

/**
* Off comes first while the server stores the setting, and while this
* device's last choice is Off and the server's manifest is not read yet,
* so that choice stays visible and can be changed.
*/
fun options(offSupported: Boolean, enabled: Boolean): List<Int?> =
if (offSupported || !enabled) listOf(null) + promptSeconds else promptSeconds

fun selected(enabled: Boolean, seconds: Int): Int? = if (enabled) seconds.coerceAtLeast(0) else null

/**
* Off leaves the seconds alone. A time writes both keys, so the picker's
* choice is this device's whole choice: one inherited half would follow a
* later profile change to Off, including one the server reports only after
* its manifest is read. The flusher holds the key while the manifest is
* unknown and drops it for a server that lacks it, so that server is never
* sent it.
*/
suspend fun apply(store: PlayerSettingsStore, choice: Int?) {
if (choice == null) {
store.setNextUpEnabled(false)
return
}
store.setNextUpEnabled(true)
Comment thread
Quick104 marked this conversation as resolved.
Resolved
store.setNextUpPromptSeconds(choice)
}
}

/** The phone and TV label for a [NextUpChoice] choice. */
@Composable
fun nextUpChoiceLabel(choice: Int?): String = when {
choice == null -> stringResource(R.string.settings_off)
choice <= 0 -> stringResource(R.string.settings_nextUp_atEnd)
choice < 60 -> pluralStringResource(R.plurals.settings_nextUp_secondsBeforeEnd, choice, choice)
else -> (choice / 60).let { pluralStringResource(R.plurals.settings_nextUp_minutesBeforeEnd, it, it) }
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,20 @@ interface PlayerSettingsStore {
val bufferingQualityModeSupportedFlow: Flow<Boolean>
get() = flowOf(true)

/**
* `playback.next_up_enabled`: false turns Next Up off. True against a
* server whose manifest lacks the setting.
*/
val nextUpEnabledFlow: Flow<Boolean>
get() = flowOf(true)

/**
* True once the active server's manifest is known to define
* `playback.next_up_enabled`: the Show Next Up picker offers Off only then.
*/
val nextUpEnabledSupportedFlow: Flow<Boolean>
get() = flowOf(true)

// Booleans
/**
* The deprecated boolean, projected from [introSkipModeFlow] rather than
Expand Down Expand Up @@ -228,6 +242,9 @@ interface PlayerSettingsStore {
suspend fun setAudioSyncMs(value: Int)
suspend fun setSubtitleSyncMs(value: Int)
suspend fun setNextUpPromptSeconds(value: Int)

/** Writes `playback.next_up_enabled`; offered only while [nextUpEnabledSupportedFlow]. */
suspend fun setNextUpEnabled(value: Boolean) = Unit
suspend fun setSleepTimerDefaultMinutes(value: Int)
/** Set resume skip-back seconds (clamped 0..30; 0 = off). */
suspend fun setResumeRewindSeconds(value: Int)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1574,6 +1574,45 @@ class AndroidPlayerSettingsStoreTest {
assertTrue(store.bufferingQualityModeSupportedFlow.first())
}

@Test
fun `Next Up stays on against a server whose manifest lacks the Off setting`() = runTest {
var keys: Set<String> = setOf(PlaybackSettingsKeys.PreferredQuality)
var contract = capabilitiesAt(30)
val api = FakeSettingsApi(
effective = mapOf(stored(PlaybackSettingsKeys.NextUpEnabled, JsonPrimitive(false))),
)
val store = AndroidPlayerSettingsStore(
context = mockContextStub(),
legacyCache = fakeLegacyCache,
getActiveProfileId = { activeProfileId },
getServerUrl = { serverUrl },
serverSettingsFlusher = fakeFlusher,
settingsRepository = SettingsRepository(api),
getDeviceId = { null },
contractRevision = SettingsContractRevision({ contract }, { serverUrl }, { ApiResult.Success(keys) }),
dataStoreFactory = { _, id ->
PreferenceDataStoreFactory.create(produceFile = { File(tempFolder.root, "ds_nu_$id.preferences_pb") })
},
)
store.setNextUpEnabled(false)
assertFalse(store.nextUpEnabledFlow.first(), "the last choice seen, until the manifest is read")

// A server without the setting: Off hides and Next Up shows as before.
store.refreshFromServer()
assertFalse(PlaybackSettingsKeys.NextUpEnabled in api.requestedKeys)
assertFalse(store.nextUpEnabledSupportedFlow.first())
assertTrue(store.nextUpEnabledFlow.first())
// That server holds no device row for it, so the picker isn't pinned to this device.
assertFalse(PlaybackSettingsKeys.NextUpEnabled in store.deviceOverrideKeysFlow.first())

// The server upgrades to a contract with the setting.
keys = keys + PlaybackSettingsKeys.NextUpEnabled
contract = capabilitiesAt(31)
store.refreshFromServer()
assertTrue(store.nextUpEnabledSupportedFlow.first())
assertFalse(store.nextUpEnabledFlow.first())
}

@Test
fun `cellular quality is left out of the batch while the server revision is unknown`() = runTest {
val contractRevision = SettingsContractRevision(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package org.siloserver.silo.common.settings

import java.lang.reflect.Proxy
import kotlinx.coroutines.test.runTest
import kotlin.test.Test
import kotlin.test.assertEquals

class NextUpChoiceTest {
@Test
fun offIsOfferedWhereTheServerStoresItAndWhileASavedOffAwaitsTheManifest() {
val times = listOf(0, 10, 30, 60, 120)
assertEquals(listOf<Int?>(null) + times, NextUpChoice.options(offSupported = true, enabled = true))
assertEquals(times, NextUpChoice.options(offSupported = false, enabled = true))
// A saved Off before the manifest is read stays visible and selected.
assertEquals(listOf<Int?>(null) + times, NextUpChoice.options(offSupported = false, enabled = false))
assertEquals(null, NextUpChoice.selected(enabled = false, seconds = 30))
}

@Test
fun aTimeIsAChoiceOfBothKeys() = runTest {
// On already (inherited from the profile, or not yet known from the
// manifest): the time still writes On, so this device's choice survives
// the profile turning Next Up off later.
assertEquals(listOf("enabled=true", "seconds=10"), writes(10))
assertEquals(listOf("enabled=true", "seconds=0"), writes(0))
assertEquals(listOf("enabled=false"), writes(null))
}

private suspend fun writes(choice: Int?): List<String> {
val calls = mutableListOf<String>()
val unused = Proxy.newProxyInstance(
PlayerSettingsStore::class.java.classLoader,
arrayOf(PlayerSettingsStore::class.java),
) { _, method, _ -> throw UnsupportedOperationException(method.name) } as PlayerSettingsStore
val store = object : PlayerSettingsStore by unused {
override suspend fun setNextUpEnabled(value: Boolean) { calls += "enabled=$value" }
override suspend fun setNextUpPromptSeconds(value: Int) { calls += "seconds=$value" }
}
NextUpChoice.apply(store, choice)
return calls
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,32 @@ fun PlayerScreen(
// resolves when the service binds. We hold the controller in a compose
// state so downstream effects can re-run once it's ready.
var mediaController by remember { mutableStateOf<MediaController?>(null) }
// With Next Up off, the end of playback leaves the player like Back. The
// position ticker stops in the background, so report the end position
// first; the exit saves the last reported one. In picture-in-picture,
// leaving the route would fill the window with the screen behind the
// player, so the ended frame stays until picture-in-picture ends. Playback
// restarted from its controls meanwhile (playing or paused partway) keeps
// the player; its next end asks again. The check runs outside
// picture-in-picture too, so a second end queued while the window was up
// can't close playback restarted since.
LaunchedEffect(Unit) {
viewModel.closeAtEndRequests.collect {
mediaController?.takeIf { it.mediaItemCount > 0 }?.let { controller ->
viewModel.onPositionChanged(controller.currentPosition, controller.duration)
}
if (pictureInPictureCoordinator.isInPictureInPictureMode.value) {
pictureInPictureCoordinator.isInPictureInPictureMode.first { !it }
}
val controller = mediaController
if (controller != null && controller.mediaItemCount > 0 &&
(controller.playbackState == Player.STATE_READY || controller.playbackState == Player.STATE_BUFFERING)
) {
return@collect
}
exitPlayer()
Comment thread
Quick104 marked this conversation as resolved.
Resolved
Comment thread
Quick104 marked this conversation as resolved.
Resolved
Comment on lines +733 to +738

@coderabbitai coderabbitai Bot Dec 2, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor · Functional Correctness · Quick win

A seek during deferred end closure can be lost.

When Off closes playback at the end in picture-in-picture, a seek that needs a server re-anchor can start before the window closes. The mounted media stays in STATE_ENDED until the replacement mounts. When picture-in-picture ends first, the guard at PlayerScreen.kt:733-738 sees STATE_ENDED and calls exitPlayer(). onExit() then cancels the queued re-anchor and the seek, so playback closes instead of resuming at the requested position.

Check for a pending seek or re-anchor before closing the player. Wait for it to settle. After a rollback, close as before. After a replacement mounts, keep playback. Close immediately when no seek is pending.

Relevant code: PlayerViewModel.kt:3858-3876 (re-anchor queueing), PlayerViewModel.kt:3390-3401 (cancellation in resetPlaybackRecoveryState).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed as a narrow case, and left for the maintainers. Off closes at the end while the phone is in picture-in-picture, so the close waits for the window to end. If a seek that needs a server re-anchor starts from the system controls during that wait, and the window ends before the seek settles, the guard still sees STATE_ENDED and exits. Fixing it means handing the close back to the seek: give up the pending close while a re-anchor is in flight, and let the rollback ask again. That interacts with the rollback's own close, so it needs its own change and test rather than a quick edit here. Outside picture-in-picture, 01aca70 already keeps an end during a pending re-anchor from closing.

🤖 Claude Code (claude-opus-5-5)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Quick104 Thanks for confirming. I won’t mark the finding as addressed.


Learnings added

Learnt from: Quick104
Repo: Silo-Server/silo-android PR: 995
File: androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerScreen.kt:733-738
Timestamp: 2026-12-02T20:54:13.867Z
Learning: Within repository "Silo-Server/silo-android", only for files matching one of ["androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerScreen.kt"]: In the phone PlayerScreen.kt, a close-at-end request for Next Up Off can already be waiting for picture-in-picture to end when a seek requiring a server re-anchor starts. Media3 can still report STATE_ENDED while the re-anchor is pending, so that state alone does not justify the deferred close. Coordinate the close with seek settlement, including re-evaluating closure if rollback leaves playback ended.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

You are interacting with an AI system.

}
}
val playWhenReadyReconciliationGate = remember(mediaController, roomId) {
PlayWhenReadyReconciliationGate()
}
Expand Down Expand Up @@ -1433,6 +1459,9 @@ fun PlayerScreen(

override fun onPlaybackStateChanged(playbackState: Int) {
viewModel.onBufferingChanged(playbackState == Player.STATE_BUFFERING)
if (playbackState == Player.STATE_BUFFERING || playbackState == Player.STATE_READY) {
viewModel.onPlaybackLeftEnd()
}
if (watchParty != null) sampleRoomEngine(controller)
if (playbackState == Player.STATE_ENDED) {
viewModel.onPlayingChanged(false)
Expand Down
Loading
Loading