Skip to content

Commit 4d369ca

Browse files
fix: ignore undefined options
1 parent feb8fd6 commit 4d369ca

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/composables/player.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -681,8 +681,11 @@ function resolveAttributes(options: PlayerOptions = {}): PlayerAttributes {
681681
const attributes = Object
682682
.entries(options)
683683
.reduce((attributes, [option, value]) => {
684-
const attribute = (<any>DATA_ATTRIBUTE_NAMES)[option] || option
685-
attributes[`data-${attribute}`] = value
684+
if (value !== undefined) {
685+
const attribute = (<any>DATA_ATTRIBUTE_NAMES)[option] || option
686+
attributes[`data-${attribute}`] = value
687+
}
688+
686689
return attributes
687690
}, <PlayerAttributes>{
688691
...DEFAULT_ATTRIBUTES

0 commit comments

Comments
 (0)