Skip to content
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

Trigger durationchange in the duration() method #863

Closed
heff opened this issue Dec 3, 2013 · 3 comments
Closed

Trigger durationchange in the duration() method #863

heff opened this issue Dec 3, 2013 · 3 comments
Assignees
Milestone

Comments

@heff
Copy link
Member

heff commented Dec 3, 2013

In #861 we hit a callstack size error because of a loop between duration() and onDurationChange().

We're not handling duration changes as cleanly as we should be. What should be happening is the tech should be listening for its own durationchange event, and when it occurs, set duration on the player instead of triggering the durationchange event on the player. Then the durationchange event should be triggered inside the duration() method after the cached duration is updated.

Related work: #2057

@heff
Copy link
Member Author

heff commented May 21, 2014

A new thought is to have the player add a listener on the tech, instead of having the tech trigger the event on the player or having the tech set the duration on the player. It would change the relationship between the tech and the player making the tech more dumb about the player. Need to do some more thinking about the implications of this.

This is related to #1194.

@dmlap
Copy link
Member

dmlap commented Apr 27, 2015

The Techs 2.0 plan is to have the player be responsible for listening to the tech to discover any interesting state changes. In the case of durationchange, the player would listen for this event on the tech and bubble it out to any external listeners. That means that we should not be triggering durationchange in duration()-- the responsibility for emitting the event would be on the tech.

It also means that durationchange will probably occur asynchronously. That is consistent with HTML5 video durationchange events.

@eXon
Copy link
Contributor

eXon commented Apr 27, 2015

@dmlap see #2057 for how the tech 2.0 will be. It's almost done.

@heff heff modified the milestones: Techs 2.0, v5.0.0 Apr 30, 2015
@heff heff closed this as completed in #2552 Sep 7, 2015
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants