Commit ab30c83cb28016fa65a21abc22e51d254e09fa3c

Authored by xp.Huang
2 parents 90fc9fc7 5f6fce4e

Merge branch 'fix/camera-manage-flv' into 'main_dev'

fix: 修复摄像头流媒体没有请求对应的接口

See merge request yunteng/thingskit-app!129
... ... @@ -119,6 +119,12 @@
119 119 this.mescroll.removeEmpty()
120 120 }
121 121
  122 + for(let item of res.items){
  123 + if(item.accessMode===1){
  124 + item.videoUrl = (await api.homeApi.byCameraIdGetDetailApi(item.id)).data.url
  125 + }
  126 + }
  127 +
122 128 if (pageNo == 1) {
123 129 this.list = res.items;
124 130 } else {
... ... @@ -129,30 +135,13 @@
129 135 //播放视频
130 136 async playVideo(e) {
131 137 const {currentTarget: {dataset: {accessmode,id}} = {}} = e
132   - const isExistVideoUrl = this.list.find(item => item.id == id).videoUrl
133   - if (accessmode === 1 && !isExistVideoUrl) {
134   - const res = api.homeApi.byCameraIdGetDetailApi(id)
135   - if (res) {
136   - const {data: {url} = {}} = res
137   - const index = this.list.findIndex(item => item.id === id)
138   - if (~index && url) {
139   - this.list.splice(index, 1, {
140   - ...this.list[index],
141   - videoUrl: url
142   - })
143   - this.$nextTick(() => {
144   - let currentId = 'video' + id;
145   - const videoContext = uni.createVideoContext(currentId, this);
146   - videoContext.play()
147   - })
148   - }
149   - }
150   - }
  138 + let currentId = 'video' + id;
  139 + const videoContext = uni.createVideoContext(currentId, this);
  140 + videoContext.play()
151 141 /**
152 142 * 点击全屏播放当前视频,暂停其余视频
153 143 * 兼容APP和MP端
154 144 */
155   - let currentId = 'video' + id;
156 145 this.videoContent = uni.createVideoContext(currentId, this);
157 146 this.videoContent.requestFullScreen();
158 147 // 获取视频列表
... ...
... ... @@ -17,7 +17,7 @@
17 17 .item {
18 18 margin-top: 80rpx;
19 19 width: 330rpx;
20   - height: 206rpx;
  20 + height: 210rpx;
21 21 // background-color: #fff;
22 22 border-radius: 10px;
23 23 margin-left: 25rpx;
... ...