1
0
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:
Gary Katsevman 2016-08-22 14:20:23 -04:00
parent c859d8e104
commit 141ecf221b
3 changed files with 8 additions and 3 deletions

View File

@ -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: {},

View File

@ -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);
};
}

View File

@ -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;