mirror of
https://github.com/videojs/video.js.git
synced 2024-12-12 11:15:04 +02:00
@gkatsev made videojs requirable in node. closes #3540
This commit is contained in:
parent
c859d8e104
commit
141ecf221b
@ -2937,7 +2937,7 @@ Player.prototype.options_ = {
|
||||
'textTrackSettings'
|
||||
],
|
||||
|
||||
language: navigator.languages && navigator.languages[0] || navigator.userLanguage || navigator.language || 'en',
|
||||
language: navigator && (navigator.languages && navigator.languages[0] || navigator.userLanguage || navigator.language) || 'en',
|
||||
|
||||
// locales and their language translations
|
||||
languages: {},
|
||||
|
@ -67,7 +67,10 @@ function createQuerier(method) {
|
||||
if (isNonBlankString(context)) {
|
||||
context = document.querySelector(context);
|
||||
}
|
||||
return (isEl(context) ? context : document)[method](selector);
|
||||
|
||||
const ctx = isEl(context) ? context : document;
|
||||
|
||||
return ctx[method] && ctx[method](selector);
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -108,7 +108,9 @@ if (window.VIDEOJS_NO_DYNAMIC_STYLE !== true) {
|
||||
style = stylesheet.createStyleElement('vjs-styles-defaults');
|
||||
const head = Dom.$('head');
|
||||
|
||||
head.insertBefore(style, head.firstChild);
|
||||
if (head) {
|
||||
head.insertBefore(style, head.firstChild);
|
||||
}
|
||||
stylesheet.setTextContent(style, `
|
||||
.video-js {
|
||||
width: 300px;
|
||||
|
Loading…
Reference in New Issue
Block a user