Check if key is a string before attempt --plyr checking

This commit is contained in:
Syed Husain 2020-07-30 19:43:04 +08:00
parent 423b7b276f
commit 4c1ae8f3ce

View File

@ -270,7 +270,7 @@ const ui = {
// Loop through values (as they are the keys when the object is spread 🤔)
Object.values({ ...this.media.style })
// We're only fussed about Plyr specific properties
.filter(key => !is.empty(key) && key.startsWith('--plyr'))
.filter(key => !is.empty(key) && is.string(key) && key.startsWith('--plyr'))
.forEach(key => {
// Set on the container
this.elements.container.style.setProperty(key, this.media.style.getPropertyValue(key));