Update duration and remaining time displays on durationchange #3349
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The duration display and remaining time displays do not update when the tech dispatches a
durationchange
event without atimeupdate
event. This PR ensures that these displays bind todurationchange
to update their content.There is a comment in
DurationDisplay
saying that this change should be done once a previous bug was resolved with the wayplayer.duration()
is updated ondurationchange
. I believe this bug was fixed with #2552, so I think it should be safe to do this change now.Problem
In the current version, if a
Tech
updates its duration and only fires adurationchange
event (without firing atimeupdate
event), the time displays are currently not updated properly.Steps to reproduce
Tech
, for example based onTechFaker
featuresTimeupdateEvents
totrue
(to prevent the player from triggering interval-basedtimeupdate
events)durationchange
eventThis page demonstrates the issue when you hit the play button: http://jsbin.com/gedoxah/edit?html,output
Expected results
Actual results
Specific Changes proposed
durationchange
listeners inDurationDisplay
andRemainingTimeDisplay
timeupdate
andloadedmetadata
listeners inDurationDisplay
(since they are no longer needed)Requirements Checklist