w3c / w3c/webcodecs

Add seeking example to explainer / samples

Open
#257 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

editorial
Dominant language
HTML
Stars
1.3k
Forks
194
Avg merge
1d 13h
Merged PRs (30d)
3

Description

In response to user request: "How do we "seek" with the audio decoder?"

The recommendation is

  1. call decoder.reset() to drop any pending/queued work
  2. call decoder.configure(...) since reset() requires that. if the seek target has the same config as before, simply provide that config again to configure().
  3. call decoder.decode(...) with packets starting at the timestamp you're seeking to. Note, you'll need to start with a key frame, but this is mostly not a worry for audio. For video, a typical approach (like used for <video>) would be to start with the key frame at-or-before your seek time, then discard outputs at the output callback until you see the first output with the time you desire.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the explainer and samples referenced in the issue, then inspect how audio decoder examples are organized. Add a seeking example that demonstrates the reset, configure, and decode sequence described here, including the key-frame guidance, and verify that the sample makes the expected seeking behavior clear.

Written by the indexing model from the issue text.

Assessment

Tech stack
html
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.