video.vue 751 B

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