From 862b4b5448691eec89cc5173a9c437b926b5bef5 Mon Sep 17 00:00:00 2001 From: Pauljd Date: Fri, 6 Nov 2026 23:52:03 +0000 Subject: [PATCH] End-of-programme card shows the phone's queue; equal buttons on the phone While something is queued, the squeeze-back's Up next is the queue's (Catch Up green or the accent for live, with a border and its picture), and the strip below lists the rest. It reads the queue as it draws, so cancelling it brings the channel's own next back at once. Co-Authored-By: Claude Opus 5.5 (1M context) --- android/app/build.gradle.kts | 4 +-- .../app/src/main/assets/phone/companion.html | 3 +- .../main/java/tv/orbit/classic/EmbyClient.kt | 4 +-- .../tv/orbit/classic/SecureMediaDataSource.kt | 2 +- .../main/java/tv/orbit/classic/SqueezeBack.kt | 32 +++++++++++++++++-- 5 files changed, 37 insertions(+), 8 deletions(-) diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index c0ebd382..f6005637 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 = 239 - versionName = "0.108.79-companion-queue" + versionCode = 240 + versionName = "0.108.80-companion-queue" } 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/assets/phone/companion.html b/android/app/src/main/assets/phone/companion.html index a554b96e..756f2d52 100644 --- a/android/app/src/main/assets/phone/companion.html +++ b/android/app/src/main/assets/phone/companion.html @@ -56,7 +56,8 @@ button:active{opacity:.75} .sheet{position:fixed;left:0;right:0;bottom:0;z-index:5;background:var(--deep);border-radius:22px 22px 0 0;padding:10px 18px calc(84px + env(safe-area-inset-bottom));box-shadow:0 -10px 40px #0008;transform:translateY(110%);transition:transform .2s ease} .sheet.open{transform:none}.sheet .grab{width:40px;height:4px;border-radius:2px;background:var(--muted);opacity:.5;margin:0 auto 12px} .sheet .inner{max-width:460px;margin:0 auto} -.btn{border-radius:999px;padding:12px 16px;font-weight:700;background:var(--raised);width:100%}.btn.gold{background:var(--accent);color:var(--on-accent)} +.btn{border-radius:999px;padding:12px 16px;font-weight:700;background:var(--raised);width:100%} +.row .btn{flex:1 1 0;min-width:0}.btn.gold{background:var(--accent);color:var(--on-accent)} .shade{position:fixed;inset:0;background:#0006;z-index:4;display:none}.shade.open{display:block} .cu{display:flex;gap:12px;align-items:center;background:var(--surface);border-radius:14px;padding:11px 14px;margin-bottom:8px;width:100%;text-align:left} .cu .play{width:34px;height:34px;border-radius:50%;border:2px solid var(--accent);display:flex;align-items:center;justify-content:center;flex:none;color:var(--accent)} 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 2ef0b7e7..d3eb2f20 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.79\"") + + ServerKind.Emby -> mapOf("X-Emby-Authorization" to "Emby Client=\"Orbit TV\", Device=\"Orbit TV\", DeviceId=\"$deviceId\", Version=\"0.108.80\"") + (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.79\"" + + ServerKind.Jellyfin -> mapOf("Authorization" to "MediaBrowser Client=\"Orbit TV\", Device=\"Orbit TV\", DeviceId=\"$deviceId\", Version=\"0.108.80\"" + (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 c1eca1ca..e9ab4ba0 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.79") + next.setRequestProperty("User-Agent", "OrbitTV/0.108.80") 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/main/java/tv/orbit/classic/SqueezeBack.kt b/android/app/src/main/java/tv/orbit/classic/SqueezeBack.kt index 0c5c0560..566fe23e 100644 --- a/android/app/src/main/java/tv/orbit/classic/SqueezeBack.kt +++ b/android/app/src/main/java/tv/orbit/classic/SqueezeBack.kt @@ -3,6 +3,7 @@ package tv.orbit.classic import androidx.compose.foundation.Canvas import androidx.compose.foundation.Image import androidx.compose.foundation.background +import androidx.compose.foundation.border import androidx.compose.foundation.layout.* import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.runtime.* @@ -68,8 +69,25 @@ internal fun SqueezePanel(session: EmbySampleSession, channel: SampleChannel, cu val seconds = ((next.startMs - nowMs) / 1000).coerceAtLeast(0) Box(Modifier.fillMaxSize().graphicsLayer { alpha = shown }) { if (brand != null) Image(cachedPainter(brand.logo), brand.displayName, Modifier.padding(start = 36.dp, top = 14.dp).logoPlate().width(120.dp).height(38.dp)) + // Queued from the phone (Paul, 6 November 2026): Up next is the queue's, in Catch Up's green or the accent for a + // channel live. It's read as it draws, so cancelling the queue brings the channel's own next straight back. + val queue = OrbitCompanion.queue + val queued = queue.firstOrNull() + if (queued != null) Column(Modifier.align(Alignment.TopEnd).padding(top = 60.dp, end = 36.dp).width(360.dp), verticalArrangement = Arrangement.spacedBy(6.dp)) { + val tint = if (queued.catchUpStartMs != null) CatchUpGreen else Yellow + Text("UP NEXT · YOUR QUEUE", color = tint, fontFamily = Anton, fontSize = 22.sp, maxLines = 1) + Text(if (seconds >= 60) "in about a minute" else "in $seconds seconds", color = Muted, fontSize = 13.sp) + Box(Modifier.fillMaxWidth().height(160.dp).clip(RoundedCornerShape(8.dp)).background(Panel).border(3.dp, tint, RoundedCornerShape(8.dp))) { + QueuedArtwork(session, queued.itemId, queued.seriesId, Modifier.fillMaxSize()) + Text(if (queued.catchUpStartMs != null) "CATCH UP" else "LIVE", Modifier.align(Alignment.TopStart).padding(8.dp).background(tint, RoundedCornerShape(4.dp)) + .padding(horizontal = 7.dp, vertical = 2.dp), color = OnAccent, fontWeight = FontWeight.Bold, fontSize = 12.sp) + } + Text(queued.title, color = Ink, fontSize = 18.sp, fontWeight = FontWeight.SemiBold, maxLines = 1, overflow = TextOverflow.Ellipsis) + Text(listOfNotNull(queued.sub, "${if (queued.catchUpStartMs != null) "From the start" else "Live"} on ${queued.number} ${queued.channel}").joinToString(" · "), + color = Muted, fontSize = 13.sp, maxLines = 1, overflow = TextOverflow.Ellipsis) + } // Beside the picture: what's next. - Column(Modifier.align(Alignment.TopEnd).padding(top = 60.dp, end = 36.dp).width(360.dp), verticalArrangement = Arrangement.spacedBy(6.dp)) { + else Column(Modifier.align(Alignment.TopEnd).padding(top = 60.dp, end = 36.dp).width(360.dp), verticalArrangement = Arrangement.spacedBy(6.dp)) { Text(if (keep) "KEEP WATCHING" else "NEXT ON ${(brand?.displayName ?: channel.name).removePrefix("Orbit ").uppercase()}", color = Yellow, fontFamily = Anton, fontSize = 22.sp, maxLines = 1) Text(if (seconds >= 60) "in about a minute" else "in $seconds seconds", color = Muted, fontSize = 13.sp) Box(Modifier.fillMaxWidth().height(160.dp).clip(RoundedCornerShape(8.dp)).background(Panel)) { @@ -93,7 +111,17 @@ internal fun SqueezePanel(session: EmbySampleSession, channel: SampleChannel, cu if (who == null) drawOrbMascot(c, size.minDimension * .26f, blink = shut) else drawOrbChaser(c, size.minDimension * .34f, who, OrbDir.Right, false, false, false, t / 400f, eyesShut = shut) } - Column(verticalArrangement = Arrangement.spacedBy(4.dp)) { + if (queued != null) Column(verticalArrangement = Arrangement.spacedBy(4.dp)) { + Text(if (queue.size > 1) "THEN FROM YOUR QUEUE" else "FROM YOUR PHONE", color = Muted, fontSize = 12.sp, fontWeight = FontWeight.SemiBold, letterSpacing = 1.sp) + if (queue.size > 1) Row(horizontalArrangement = Arrangement.spacedBy(28.dp)) { + queue.drop(1).take(3).forEachIndexed { i, q -> + Row(horizontalArrangement = Arrangement.spacedBy(8.dp), verticalAlignment = Alignment.CenterVertically) { + Text("${i + 2}", color = if (q.catchUpStartMs != null) CatchUpGreen else Yellow, fontFamily = BarlowCondensed, fontSize = 18.sp) + Text(q.title, color = Ink, fontSize = 15.sp, fontWeight = FontWeight.SemiBold, maxLines = 1, overflow = TextOverflow.Ellipsis, modifier = Modifier.widthIn(max = 200.dp)) + } + } + } else Text("Queued on Orbit Companion. Remove it there to stay on ${(brand?.displayName ?: channel.name)}.", color = Ink, fontSize = 15.sp, maxLines = 1, overflow = TextOverflow.Ellipsis) + } else Column(verticalArrangement = Arrangement.spacedBy(4.dp)) { Text("LATER ON ${(brand?.displayName ?: channel.name).removePrefix("Orbit ").uppercase()}", color = Muted, fontSize = 12.sp, fontWeight = FontWeight.SemiBold, letterSpacing = 1.sp) Row(horizontalArrangement = Arrangement.spacedBy(28.dp)) { later.forEach { show ->