A product page keeps showing the poster for a moment after someone clicks Play. If you want to compare two player configurations, define the same start and end points for both. With a native HTML video element you control, you can start at the click and stop when the browser submits the first video frame for composition.
Start with a fresh video element
For this version of the test, start with a video element that has no source and a separate Play button. In its click handler, record performance.now(), register requestVideoFrameCallback, and then set the source. Subtract the recorded start time from presentationTime to get milliseconds. For a fresh element, check that presentedFrames is 1.
const t0 = performance.now() video.requestVideoFrameCallback((now, frame) => { console.log(frame.presentationTime - t0, frame.presentedFrames) }) video.src = "demo.mp4" video.play().catch(error => console.error(error))
The presentationTime property records when the browser submitted the frame for composition. The callback can run later. This browser-side timestamp gives you a repeatable reference point for the test. A physical measurement of display output needs its own setup. Log failed and abandoned starts alongside successful measurements.
Track metadata and preloaded frames separately
In a local Chrome test with a fresh source, the click came first, then loadedmetadata, then a callback with presentedFrames equal to 1. In a second run with the source set before the click, metadata arrived first and the callback observed after the click reported frame 2. That is a reason to document preloading as a separate test condition. The metadata event is a useful diagnostic checkpoint, including when you need to know whether the browser has found the video dimensions.
Keep the comparison fair
- Use a visible tab and a defined network condition. Record the file version, browser, cache state and preload setting.
- Repeat each case. Group fresh-page starts separately from starts with preloaded media. Time stalls after playback starts as a separate measure.
- For a hosted player in a cross-origin iframe, use the events exposed by its documented interface. Record which playback milestone the event represents before comparing it with measurements from another player.