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
fix: don't throttle duration change updates #4635
Changes from all commits
af4cf3f
b19efc5
e8ee563
8b48161
3006fe4
835f720
6bf2b7d
580db47
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1239,9 +1239,7 @@ class Component { | |
fn = Fn.bind(this, fn); | ||
|
||
const timeoutId = window.setTimeout(fn, timeout); | ||
const disposeFn = function() { | ||
this.clearTimeout(timeoutId); | ||
}; | ||
const disposeFn = () => this.clearTimeout(timeoutId); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seemed a bit weird to me in a regular function we wouldn't have access to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we call the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. at least, it should be. this is ok too. |
||
|
||
disposeFn.guid = `vjs-timeout-${timeoutId}`; | ||
|
||
|
@@ -1302,9 +1300,7 @@ class Component { | |
|
||
const intervalId = window.setInterval(fn, interval); | ||
|
||
const disposeFn = function() { | ||
this.clearInterval(intervalId); | ||
}; | ||
const disposeFn = () => this.clearInterval(intervalId); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed here as well |
||
|
||
disposeFn.guid = `vjs-interval-${intervalId}`; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,7 +48,7 @@ class TimeDisplay extends Component { | |
'aria-live': 'off' | ||
}, Dom.createEl('span', { | ||
className: 'vjs-control-text', | ||
textContent: this.localize(this.contentText_) | ||
textContent: this.localize(this.controlText_) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this was a typo, I could arguable pull this into its own pr if we want, but this is one of the causes of the broken unit tests. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is what's causing the issue on ie8? https://travis-ci.org/videojs/video.js/jobs/290639178#L1937-L1941 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. im actually not sure what is causing the failure on IE8, this must have just fixed IE9 |
||
})); | ||
|
||
this.updateTextNode_(); | ||
|
@@ -63,9 +63,14 @@ class TimeDisplay extends Component { | |
* @private | ||
*/ | ||
updateTextNode_() { | ||
if (this.textNode_) { | ||
this.contentEl_.removeChild(this.textNode_); | ||
if (!this.contentEl_) { | ||
return; | ||
} | ||
|
||
while (this.contentEl_.firstChild) { | ||
this.contentEl_.removeChild(this.contentEl_.firstChild); | ||
} | ||
|
||
this.textNode_ = document.createTextNode(this.formattedTime_ || '0:00'); | ||
this.contentEl_.appendChild(this.textNode_); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I almost commented saying that this should be changed to
this.setTimeout
before realizing what this line is for 😆