video.vue 755 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <template>
  2. <view class="container">
  3. <video v-if="videourl" class="tui-video" :src="videourl" enable-danmu danmu-btn controls autoplay>
  4. </video>
  5. </view>
  6. </template>
  7. <script>
  8. export default {
  9. data() {
  10. return {
  11. videourl: ''
  12. }
  13. },
  14. onLoad(e) {
  15. if (e.videourl) {
  16. this.videourl = e.videourl;
  17. }
  18. },
  19. methods: {
  20. },
  21. /**
  22. * 页面相关事件处理函数--监听用户下拉动作
  23. */
  24. onPullDownRefresh: function() {
  25. setTimeout(() => {
  26. uni.stopPullDownRefresh()
  27. }, 200);
  28. },
  29. }
  30. </script>
  31. <style>
  32. page,
  33. .container {
  34. height: 100%;
  35. background-color: #000000;
  36. }
  37. .container {
  38. display: flex;
  39. align-items: center;
  40. justify-content: center;
  41. }
  42. .tui-video {
  43. width: 100%;
  44. height: 100%;
  45. }
  46. </style>