aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Potts <sam@potts.es>2018-05-19 11:25:02 +1000
committerSam Potts <sam@potts.es>2018-05-19 11:25:02 +1000
commit602353f4d953c5b083ee22fd0ee479ad605de281 (patch)
tree34866e67f21a3e14c6874313ae8787795db96605
parent51814249afd4337c1a7d1426ea913988228a7574 (diff)
parent797b70998faf1789831cd28a4fbd4933e5ad187f (diff)
downloadplyr-602353f4d953c5b083ee22fd0ee479ad605de281.tar.lz
plyr-602353f4d953c5b083ee22fd0ee479ad605de281.tar.xz
plyr-602353f4d953c5b083ee22fd0ee479ad605de281.zip
Merge branch 'master' of github.com:sampotts/plyr
-rw-r--r--gulpfile.js2
-rw-r--r--package.json1
-rw-r--r--src/js/plyr.js3
-rw-r--r--src/js/utils.js5
-rw-r--r--yarn.lock29
5 files changed, 39 insertions, 1 deletions
diff --git a/gulpfile.js b/gulpfile.js
index eec51aba..262fa2d2 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -13,6 +13,7 @@ const filter = require('gulp-filter');
const sass = require('gulp-sass');
const cleancss = require('gulp-clean-css');
const run = require('run-sequence');
+const header = require('gulp-header');
const prefix = require('gulp-autoprefixer');
const gitbranch = require('git-branch');
const svgstore = require('gulp-svgstore');
@@ -146,6 +147,7 @@ const build = {
options,
),
)
+ .pipe(header('typeof navigator === "object" && ')) // "Support" SSR (#935)
.pipe(sourcemaps.write(''))
.pipe(gulp.dest(output))
.pipe(filter('**/*.js'))
diff --git a/package.json b/package.json
index 9ae3bcad..77bcc78a 100644
--- a/package.json
+++ b/package.json
@@ -24,6 +24,7 @@
"gulp-clean-css": "^3.9.4",
"gulp-concat": "^2.6.1",
"gulp-filter": "^5.1.0",
+ "gulp-header": "^2.0.5",
"gulp-open": "^3.0.1",
"gulp-rename": "^1.2.2",
"gulp-replace": "^0.6.1",
diff --git a/src/js/plyr.js b/src/js/plyr.js
index 6a3deade..bed09827 100644
--- a/src/js/plyr.js
+++ b/src/js/plyr.js
@@ -55,6 +55,7 @@ class Plyr {
this.config = utils.extend(
{},
defaults,
+ Plyr.defaults,
options || {},
(() => {
try {
@@ -1269,4 +1270,6 @@ class Plyr {
}
}
+Plyr.defaults = utils.cloneDeep(defaults);
+
export default Plyr;
diff --git a/src/js/utils.js b/src/js/utils.js
index 1de5ed6c..a58d8555 100644
--- a/src/js/utils.js
+++ b/src/js/utils.js
@@ -706,6 +706,11 @@ const utils = {
return array.filter((item, index) => array.indexOf(item) === index);
},
+ // Clone nested objects
+ cloneDeep(object) {
+ return JSON.parse(JSON.stringify(object));
+ },
+
// Get the closest value in an array
closest(array, value) {
if (!utils.is.array(array) || !array.length) {
diff --git a/yarn.lock b/yarn.lock
index 604dd44d..668865fc 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1604,6 +1604,12 @@ concat-stream@^1.6.0:
readable-stream "^2.2.2"
typedarray "^0.0.6"
+concat-with-sourcemaps@*:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/concat-with-sourcemaps/-/concat-with-sourcemaps-1.1.0.tgz#d4ea93f05ae25790951b99e7b3b09e3908a4082e"
+ dependencies:
+ source-map "^0.6.1"
+
concat-with-sourcemaps@^1.0.0:
version "1.0.5"
resolved "https://registry.yarnpkg.com/concat-with-sourcemaps/-/concat-with-sourcemaps-1.0.5.tgz#8964bc2347d05819b63798104d87d6e001bed8d0"
@@ -3024,6 +3030,14 @@ gulp-filter@^5.1.0:
plugin-error "^0.1.2"
streamfilter "^1.0.5"
+gulp-header@^2.0.5:
+ version "2.0.5"
+ resolved "https://registry.yarnpkg.com/gulp-header/-/gulp-header-2.0.5.tgz#16e229c73593ade301168024fea68dab75d9d38c"
+ dependencies:
+ concat-with-sourcemaps "*"
+ lodash.template "^4.4.0"
+ through2 "^2.0.0"
+
gulp-open@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/gulp-open/-/gulp-open-3.0.1.tgz#a2f747b4aa31abec9399b527158b0368c57e2102"
@@ -4176,7 +4190,7 @@ lodash._reinterpolate@^2.4.1, lodash._reinterpolate@~2.4.1:
version "2.4.1"
resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-2.4.1.tgz#4f1227aa5a8711fc632f5b07a1f4607aab8b3222"
-lodash._reinterpolate@^3.0.0:
+lodash._reinterpolate@^3.0.0, lodash._reinterpolate@~3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d"
@@ -4342,6 +4356,13 @@ lodash.template@^3.0.0:
lodash.restparam "^3.0.0"
lodash.templatesettings "^3.0.0"
+lodash.template@^4.4.0:
+ version "4.4.0"
+ resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-4.4.0.tgz#e73a0385c8355591746e020b99679c690e68fba0"
+ dependencies:
+ lodash._reinterpolate "~3.0.0"
+ lodash.templatesettings "^4.0.0"
+
lodash.templatesettings@^3.0.0:
version "3.1.1"
resolved "https://registry.yarnpkg.com/lodash.templatesettings/-/lodash.templatesettings-3.1.1.tgz#fb307844753b66b9f1afa54e262c745307dba8e5"
@@ -4349,6 +4370,12 @@ lodash.templatesettings@^3.0.0:
lodash._reinterpolate "^3.0.0"
lodash.escape "^3.0.0"
+lodash.templatesettings@^4.0.0:
+ version "4.1.0"
+ resolved "https://registry.yarnpkg.com/lodash.templatesettings/-/lodash.templatesettings-4.1.0.tgz#2b4d4e95ba440d915ff08bc899e4553666713316"
+ dependencies:
+ lodash._reinterpolate "~3.0.0"
+
lodash.templatesettings@~2.4.1:
version "2.4.1"
resolved "https://registry.yarnpkg.com/lodash.templatesettings/-/lodash.templatesettings-2.4.1.tgz#ea76c75d11eb86d4dbe89a83893bb861929ac699"