video.vue 658 B

12345678910111213141516171819202122232425262728293031323334
  1. <template>
  2. <view class="center"><image src="../../static/img/start.gif" mode=""></image></view>
  3. </template>
  4. <script>
  5. export default {
  6. onLoad() {
  7. const innerAudioContext = uni.createInnerAudioContext();
  8. innerAudioContext.autoplay = true;
  9. innerAudioContext.startTime = 2;
  10. innerAudioContext.src = '../../static/icon/video.mp3';
  11. innerAudioContext.onPlay(() => {
  12. console.log('开始播放');
  13. });
  14. setTimeout(() => {
  15. innerAudioContext.stop()
  16. uni.switchTab({
  17. url: '/pages/index/index'
  18. });
  19. }, 5000);
  20. }
  21. };
  22. </script>
  23. <style lang="scss">
  24. .center {
  25. width: 100%;
  26. height: 100vh;
  27. image {
  28. width: 100%;
  29. height: 100%;
  30. }
  31. }
  32. </style>