|
@@ -119,6 +119,12 @@ |
|
@@ -119,6 +119,12 @@ |
119
|
this.mescroll.removeEmpty()
|
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
|
if (pageNo == 1) {
|
128
|
if (pageNo == 1) {
|
123
|
this.list = res.items;
|
129
|
this.list = res.items;
|
124
|
} else {
|
130
|
} else {
|
|
@@ -129,30 +135,13 @@ |
|
@@ -129,30 +135,13 @@ |
129
|
//播放视频
|
135
|
//播放视频
|
130
|
async playVideo(e) {
|
136
|
async playVideo(e) {
|
131
|
const {currentTarget: {dataset: {accessmode,id}} = {}} = e
|
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
|
* 兼容APP和MP端
|
143
|
* 兼容APP和MP端
|
154
|
*/
|
144
|
*/
|
155
|
- let currentId = 'video' + id;
|
|
|
156
|
this.videoContent = uni.createVideoContext(currentId, this);
|
145
|
this.videoContent = uni.createVideoContext(currentId, this);
|
157
|
this.videoContent.requestFullScreen();
|
146
|
this.videoContent.requestFullScreen();
|
158
|
// 获取视频列表
|
147
|
// 获取视频列表
|