Skip to content

Commit

Permalink
fix(equipmentCloud): 设备视频监控
Browse files Browse the repository at this point in the history
  • Loading branch information
dawnwinterLiu committed Aug 24, 2022
1 parent a9f0e10 commit 5ecad38
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/store/modules/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ const actions = {
window.jstoken?.setJsToken(
window.location.hostname,
objectId,
sessionToken
sessionToken + '_uniapp'
)
}
if (sessionToken) {
Expand Down
41 changes: 39 additions & 2 deletions src/views/DeviceCloud/manage/editdevices.vue
Original file line number Diff line number Diff line change
Expand Up @@ -580,19 +580,56 @@
</el-tabs>
</el-tab-pane>
<el-tab-pane label="视频监控" name="video">
<el-form
:inline="true"
:model="deviceInfo"
class="demo-form-inline"
size="small"
>
<el-form-item
label="流类型"
>
<el-select
v-model="deviceInfo.detail.videoType"
placeholder="请选择"
size="mini"
style="width: 90px"
>
<el-option
v-for="(item, index) in videoOptions"
:key="index"
:label="item"
:value="item"
/>
</el-select>
</el-form-item>
<el-form-item
label="流地址"
>
<el-input
style="width: 900px"
v-model="deviceInfo.detail.videoSrc"
placeholder="流地址"
/>
</el-form-item>
<el-button
type="primary"
@click="updatevideoSrc(deviceInfo)"
>播放</el-button>
</el-form>
<dgiot-aliplayer
v-if="activeName === 'video'"
ref="dgiotPlayer"
height="76vh"
:playsource="
deviceInfo.detail && deviceInfo.detail.videoSrc
? deviceInfo.detail.videoSrc
: 'https://media.w3.org/2010/05/sintel/trailer.mp4'
: ''
"
:type="
deviceInfo.detail && deviceInfo.detail.videoType
? deviceInfo.detail.videoType
: 'mp4'
: ''
"
width="100%"
/>
Expand Down
11 changes: 11 additions & 0 deletions src/views/DeviceCloud/manage/js/editdevices.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ export default {
},
}
return {
videoOptions: ['m3u8', 'mp4', 'flv', 'mp3'],
commandInfo: {
dialog: false,
data: {},
Expand Down Expand Up @@ -1219,5 +1220,15 @@ export default {
this.devicesTableData[index] = newData
})
},
updatevideoSrc(deviceInfo) {
const params = {
detail: deviceInfo.detail,
}
this.$putDevice(deviceInfo.objectId, params)
this.activeName = 'first'
this.$nextTick(function () {
this.activeName = 'video'
})
},
},
}

1 comment on commit 5ecad38

@vercel
Copy link

@vercel vercel bot commented on 5ecad38 Aug 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

dgiot-dashboard – ./

dgiot-dashboard-git-master-dgiot.vercel.app
dgiot-dashboard.vercel.app
dgiot-dashboard-dgiot.vercel.app

Please sign in to comment.