mirror of
https://github.com/videojs/video.js.git
synced 2025-03-17 21:18:27 +02:00
fix(time-display): add a null check for text node (#6977)
fixes #6699 closes #6700
This commit is contained in:
parent
0631f037eb
commit
3e30f83bb1
@ -5,6 +5,7 @@ import document from 'global/document';
|
||||
import Component from '../../component.js';
|
||||
import * as Dom from '../../utils/dom.js';
|
||||
import formatTime from '../../utils/format-time.js';
|
||||
import log from '../../utils/log.js';
|
||||
|
||||
/**
|
||||
* Displays time information about the video
|
||||
@ -86,7 +87,13 @@ class TimeDisplay extends Component {
|
||||
return;
|
||||
}
|
||||
|
||||
const oldNode = this.textNode_;
|
||||
let oldNode = this.textNode_;
|
||||
|
||||
if (oldNode && !this.contentEl_.contains(oldNode)) {
|
||||
oldNode = null;
|
||||
|
||||
log.warn('TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.');
|
||||
}
|
||||
|
||||
this.textNode_ = document.createTextNode(this.formattedTime_);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user