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 watch target that may not be a Ref #3919

Open
7 tasks done
jcc1997 opened this issue Apr 10, 2024 · 0 comments · May be fixed by #3921
Open
7 tasks done

useMediaControls watch target that may not be a Ref #3919

jcc1997 opened this issue Apr 10, 2024 · 0 comments · May be fixed by #3921

Comments

@jcc1997
Copy link

jcc1997 commented Apr 10, 2024

Describe the bug

target: MaybeRef<HTMLMediaElement | null | undefined> maybe just an element. But not Ref.

so codes below watching target causes warnings.

watch([target, volume], () => {
const el = toValue(target)
if (!el)
return
el.volume = volume.value
})
watch([target, muted], () => {
const el = toValue(target)
if (!el)
return
el.muted = muted.value
})
watch([target, rate], () => {
const el = toValue(target)
if (!el)
return
el.playbackRate = rate.value
})

image

Reproduction

https://stackblitz.com/edit/vitejs-vite-liqyke?file=src%2FApp.vue

System Info

System:
    OS: macOS 14.2.1
    CPU: (8) x64 Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz
    Memory: 81.46 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.18.2 - ~/.nvm/versions/node/v18.18.2/bin/node
    Yarn: 4.0.2 - ~/.nvm/versions/node/v18.18.2/bin/yarn
    npm: 9.8.1 - ~/.nvm/versions/node/v18.18.2/bin/npm
  Browsers:
    Chrome: 123.0.6312.107
    Edge: 123.0.2420.81
    Safari: 17.2.1
  npmPackages:
    @vueuse/components: ^10.7.2 => 10.7.2 
    @vueuse/core: ^10.9.0 => 10.9.0 
    @vueuse/router: ^10.7.2 => 10.7.2 
    vue: ^3.4.21 => 3.4.21

Used Package Manager

yarn

Validations

@huiliangShen huiliangShen linked a pull request Apr 10, 2024 that will close this issue
5 tasks
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.

1 participant