mirror of
https://github.com/videojs/video.js.git
synced 2025-01-02 06:32:07 +02:00
feat: remove closest fallback (#7853)
This commit is contained in:
parent
f46b83002e
commit
63a2d027f4
@ -330,22 +330,10 @@ class Player extends Component {
|
||||
|
||||
// If language is not set, get the closest lang attribute
|
||||
if (!options.language) {
|
||||
if (typeof tag.closest === 'function') {
|
||||
const closest = tag.closest('[lang]');
|
||||
const closest = tag.closest('[lang]');
|
||||
|
||||
if (closest && closest.getAttribute) {
|
||||
options.language = closest.getAttribute('lang');
|
||||
}
|
||||
} else {
|
||||
let element = tag;
|
||||
|
||||
while (element && element.nodeType === 1) {
|
||||
if (Dom.getAttributes(element).hasOwnProperty('lang')) {
|
||||
options.language = element.getAttribute('lang');
|
||||
break;
|
||||
}
|
||||
element = element.parentNode;
|
||||
}
|
||||
if (closest) {
|
||||
options.language = closest.getAttribute('lang');
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user