videoView.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <!--
  2. * @Title:
  3. * @Description: 视频预览
  4. * @Author: swp
  5. * @Date: 2022-08-24 10:49:21
  6. * @LastEditors:
  7. * @LastEditTime: 2022-08-24 10:49:21
  8. -->
  9. <template>
  10. <view class="container">
  11. <uni-nav-bar dark :fixed="true" backgroundColor="#3F9EFF" statusBar="false" left-icon="left" left-text="返回"
  12. @clickLeft="toBack">
  13. <view style="width: 100%;display: flex;flex-direction: row;justify-content: center;align-items: center;">
  14. <text style="color: white;font-size: 1rem;">{{title}}</text>
  15. </view>
  16. </uni-nav-bar>
  17. <uni-group>
  18. <view class="view-flex-inline-center">
  19. <video :src="videoPath"></video>
  20. </view>
  21. </uni-group>
  22. </view>
  23. </template>
  24. <script>
  25. import http from '@/http/api.js';
  26. import {
  27. oss,
  28. devUrl,
  29. prodUrl
  30. } from '@/common/setting';
  31. export default {
  32. components: {},
  33. data() {
  34. return {
  35. title: '视频预览',
  36. desc: '',
  37. show:false,
  38. videoPath:'',
  39. //videoPath:'https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/2minute-demo.mp4',
  40. //videoPath: 'https://wx.dahengsi.com:44301/mp4/galaxy/upload/20231229/061345ac7e717c1d0dc3546c4cd0df0c.mp4',
  41. baseURL: '',
  42. }
  43. },
  44. computed: {
  45. },
  46. onLoad(options) {
  47. this.videoPath =oss+options.url;
  48. console.log(this.videoPath)
  49. },
  50. onReady() {
  51. console.log("onReady++++++++++++++")
  52. },
  53. onShow() {
  54. },
  55. methods: {
  56. toBack() {
  57. uni.navigateBack({
  58. delta: 1
  59. })
  60. },
  61. }
  62. }
  63. </script>
  64. <style lang="scss" scoped>
  65. .container {
  66. padding: 0 0 100rpx;
  67. }
  68. .view-flex-rc {
  69. display: flex;
  70. flex-direction: row;
  71. justify-content: center;
  72. align-items: center;
  73. }
  74. .view-flex-cc {
  75. display: flex;
  76. flex-direction: column;
  77. justify-content: center;
  78. }
  79. </style>