New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update duration and remaining time displays on durationchange #3349

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
3 participants
@MattiasBuelens
Contributor

MattiasBuelens commented May 31, 2016

Description

The duration display and remaining time displays do not update when the tech dispatches a durationchange event without a timeupdate event. This PR ensures that these displays bind to durationchange 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 way player.duration() is updated on durationchange. 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 a durationchange event (without firing a timeupdate event), the time displays are currently not updated properly.

Steps to reproduce

  1. Create a custom Tech, for example based on TechFaker
  2. Set the tech's featuresTimeupdateEvents to true (to prevent the player from triggering interval-based timeupdate events)
  3. Make the tech update its duration and dispatch a durationchange event
  4. Notice the duration display and remaining time displays

This page demonstrates the issue when you hit the play button: http://jsbin.com/gedoxah/edit?html,output

Expected results

  • The duration display and remaining time display update their content with the new duration.

Actual results

  • The duration display and remaining time display are not updated with the new duration.

Specific Changes proposed

  • Add durationchange listeners in DurationDisplay and RemainingTimeDisplay
  • Remove the timeupdate and loadedmetadata listeners in DurationDisplay (since they are no longer needed)

Requirements Checklist

  • Feature implemented / Bug fixed
  • If necessary, more likely in a feature request than a bug fix
  • Reviewed by Two Core Contributors

@MattiasBuelens MattiasBuelens changed the title from Listen for durationchange event to update duration display and remain… to Update duration and remaining time displays on durationchange May 31, 2016

@gkatsev

This comment has been minimized.

Show comment
Hide comment
@gkatsev

gkatsev May 31, 2016

Member

Yeah, I think you may be right that we can just use durationchange.
LGTM.

Member

gkatsev commented May 31, 2016

Yeah, I think you may be right that we can just use durationchange.
LGTM.

@gkatsev gkatsev added minor and removed patch labels Jun 20, 2016

@BrandonOCasey

This comment has been minimized.

Show comment
Hide comment
@BrandonOCasey

BrandonOCasey Jun 21, 2016

Contributor

LGTM

Contributor

BrandonOCasey commented Jun 21, 2016

LGTM

@gkatsev gkatsev added confirmed and removed needs: LGTM labels Jul 18, 2016

@gkatsev gkatsev closed this in e2bfe09 Jul 18, 2016

@MattiasBuelens MattiasBuelens deleted the MattiasBuelens:time-display-durationchange branch Jul 24, 2016

gkatsev added a commit that referenced this pull request Oct 17, 2016

Restore timeupdate/loadedmetadata listeners for duration display (#3682)
There was a potential breakage that was caused by #3349. This restores the timeupdate and loadedmetadata listeners in the duration display that were removed. As part of 6.0, they could be removed as durationchange should be the correct and only listener we need.

gkatsev added a commit that referenced this pull request Oct 18, 2016

fix: Restore timeupdate/loadedmetadata listeners for duration display (
…#3682)

There was a potential breakage that was caused by #3349. This restores the timeupdate and loadedmetadata listeners in the duration display that were removed. As part of 6.0, they could be removed as durationchange should be the correct and only listener we need.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment