Playback markers
Intro and credits ranges on the playback response, what they mean, and how a player should act on them.
StartPlayback returns markers: a list of PlaybackMarker naming the
stretches of the file a player can act on — the title sequence to skip, the
credits to count down from. They sit beside chapters and are not the same
thing. A chapter is container metadata that most library files do not carry
and that says nothing a player can act on ("Chapter 3"). A marker is a claim
about the content, and the platform gathers it from several places.
The shape
{
"markers": [
{ "kind": "PLAYBACK_MARKER_KIND_INTRO", "startMs": 90000, "endMs": 180000, "source": "PLAYBACK_MARKER_SOURCE_CHAPTER", "confidence": 0.9 },
{ "kind": "PLAYBACK_MARKER_KIND_CREDITS", "startMs": 1260000, "endMs": 1350000, "source": "PLAYBACK_MARKER_SOURCE_CHAPTER", "confidence": 0.9 }
]
}kind—INTRO,CREDITS, and the reservedRECAPandPREVIEW(nothing populates those two yet; handle them as "skippable" if you like, or ignore them).startMs/endMs— the range[start, end)in the file's own time, exactly likePlaybackChapter. Under a transcode, translate throughMediaDelivery.playlist_start_msas you already do for chapters and the progress beat.source— where the timing came from, in the platform's order of trust:MANUAL(a person set it for this file),CHAPTER(read off a chapter title the file already carried),COMMUNITY(a public timestamp database, timed by a person against a real release),DETECTED(measured from this file's audio and video — exact for the bytes, but able to mistake a recap or repeated music for the title, so the fallback rather than the authority).confidence— 0 to 1, advisory.
At most one marker per kind. When several sources disagree the server has
already chosen by source precedence; a client never sees the losers. The
source is carried so a client can still be cautious — for instance, asking
before auto-skipping on a COMMUNITY timing it cannot verify against this
particular cut.
Empty is normal. Most of a library has no markers until a detection pass has run over it, and a file with no titled chapters has none from the probe. Do not special-case an empty list; a player without markers is a player.
Acting on them
Skip Intro. While the playhead is inside an INTRO range, offer a skip
that seeks to endMs. A second or two of grace on either side avoids the
button flickering at the boundary. If you auto-skip, do it once per marker,
not once per time the playhead enters the range, or a scrub backwards
re-triggers it.
Up Next and auto-advance. Show the next-episode card from CREDITS
startMs rather than from a fixed distance before the end of the file, and
count down from there. Mind endMs: it is where the credits end, and when
that is well before the end of the file a scene follows the credits.
Advancing at endMs skips that scene; advancing on your own countdown from
startMs — or holding for the person when a scene follows — does not.
Where markers come from
Chapter titles (CHAPTER). The probe reads them on every scan: encoders
and rippers title chapters "Opening", "Credits", "OP", "ED", "Recap",
"Preview" often enough that this is the cheapest source there is, and it is
exact for the file because it was written into the file. Sanity bounds
apply — an "Intro" chapter spanning the whole episode is a mistitled chapter,
not a Skip Intro button that skips the episode.
Detection (DETECTED). After the databases, the nightly pass has each hub fingerprint the first
minutes and the last minutes of every episode's audio and line the episodes
of a season up against each other: the stretch they share at the start is
the intro, the stretch they share at the end is the credits. It works on any
show in any language and needs nothing beyond the files, but it needs a
season — a lone episode, or a film, has nothing to agree with and gets no
detected marker. A hub whose ffmpeg cannot fingerprint (Homebrew's build on
a Mac, for one) is skipped with a warning on the run rather than failed.
Detected ranges are accurate to a second or two.
Community databases (COMMUNITY). The first rung of the nightly pass:
for a real episode whose file has no intro or no credits yet, it asks
TheIntroDB (keyed by the show's TMDB id) and SkipDB (keyed by its IMDb id),
in that order, for the season and episode number. A file both databases
have timed fully is not listened to at all; listening is for what they lack. A range that runs past
the end of the file is dropped unless the database vouched for it holding
across cuts, and an episode nobody has timed is remembered for thirty days
so it is not asked about every night. SkipDB's data is ODbL with a
reciprocity expectation; a community row always carries its source.
Manual (MANUAL). A person pinned the range on the admin title page.
It outranks every automated source and no pass touches it.
Inspecting and overriding
LibraryService carries three administrative RPCs, all scoped
AUTH_SCOPE_ADMIN and keyed by media_file_uuid:
ListMediaFileMarkers— every stored row on the file, each with itskind,source, range andconfidence, andresolvedset on the row the player is actually given for that kind.duration_mscomes with it for drawing the ranges on a bar. Kind and source are the plain strings (intro,credits,recap,preview;chapter,detected,community,manual).SetMediaFileMarker(kind, start_ms, end_ms)— writes amanualrow for the kind, replacing any earlier manual row. The range must end after it starts and start before the file ends.ClearMediaFileMarker(kind)— removes the manual row, so the automated sources decide again.
Both writes answer with the full list, resolved flags recomputed.