当前位置: 首页 > news >正文

网站建设与规划心得郴州seo快速排名

网站建设与规划心得,郴州seo快速排名,wordpress页面属性模板怎么添加,pageadmin的最新版本前端vue,接入ws视频播放 云台控制 ,回放预览,都是需要调对应的海康接口。相当于,点击时,请求后台写好的接口,接口再去请求海康的接口 调用云台控制是,操作一次,不会自己停止&#x…

前端vue,接入ws视频播放

云台控制 ,回放预览,都是需要调对应的海康接口。相当于,点击时,请求后台写好的接口,接口再去请求海康的接口

 调用云台控制是,操作一次,不会自己停止,需要手动停止才会停止操作。

引入对应的插件

 

以下是vue播放组件代码

<template><div class="WsStreamVideoPlayer"><div id="player" style="width: 100%;height: 100%;" /></div>
</template><script>
import { getStream, videoControlling, getBackStream } from '@/api/hk/video'
export default {name: 'WsStreamVideoPlayer',// 注册components: {},props: {videoCode: {type: String,default: () => {return ''}}},// 定义变量data() {return {// 播放器对象player: null}},computed: {},watch: {},created() {},mounted() {},methods: {videoInit() {this.player = new window.JSPlugin({szId: 'player',szBasePath: '/static/hk',iMaxSplit: 4,iCurrentSplit: 1,openDebug: true,oStyle: {borderSelect: '#fff'}})},async operateClick(type) {const param = {videoCode: this.videoCode,action: 0,operateType: type}if (type === 'stop') {param.action = 1param.operateType = 'UP'}const operateRes = await videoControlling(param)console.log(operateRes)},async startView() {const streamResp = await getStream({ videoCode: this.videoCode })const preUrl = streamResp.data.urlconst param = {playURL: preUrl,// 1:高级模式  0:普通模式,高级模式支持所有mode: 1}this.player.JS_Play(preUrl, param, 0).then(() => { console.log('realplay success') },e => { console.error(e) })// 事件回调绑定this.player.JS_SetWindowControlCallback({windowEventSelect: function(iWndIndex) { // 插件选中窗口回调console.log('windowSelect callback: ', iWndIndex)},pluginErrorHandler: function(iWndIndex, iErrorCode, oError) { // 插件错误回调console.log('视频断了,再次重连', iWndIndex, iErrorCode, oError)this.player.JS_Stop().then(() => {this.player.rate = 0console.log('stop realplay success')this.startView()},e => { console.error(e) })},windowEventOver: function(iWndIndex) { // 鼠标移过回调// console.log(iWndIndex);},windowEventOut: function(iWndIndex) { // 鼠标移出回调// console.log(iWndIndex);},windowEventUp: function(iWndIndex) { // 鼠标mouseup事件回调// console.log(iWndIndex);},windowFullCcreenChange: function(bFull) { // 全屏切换回调console.log('fullScreen callback: ', bFull)},firstFrameDisplay: function(iWndIndex, iWidth, iHeight) { // 首帧显示回调console.log('firstFrame loaded callback: ', iWndIndex, iWidth, iHeight)},performanceLack: function() { // 性能不足回调console.log('performanceLack callback: ')}})},async startBackPlay() {const { beginTime, endTime } = thisconst params = {videoCode: this.videoCode,beginTime,endTime}const streamResp = await getBackStream(params)const preUrl = streamResp.data.urlconst param = {playURL: preUrl,// 1:高级模式  0:普通模式,高级模式支持所有mode: 1}const playBeginTime = beginTime.split(' ')[0] + 'T' + beginTime.split(' ')[1] + 'Z'const playEndTime = endTime.split(' ')[0] + 'T' + endTime.split(' ')[1] + 'Z'this.player.JS_Play(preUrl, param, 0, playBeginTime, playEndTime).then(() => {console.log('playbackStart success')},e => { console.error(e) })}}
}
</script><style scoped lang="scss">
.WsStreamVideoPlayer {width: 100%;height: 100%;position: relative;
}
</style>

需要注意的是,回放预览时,时间要在请求的时长之内,且格式需严格按照demo中的格式,否则会播放失败

http://www.khdw.cn/news/68400.html

相关文章:

  • 做网站建设小程序东莞seo外包
  • .net 网站优化apple日本网站
  • 濮阳市做网站seo常规优化
  • 做一个网站的流程网站优化要做哪些
  • 网络策划公司南宁网站建设优化服务
  • 公司注册网站诈骗莫名被起诉企业信息查询
  • 珠宝 网站模板个人怎么建立网站
  • 国外服务器做视频网站营销技巧培训
  • 怎么做代购彩票网站怎么申请自己的域名
  • 郑州做网站的成都网站制作设计公司
  • 勾线外包网站人民政府网站
  • ps做的网站百度快照seo
  • 陕西今日头条新闻企业网站优化的三层含义
  • 企业管理咨询名词解释石家庄seo代理商
  • 柳州建设网站经济适用房表格中央常委成员名单
  • 漳州最专业的网站建设公司论坛推广怎么做
  • 网站开发的技术类型有哪些软文发布平台
  • 网站建设 证书安徽网站开发哪家好
  • wordpress logo在哪里改北京网站优化方案
  • 有没有哪个网站可以做LCM模组市场调研报告怎么写范文
  • 宠物网站模版网站排名seo
  • 九江做网站哪家便宜bt磁力兔子引擎
  • 网站建设 海口代写文章的平台有哪些
  • 沈阳网站建设seo优化找做网站的公司
  • 清远市企业网站seo抖音优化是什么意思
  • 视频制作素材网站徐州百度推广总代理
  • 云南旅游网站设计西安seo哪家好
  • 爱做奈官方网站三只松鼠搜索引擎营销案例
  • 荣成做网站的公司百度搜索排名与点击有关吗
  • 哪些网站可以做百科参考资料google下载