Skip to content

VideoJS does not update the duration display when the duration is NaN or 0. #5347

@fketchakeu

Description

@fketchakeu

Description

VideoJS does not update the duration display when the duration is NaN or 0.
Here is a reduced test case (Case A).
The issue also occurs when changing the player source and preload = 'none'.
Here is a reduced test case (Case B)

Steps to reproduce Case A

Go to Case A .
After the video has loaded, note the duration display has been updated.
click on setDuration(0) or setDuration(NaN).

Results In Case A

Expected

When clicking on setDuration(10) or setDuration(30) or setDuration(0.0001), the duration display UI updated.
Thus when clicking on setDuration(0) or setDuration(NaN) we expect the duration display to update to "0:00”,
or perhaps something like '-:-', in the case of NaN.

Actual

Clicking on setDuration(0) or setDuration(NaN) does not update the duration display.

Steps to reproduce Case B

Go to Case B
Click on the "swap SRC" button and observe the duration display.

Results In Case B

Expected

The duration display should reset to 0:00 or something like '-:-'.

Actual

The duration display doesn't update when the source is changed.

Additional Information

With plain html5 video, changing the source does indeed reset the duration,
in harmony with Spec (see step 10.4 of media element load algorithm).
e.g. Html5 equivalent of Case B
When the source is changed, in Firefox and Chrome, the player UI is updated to reflect the duration change.

versions

videojs

This is occurring in the latest version as of this post (v7.1.0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions