You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
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.
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
The text was updated successfully, but these errors were encountered: