Expose defaults (enable overriding)
This commit is contained in:
parent
765c01e83d
commit
7ca2169790
@ -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;
|
||||
|
@ -703,6 +703,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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user