diff --git a/packages/core/useMediaControls/index.ts b/packages/core/useMediaControls/index.ts index 29847cc3318..3e832ddf5e4 100644 --- a/packages/core/useMediaControls/index.ts +++ b/packages/core/useMediaControls/index.ts @@ -1,6 +1,6 @@ import { ref, watch, watchEffect } from 'vue-demi' import type { Fn, MaybeRef, MaybeRefOrGetter } from '@vueuse/shared' -import { createEventHook, isObject, toValue, tryOnScopeDispose, watchIgnorable } from '@vueuse/shared' +import { createEventHook, isObject, toRef, toValue, tryOnScopeDispose, watchIgnorable } from '@vueuse/shared' import { useEventListener } from '../useEventListener' import type { ConfigurableDocument } from '../_configurable' import { defaultDocument } from '../_configurable' @@ -144,6 +144,7 @@ const defaultOptions: UseMediaControlsOptions = { } export function useMediaControls(target: MaybeRef, options: UseMediaControlsOptions = {}) { + target = toRef(target) options = { ...defaultOptions, ...options,