Skip to content

HTML5 Audio Position is lost after unlocking. #1736

Open
@EthanShoeDev

Description

@EthanShoeDev

The Problem

When howler unlocks the html5 audios, it loses the current position.
This causes problems when we:

  • Load an audio on page load.
  • Seek to a position in onload.
  • The user clicks the page, so audio is unlocked.
  • Current position is lost.

Reproducible Example

No response

Reproduction Steps

  • Load an audio on page load.
  • Seek to a position in onload.
  • The user clicks the page, so audio is unlocked.

Possible Solution

Save the currentPosition to a variable and assign it back after calling .load().

Context

When resuming playback from the last played position on page load, it is very confusing as to why the position is lost.

Howler.js Version

v2.2.4

Affected Browser(s)/Versiuon(s)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions