diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index be7474be..61f04382 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -9,8 +9,8 @@ android { applicationId = "tv.orbit.classic" minSdk = 26 targetSdk = 36 - versionCode = 227 - versionName = "0.108.67-the-chase" + versionCode = 228 + versionName = "0.108.68-slower-chase" } buildFeatures { compose = true } // The finished build for the TVs (Paul, 6 November 2026: the test build stuttered on the box). Not debuggable, so diff --git a/android/app/src/main/java/tv/orbit/classic/ChaseCameo.kt b/android/app/src/main/java/tv/orbit/classic/ChaseCameo.kt index 9d7e0468..775e4234 100644 --- a/android/app/src/main/java/tv/orbit/classic/ChaseCameo.kt +++ b/android/app/src/main/java/tv/orbit/classic/ChaseCameo.kt @@ -22,12 +22,13 @@ import kotlin.math.sin * a quiet changeover frame. Ollie rolls through looking back, Blaze storms after him, a flame puff lingers, then: * - with [Cameo.lunaEnds], Luna peeks in, looks after them, looks straight at you for a beat, and rolls her eyes; * - otherwise Drift floats in far too late, stops, looks both ways, and drifts on. - * The storyboard runs 10 seconds; it's played over the changeover's own length, so nothing waits for it. + * Timed for the 7-second ident window (Paul, 6 November 2026: squeezed from the 10-second storyboard, the chase was too quick + * to see): the chase itself now takes over 3 seconds, and the ending the rest. A longer or shorter window stretches it. */ -internal const val CHASE_STORY_S = 10f +internal const val CHASE_STORY_S = 7f /** The frame shown with Reduce motion: the payoff, Luna mid eye-roll or Drift looking about. */ -internal const val CHASE_STILL_S = 7.3f +internal const val CHASE_STILL_S = 5.9f private fun lerp(a: Float, b: Float, u: Float) = a + (b - a) * u.coerceIn(0f, 1f) private fun span(t: Float, from: Float, to: Float) = ((t - from) / (to - from)).coerceIn(0f, 1f) @@ -36,35 +37,35 @@ private fun easeInOut(u: Float) = if (u < .5f) 4 * u * u * u else 1 - (-2 * u + /** Where Luna looks at [t]: after them, at you, then the eye-roll, up and over, then off to the side. */ internal fun lunaLook(t: Float): Offset = when { - t < 5.2f -> Offset(.6f, 0f) - t < 6.0f -> Offset(1f, 0f) - t < 6.8f -> Offset.Zero - t < 7.8f -> { val a = PI.toFloat() * span(t, 6.8f, 7.8f); Offset(cos(a), -sin(a)) } + t < 4.4f -> Offset(.6f, 0f) + t < 4.9f -> Offset(1f, 0f) + t < 5.5f -> Offset.Zero + t < 6.3f -> { val a = PI.toFloat() * span(t, 5.5f, 6.3f); Offset(cos(a), -sin(a)) } else -> Offset(-1f, .2f) } -/** Draws the gag at storyboard second [t] (0 to 10) across this band, characters along its lower part. */ +/** Draws the gag at second [t] (0 to 7) across this band, characters along its lower part. */ internal fun DrawScope.drawChase(t: Float, lunaEnds: Boolean) { val w = size.width; val ground = size.height * .62f; val r = size.height * .2f fun at(x: Float, lift: Float = 0f) = Offset(x * w, ground - lift * size.height) // Ollie rolls through, ring bobbing, looking back over his shoulder. - if (t in .4f..2.6f) { - val u = span(t, .4f, 2.4f) + if (t in .2f..3.3f) { + val u = span(t, .2f, 3.2f) drawOrbMascot(at(lerp(-.08f, 1.08f, u), abs(sin(u * 18f)) * .05f), r, OrbDir.Left) } // Blaze storms after him, flames streaming, brows down. - if (t in 1.4f..2.9f) drawOrbChaser(at(lerp(-.1f, 1.12f, span(t, 1.4f, 2.8f))), r * 1.05f, OrbCharacter.Blaze, OrbDir.Right, false, false, false, t * 14f) + if (t in .9f..3.6f) drawOrbChaser(at(lerp(-.1f, 1.12f, span(t, .9f, 3.5f))), r * 1.05f, OrbCharacter.Blaze, OrbDir.Right, false, false, false, t * 14f) // His last flame puff lingers at the edge, and fades. - if (t in 2.6f..3.3f) drawCircle(Color(0xFFFFC23D).copy(alpha = 1f - span(t, 2.6f, 3.3f)), r * .35f, at(.97f)) + if (t in 3.4f..3.9f) drawCircle(Color(0xFFFFC23D).copy(alpha = 1f - span(t, 3.4f, 3.9f)), r * .35f, at(.97f)) if (lunaEnds) { - if (t in 4.2f..9.8f) { - val x = if (t < 8.4f) lerp(-.07f, .045f, easeOut(span(t, 4.2f, 5.0f))) else lerp(.045f, -.09f, easeInOut(span(t, 8.4f, 9.8f))) + if (t in 3.8f..7f) { + val x = if (t < 6.5f) lerp(-.07f, .045f, easeOut(span(t, 3.8f, 4.4f))) else lerp(.045f, -.09f, easeInOut(span(t, 6.5f, 7f))) drawOrbChaser(at(x), r, OrbCharacter.Luna, OrbDir.Right, false, false, false, 0f, lookAt = lunaLook(t)) } - } else if (t in 4.2f..10f) { + } else if (t in 3.8f..7f) { // Drift, several seconds too late: floats in, stops, looks both ways, and drifts on. - val x = when { t < 7f -> lerp(-.08f, .5f, easeOut(span(t, 4.2f, 7f))); t < 8.6f -> .5f; else -> lerp(.5f, 1.1f, span(t, 8.6f, 10f)) } - val look = when { t < 7f -> Offset(1f, 0f); t < 7.6f -> Offset(-1f, 0f); t < 8.2f -> Offset(1f, 0f); t < 8.6f -> Offset.Zero; else -> Offset(1f, 0f) } + val x = when { t < 5.4f -> lerp(-.08f, .5f, easeOut(span(t, 3.8f, 5.4f))); t < 6.4f -> .5f; else -> lerp(.5f, 1.1f, span(t, 6.4f, 7f)) } + val look = when { t < 5.4f -> Offset(1f, 0f); t < 5.8f -> Offset(-1f, 0f); t < 6.2f -> Offset(1f, 0f); t < 6.4f -> Offset.Zero; else -> Offset(1f, 0f) } drawOrbChaser(at(x, .03f * sin(t * 2f)), r, OrbCharacter.Drift, OrbDir.Right, false, false, false, t * 3f, lookAt = look) } } diff --git a/android/app/src/main/java/tv/orbit/classic/EmbyClient.kt b/android/app/src/main/java/tv/orbit/classic/EmbyClient.kt index 0b41eb34..21efbd6e 100644 --- a/android/app/src/main/java/tv/orbit/classic/EmbyClient.kt +++ b/android/app/src/main/java/tv/orbit/classic/EmbyClient.kt @@ -62,9 +62,9 @@ internal class HttpsEmbyTransport(internal val deviceId: String = UUID.randomUUI } /** The sign-in headers for this kind of server. */ internal fun authHeaders(token: String?): Map = when (kind) { - ServerKind.Emby -> mapOf("X-Emby-Authorization" to "Emby Client=\"Orbit TV\", Device=\"Orbit TV\", DeviceId=\"$deviceId\", Version=\"0.108.67\"") + + ServerKind.Emby -> mapOf("X-Emby-Authorization" to "Emby Client=\"Orbit TV\", Device=\"Orbit TV\", DeviceId=\"$deviceId\", Version=\"0.108.68\"") + (token?.let { mapOf("X-Emby-Token" to it) } ?: emptyMap()) - ServerKind.Jellyfin -> mapOf("Authorization" to "MediaBrowser Client=\"Orbit TV\", Device=\"Orbit TV\", DeviceId=\"$deviceId\", Version=\"0.108.67\"" + + ServerKind.Jellyfin -> mapOf("Authorization" to "MediaBrowser Client=\"Orbit TV\", Device=\"Orbit TV\", DeviceId=\"$deviceId\", Version=\"0.108.68\"" + (token?.let { ", Token=\"$it\"" } ?: "")) } /** One picture from the provider, or nothing. Same fixed origin and no redirects, and failures are never shown or logged. */ diff --git a/android/app/src/main/java/tv/orbit/classic/SecureMediaDataSource.kt b/android/app/src/main/java/tv/orbit/classic/SecureMediaDataSource.kt index ceb82852..ac47aa33 100644 --- a/android/app/src/main/java/tv/orbit/classic/SecureMediaDataSource.kt +++ b/android/app/src/main/java/tv/orbit/classic/SecureMediaDataSource.kt @@ -39,7 +39,7 @@ internal class SecureMediaDataSource(private val session: EmbySampleSession) : B next.instanceFollowRedirects = false next.connectTimeout = 10_000 next.readTimeout = 20_000 - next.setRequestProperty("User-Agent", "OrbitTV/0.108.67") + next.setRequestProperty("User-Agent", "OrbitTV/0.108.68") next.setRequestProperty("Accept-Encoding", "identity") session.mediaHeaders(address).forEach { (key, value) -> next.setRequestProperty(key, value) } if (dataSpec.position != 0L || dataSpec.length != C.LENGTH_UNSET.toLong()) { diff --git a/android/app/src/test/java/tv/orbit/classic/ChaseCameoTest.kt b/android/app/src/test/java/tv/orbit/classic/ChaseCameoTest.kt index 6881f17a..ce98123a 100644 --- a/android/app/src/test/java/tv/orbit/classic/ChaseCameoTest.kt +++ b/android/app/src/test/java/tv/orbit/classic/ChaseCameoTest.kt @@ -4,13 +4,13 @@ import androidx.compose.ui.geometry.Offset import org.junit.Assert.* import org.junit.Test -/** The Chase's timings against the storyboard (docs/character-continuity.md 3.1). */ +/** The Chase's timings in its 7-second window (docs/character-continuity.md 3.1). */ class ChaseCameoTest { @Test fun lunaLooksAfterThemThenAtYouThenRollsHerEyes() { - assertEquals(Offset(1f, 0f), lunaLook(5.5f)) - assertEquals(Offset.Zero, lunaLook(6.4f)) // the fourth-wall glance, 6.0 to 6.8 s - assertTrue(lunaLook(7.3f).y < -.9f) // halfway through the roll: straight up - assertTrue(lunaLook(7.75f).x < -.9f) // and over + assertEquals(Offset(1f, 0f), lunaLook(4.6f)) + assertEquals(Offset.Zero, lunaLook(5.2f)) // the fourth-wall glance, 4.9 to 5.5 s + assertTrue(lunaLook(5.9f).y < -.9f) // halfway through the roll: straight up + assertTrue(lunaLook(6.25f).x < -.9f) // and over } @Test fun onlyTheChaseIsChosenWhileItsTheOnlyOneDrawn() {