mtaRadio.vue 523 B

1234567891011121314151617181920212223242526272829303132
  1. <template>
  2. <view></view>
  3. </template>
  4. <script setup>
  5. import {
  6. useAudio
  7. } from './useAudio';
  8. let historyData = null;
  9. const {
  10. handlePlay,
  11. handleStop,
  12. innerAudioContext
  13. } = useAudio();
  14. // 播放
  15. uni.$on('do-yy-audio-play', (data) => {
  16. // console.log(`playing ${data.stId}:`, data)
  17. handlePlay(data)
  18. })
  19. // 暂停
  20. uni.$on('do-yy-audio-stop', () => {
  21. // console.log(`ending ${data.stId}:`, data)
  22. handleStop()
  23. })
  24. // 销毁
  25. uni.$on('destory-stop', () => {
  26. handleStop()
  27. })
  28. </script>
  29. <style>
  30. </style>