Browse Source

智慧大屏中间视频改成图片

master
z_yu 2 years ago
parent
commit
9c3d4590bb
  1. 2
      .env.production
  2. 10
      src/views/video/index.vue

2
.env.production

@ -3,7 +3,7 @@ ENV = 'production'
# 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇,Nginx 配置
# 接口地址,注意协议,如果你没有配置 ssl,需要将 https 改为 http
# VUE_APP_BASE_API = 'https://openapitest.aiyxlib.com'
VUE_APP_BASE_API = 'http://192.168.99.107:7070'
VUE_APP_BASE_API = 'http://172.16.0.23:8080'
# 如果接口是 http 形式, wss 需要改为 ws
VUE_APP_WS_API = 'ws://192.168.99.107:7071'
VUE_APP_CAMERA_API = '192.168.99.107'

10
src/views/video/index.vue

@ -1,8 +1,9 @@
<template>
<div class="video-box">
<video width="100%" height="100%" controls loop autoplay muted :poster="poster">
<video v-if="this.src.endsWith('.mp4')" width="100%" height="100%" controls loop autoplay muted :poster="poster">
<source :src="src" type="video/mp4">
</video>
<img v-if="!this.src.endsWith('.mp4')" width="100%" height="100%" :src="src" />
</div>
</template>
@ -28,9 +29,14 @@ export default {
const params = {
libcode: '1201'
}
// this.src = 'D://uploadFile/9f904de6-0f5e-498e-8e5d-b7e14ea15496.mp4'.replace('D://', 'http://127.0.0.1:8888/')
FetchShowFileList(params).then(res => {
if (res.errCode === 0) {
this.src = res.data[0].filePath
const src = res.data[0].filePath.replace('D://', 'http://172.16.0.23:8888/')
this.src = src
// this.src = 'D://uploadFile/11503339-b829-4357-8379-d2b49106431f.mp4'.replace('D://', 'http://127.0.0.1:8888/')
// this.src = 'http://127.0.0.1:8888/uploadFile/9f904de6-0f5e-498e-8e5d-b7e14ea15496.mp4'
} else {
this.$message.error('接口错误')
}

Loading…
Cancel
Save