Media Extended

Timestamp Format

Complete reference for the temporal fragment syntax used in timestamp links, based on the W3C Media Fragments URI specification with Media Extended extensions.

The t= hash property uses the temporal fragment syntax from the W3C Media Fragments URI 1.0 specification, with a few Media Extended extensions. This page documents the exact syntax accepted by the parser.

For an introduction to what timestamps are and how they appear in notes, see Timestamps and Time Links.

Syntax overview

A temporal fragment specifies one or two time values inside the hash of a media link:

[[lecture.mp4#t=<start>[,<end>]]]
FormMeaningExample
t=<start>Seek to <start>, play to end of media#t=01:30
t=<start>,<end>Clip from <start> to <end>#t=01:30,02:00
t=,<end>Clip from beginning to <end>#t=,02:00
t=<start>,eClip from <start> to end of media#t=01:30,e

<start> and <end> are written in Normal Play Time format. The e end sentinel is a Media Extended extension; it is not part of the W3C spec.

Normal Play Time

Time values follow the Normal Play Time (NPT) grammar from RFC 2326, which the W3C spec inherits. Three notations are accepted.

NotationPatternExampleResolves to
SecondsS or S.fff95, 12.595 s, 12.5 s
MM:SSMM:SS or MM:SS.fff01:3595 s
HH:MM:SSHH:MM:SS or HH:MM:SS.fff1:02:303,750 s

Format rules:

  • MM and SS must be exactly two digits (0059). 1:35 is not valid; write 01:35.
  • HH can be any number of digits.
  • Fractional seconds are optional in any notation and may have any number of decimal places.
  • Negative time values are not valid.
  • An optional npt: prefix is accepted on either time value: t=npt:01:30,npt:02:00 is equivalent to t=01:30,02:00.

Validation rules

When the parser cannot resolve a temporal fragment to a valid range, it silently ignores the fragment and the player loads the media without seeking.

  • <start> must be less than <end> when both are explicitly specified. t=20,10 is rejected.
  • A bare t= with no value is rejected.
  • Time strings that don't match one of the three NPT notations are rejected.

Multiple t= properties

If a hash contains more than one t= property, the parser uses the last valid occurrence. Invalid occurrences are ignored.

InputEffective value
t=10,20&t=30,40t=30,40
t=10,20&t=invalidt=10,20
t=invalid&t=2,5&t=broken&t=10,20t=10,20

This matches the W3C spec's precedence rule for repeated dimensions.

Examples

HashBehavior
#t=10Seek to 10 s, play to end of media
#t=10.5Seek to 10.5 s, play to end
#t=01:35Seek to 1 m 35 s, play to end
#t=1:02:30Seek to 1 h 2 m 30 s, play to end
#t=10,20Clip 10 s–20 s
#t=,30Clip 0 s–30 s
#t=90,eClip 90 s–end of media
#t=01:00,01:30&loopClip 60 s–90 s, looping
#t=npt:10,20Same as #t=10,20

Differences from the W3C spec

Media Extended implements the temporal dimension of the W3C Media Fragments URI specification with the following changes.

FeatureStatusNotes
NPT format (t=10,20)SupportedDefault format. Optional npt: prefix accepted.
SMPTE format (t=smpte:0:02:00)Not supportedFrame-based time codes are not parsed.
Wall-clock format (t=clock:...)Not supportedCalendar timestamps are not parsed.
Single-digit MM in MM:SSNot supportedThe W3C grammar allows 1:35; Media Extended requires 01:35.
e end sentinelExtensionMedia Extended only. Use to make "play to end" explicit.
Last-occurrence precedenceSupportedMatches the W3C precedence rule for repeated dimensions.

See also

On this page