Skip to content

Dynamically changing src doesn't change duration #1755

@PideaLtd

Description

@PideaLtd

Feature Proposal

I'm putting together a web page that receives JSON data containing, among other things, a URL to an MP3. The JSON is pushed via websockets to the page.

When the page first loads I need to play a clip to allow the browser to permit audio so I play a 2 second silent MP3.

Using the solution outlined here:

#825

I can use a single instance of Howler and can change the audio source but the duration does not change so only the first 2 seconds of my clips play.

If I increase the size of the silent MP3 file that I first play to 10 seconds then reload the page, the first 10 seconds of my clips play but they can vary in length from 2 to 60 seconds.

I've tried changing the proposed changeSrc function so that:

self.unload(true);

becomes:

self.unload(false);

but that makes no difference. Is there a way to force Howler to pick up the new duration ?

Possible Implementation

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