合规国际互联网加速 OSASE为企业客户提供高速稳定SD-WAN国际加速解决方案。 广告
[TOC] ## useMediaControls ``` <script setup lang="ts"> import { onMounted, ref } from 'vue' import { useMediaControls } from '@vueuse/core' const video = ref() const { playing, currentTime, duration, volume } = useMediaControls(video, { src: 'video.mp4', }) // Change initial media properties onMounted(() => { volume.value = 0.5 currentTime.value = 60 }) </script> <template> <video ref="video" /> <button @click="playing = !playing">Play / Pause</button> <span>{{ currentTime }} / {{ duration }}</span> </template> ```