💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、豆包、星火、月之暗面及文生图、文生视频 广告
[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> ```