ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、视频、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
[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> ```