previewVideo.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <template>
  2. <view class="preview-video" v-if="show">
  3. <uni-icons class="preview-video-icon" type="clear" color="#fff" size="28" @click="$emit('close')"></uni-icons>
  4. <view class="block" @tap.stop>
  5. <video class="block-video" autoplay :src="videoUrl"></video>
  6. </view>
  7. </view>
  8. </template>
  9. <script>
  10. export default {
  11. name: "previewVideo",
  12. props: {
  13. videoUrl: {
  14. type: String,
  15. default: ''
  16. },
  17. show: {
  18. type: Boolean,
  19. default: false
  20. }
  21. },
  22. data() {
  23. return {};
  24. }
  25. }
  26. </script>
  27. <style lang="scss">
  28. .preview-video {
  29. background-color: $uni-black;
  30. position: fixed;
  31. top: 0;
  32. right: 0;
  33. bottom: 0;
  34. left: 0;
  35. z-index: 99;
  36. .block {
  37. padding: 0 30rpx;
  38. position: absolute;
  39. top: 50%;
  40. left: 50%;
  41. transform: translate(-50%, -50%);
  42. width: 100%;
  43. }
  44. .block-video {
  45. width: 100%;
  46. }
  47. .preview-video-icon {
  48. position: absolute;
  49. /* #ifdef MP-WEIXIN */
  50. top: 40rpx;
  51. /* #endif */
  52. /* #ifdef H5 */
  53. top: 120rpx;
  54. /* #endif */
  55. right: 40rpx;
  56. }
  57. }
  58. </style>