fix(chapters): size chapter ticks to the slider track

This commit is contained in:
Uruk
2026-05-22 14:22:36 +02:00
parent ee5c9ae19f
commit a9d8f753d4
2 changed files with 11 additions and 3 deletions

View File

@@ -131,7 +131,11 @@ export function CastPlayerProgressBar({
thumbWidth={16}
panHitSlop={{ top: 12, bottom: 12, left: 10, right: 10 }}
/>
<ChapterTicks chapters={chapters} durationMs={duration * 1000} />
<ChapterTicks
chapters={chapters}
durationMs={duration * 1000}
height={4}
/>
{__DEV__ && DEBUG_TOUCH_ZONES && (
<View
pointerEvents='none'

View File

@@ -14,12 +14,15 @@ interface ChapterTicksProps {
durationMs: number;
/** Tick colour. */
color?: string;
/** Tick height in px — slightly less than the slider track thickness. */
height?: number;
}
export function ChapterTicks({
chapters,
durationMs,
color = "#fff",
height = 6,
}: ChapterTicksProps) {
const markers = chapterMarkers(chapters, durationMs);
// One chapter (typically a single marker at 0) is not worth marking.
@@ -36,8 +39,9 @@ export function ChapterTicks({
style={{
position: "absolute",
left: `${marker.percent}%`,
top: "25%",
height: "50%",
top: "50%",
marginTop: -height / 2,
height,
width: 2,
backgroundColor: color,
}}