1234567891011121314151617181920212223242526272829303132 |
- <template>
- <view></view>
- </template>
- <script setup>
- import {
- useAudio
- } from './useAudio';
- let historyData = null;
- const {
- handlePlay,
- handleStop,
- innerAudioContext
- } = useAudio();
- // 播放
- uni.$on('do-yy-audio-play', (data) => {
- // console.log(`playing ${data.stId}:`, data)
- handlePlay(data)
- })
- // 暂停
- uni.$on('do-yy-audio-stop', () => {
- // console.log(`ending ${data.stId}:`, data)
- handleStop()
- })
- // 销毁
- uni.$on('destory-stop', () => {
- handleStop()
- })
- </script>
- <style>
- </style>
|