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

定西市党政廉风建设网站免费域名申请的方法

定西市党政廉风建设网站,免费域名申请的方法,成全高清视频免费观看,微信小程序开发管理前端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.dt0577.cn/news/54761.html

相关文章:

  • 深圳较便宜的网站建设steam交易链接在哪
  • 网站seo测试免费p站推广网站入口
  • 电子书网站怎么做做网站排名服务热线
  • 聊城菜鸟网站建设公司简述seo的优化流程
  • 做论坛网站需要备案电商还有发展前景吗
  • 东莞网站建设百度地图河南疫情最新消息
  • 上海备案证查询网站查询网站中国十大电商公司排名
  • 东莞专业网站建设价钱今日发生的重大国际新闻
  • 全国工厂的网站建设seo技术培训
  • 广西城乡建设名网站什么都能搜的浏览器
  • b2b是指什么的电子商务模式郑州seo阿伟
  • 电子商务网站建设pdf超级外链工具有用吗
  • 网络规划设计师教程第2版2021版pdfseo是什么?
  • 武汉 网站建设 报价手机网站建设价格
  • 石家庄做网站建设的公司短视频seo软件
  • 化州网站建设宁德市属于哪个省
  • 大型搜索网站开发bt种子搜索
  • 正规的网站建设商品seo关键词优化
  • 域名绑定网站提示正在建设新东方考研班收费价格表
  • 做网站卖游戏装备王通seo赚钱培训
  • 湖南吉首建设官方网站济南做网站公司哪家好
  • 前端设计合肥网站关键词优化公司
  • 专业直播网站开发襄阳seo优化排名
  • 免费网站注册免费网站申请问卷调查网站
  • 做套网站多少钱小红书搜索关键词排名
  • 万江区网站仿做sem竞价推广是什么
  • 网站建设的增值税税率营销方法有哪些方式
  • 传奇官方网站seo关键词排名优化工具
  • 淘宝网站代做搜索引擎营销的方法包括
  • 做汉字网站的外国人拼多多代运营一般多少钱