Skip to content

Commit 5ecad38

Browse files
committed
fix(equipmentCloud): 设备视频监控
1 parent a9f0e10 commit 5ecad38

File tree

3 files changed

+51
-3
lines changed

3 files changed

+51
-3
lines changed

src/store/modules/user.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ const actions = {
434434
window.jstoken?.setJsToken(
435435
window.location.hostname,
436436
objectId,
437-
sessionToken
437+
sessionToken + '_uniapp'
438438
)
439439
}
440440
if (sessionToken) {

src/views/DeviceCloud/manage/editdevices.vue

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -580,19 +580,56 @@
580580
</el-tabs>
581581
</el-tab-pane>
582582
<el-tab-pane label="视频监控" name="video">
583+
<el-form
584+
:inline="true"
585+
:model="deviceInfo"
586+
class="demo-form-inline"
587+
size="small"
588+
>
589+
<el-form-item
590+
label="流类型"
591+
>
592+
<el-select
593+
v-model="deviceInfo.detail.videoType"
594+
placeholder="请选择"
595+
size="mini"
596+
style="width: 90px"
597+
>
598+
<el-option
599+
v-for="(item, index) in videoOptions"
600+
:key="index"
601+
:label="item"
602+
:value="item"
603+
/>
604+
</el-select>
605+
</el-form-item>
606+
<el-form-item
607+
label="流地址"
608+
>
609+
<el-input
610+
style="width: 900px"
611+
v-model="deviceInfo.detail.videoSrc"
612+
placeholder="流地址"
613+
/>
614+
</el-form-item>
615+
<el-button
616+
type="primary"
617+
@click="updatevideoSrc(deviceInfo)"
618+
>播放</el-button>
619+
</el-form>
583620
<dgiot-aliplayer
584621
v-if="activeName === 'video'"
585622
ref="dgiotPlayer"
586623
height="76vh"
587624
:playsource="
588625
deviceInfo.detail && deviceInfo.detail.videoSrc
589626
? deviceInfo.detail.videoSrc
590-
: 'https://media.w3.org/2010/05/sintel/trailer.mp4'
627+
: ''
591628
"
592629
:type="
593630
deviceInfo.detail && deviceInfo.detail.videoType
594631
? deviceInfo.detail.videoType
595-
: 'mp4'
632+
: ''
596633
"
597634
width="100%"
598635
/>

src/views/DeviceCloud/manage/js/editdevices.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ export default {
129129
},
130130
}
131131
return {
132+
videoOptions: ['m3u8', 'mp4', 'flv', 'mp3'],
132133
commandInfo: {
133134
dialog: false,
134135
data: {},
@@ -1219,5 +1220,15 @@ export default {
12191220
this.devicesTableData[index] = newData
12201221
})
12211222
},
1223+
updatevideoSrc(deviceInfo) {
1224+
const params = {
1225+
detail: deviceInfo.detail,
1226+
}
1227+
this.$putDevice(deviceInfo.objectId, params)
1228+
this.activeName = 'first'
1229+
this.$nextTick(function () {
1230+
this.activeName = 'video'
1231+
})
1232+
},
12221233
},
12231234
}

0 commit comments

Comments
 (0)