Skip to content

Add seeking example to explainer / samples #257

@chcunningham

Description

@chcunningham

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    editorialchanges to wording, grammar, etc that don't modify the intended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions