Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

useMediaControls: Overwrites the values set by the attributes #492

Closed
cawa-93 opened this issue May 11, 2021 · 3 comments · Fixed by #500
Closed

useMediaControls: Overwrites the values set by the attributes #492

cawa-93 opened this issue May 11, 2021 · 3 comments · Fixed by #500

Comments

@cawa-93
Copy link
Member

cawa-93 commented May 11, 2021

el.loop = unref(options.loop)!
el.controls = unref(options.controls)!
el.muted = unref(options.muted)!
el.preload = unref(options.preload)!
el.autoplay = unref(options.autoplay)!
el.volume = unref(volume)!
;(el as HTMLVideoElement).playsInline = unref(options.playsinline)!
;(el as HTMLVideoElement).poster = unref(options.poster) || ''

I'm not sure if this was intended, but it overwrites the default (browser) values and those that were set by the attributes.

Example:

<video controls src="">
useMediaControls(video, {})

Expected:

video.controls // true // set by attribute
video.preload // "metadata" // default browser behaviour

Actual:

video.controls // false
video.preload // "auto"
@wheatjs
Copy link
Member

wheatjs commented May 11, 2021

Hmm yeah, perhaps whenever the user doesn't specify an option we can default to the attributes. Would you like to make a PR for this? If not I can do it sometime this week

@cawa-93
Copy link
Member Author

cawa-93 commented May 11, 2021

Ok. I Create PR tomorrow.

@wheatjs
Copy link
Member

wheatjs commented May 11, 2021

Sounds good, thanks 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants