Merge branch 'master' of github.com:sampotts/plyr

This commit is contained in:
Sam Potts
2018-05-19 11:25:02 +10:00
5 changed files with 39 additions and 1 deletions

View File

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

View File

@ -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) {