Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
蒋秀川
/
miniProject
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit dbfcf319
authored
Nov 10, 2023
by
李乾广
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改bug
1 parent
7dcb701a
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
110 additions
and
27 deletions
h5/src/components/vionPlayer/index.vue
h5/src/main.js
h5/src/views/extension/index.vue
h5/src/views/extension/videoTime.vue
h5/vue.config.js
h5/src/components/vionPlayer/index.vue
View file @
dbfcf31
...
...
@@ -5,6 +5,7 @@
>
<div
v-if=
"previewStyles"
class=
"vion-player-preview"
:style=
"previewStyles"
></div>
</div>
</
template
>
<
script
>
...
...
@@ -95,13 +96,13 @@ export default {
text
:
this
.
watermarkText
||
''
,
},
operateBtns
:
{
play
:
tru
e
,
play
:
!
this
.
isXCXPag
e
,
audio
:
true
,
ptz
:
this
.
showPtz
,
// 云台
zoom
:
true
,
// 电子放大
performance
:
!
this
.
isXCXPage
,
// 视频流信息展示
record
:
tru
e
,
// 录制
scale
:
tru
e
,
// 显示模式:拉伸、缩放、正常
record
:
!
this
.
isXCXPag
e
,
// 录制
scale
:
!
this
.
isXCXPag
e
,
// 显示模式:拉伸、缩放、正常
},
extendOperateBtns
:
[
getRotateConfig
.
call
(
this
),
getMirrorRotate
.
call
(
this
)],
});
...
...
@@ -304,7 +305,7 @@ export default {
}
//
电子放大
::v-deep
(
.jessibuca-zoom-controls
)
{
display
:
none
!important
;
//
display
:
none
!important
;
}
//
云台控制
&[
data-player-type
=
"playback"
]
{
...
...
h5/src/main.js
View file @
dbfcf31
import
Vue
from
'vue'
import
App
from
'./App.vue'
import
router
from
'./router'
import
axios
from
'axios'
;
import
ElementUI
from
'element-ui'
;
import
Vant
from
'vant'
;
import
'vant/lib/index.css'
;
Vue
.
use
(
Vant
);
import
'element-ui/lib/theme-chalk/index.css'
Vue
.
config
.
productionTip
=
false
Vue
.
prototype
.
$axios
=
axios
;
Vue
.
use
(
ElementUI
)
new
Vue
({
router
,
...
...
h5/src/views/extension/index.vue
View file @
dbfcf31
...
...
@@ -5,7 +5,7 @@
</div>
<!-- 时间线组件 -->
<div
class=
"extension-time-box"
>
<videoTime
ref=
"videoTime"
@
videoTimeChange=
"videoTimeChange"
@
ptzControlClick=
"ptzControlClick"
:dateFormatType=
"dateFormatType"
:magnification=
"magnification"
:ptzEnable=
"params.ptzEnable"
:gateUnid=
"params.gateUnid"
:appKey=
"params.appKey"
/>
<videoTime
ref=
"videoTime"
@
videoTimeChange=
"videoTimeChange"
@
ptzControlClick=
"ptzControlClick"
:dateFormatType=
"dateFormatType"
:magnification=
"magnification"
:ptzEnable=
"params.ptzEnable"
:gateUnid=
"params.gateUnid"
:appKey=
"params.appKey"
@
screenshot=
"screenshot"
/>
</div>
</div>
...
...
@@ -45,6 +45,8 @@ export default {
ptzEnable
:
''
,
gateName
:
''
,
terminalType
:
''
,
userKey
:
''
,
restaurantId
:
''
,
},
panTiltList
:{
up
:
0
,
...
...
@@ -164,23 +166,23 @@ export default {
},
// 获取视频播放地址
getVideoAddress
(
startTime
,
stopTime
)
{
let
par
=
{
gateUnid
:
this
.
params
.
gateUnid
,
// appKey: this.params.appKey,
// playbackSpeed: 1,
startTime
:
startTime
?
startTime
:
null
,
stopTime
:
stopTime
?
stopTime
:
null
,
}
//
let par = {
//
gateUnid: this.params.gateUnid,
//
// appKey: this.params.appKey,
//
// playbackSpeed: 1,
//
startTime:startTime?startTime:null,
//
stopTime:stopTime?stopTime:null,
//
}
// 加密
// let parStr = this.aesEncrypt(par)
tourApi
.
getLiveAndPlaybackAddress
(
par
).
then
(
res
=>
{
if
(
res
.
data
&&
res
.
data
.
code
==
200
)
{
this
.
$refs
.
vionPlayer
.
play
(
res
.
data
.
msg
);
}
else
{
Toast
.
fail
(
'取流失败'
);
}
})
/*
let par = {
//
tourApi.getLiveAndPlaybackAddress(par).then(res => {
//
if (res.data&&res.data.code == 200) {
//
this.$refs.vionPlayer.play(res.data.msg);
//
} else {
//
Toast.fail('取流失败');
//
}
//
})
let
par
=
{
gateUnid
:
this
.
params
.
gateUnid
,
appKey
:
this
.
params
.
appKey
,
playbackSpeed
:
1
,
...
...
@@ -195,7 +197,7 @@ export default {
}
else
{
Toast
.
fail
(
'取流失败'
);
}
})
*/
})
},
//加密
aesEncrypt
(
obj
){
...
...
@@ -206,12 +208,52 @@ export default {
// 截图方法
screenshot
()
{
this
.
$refs
.
vionPlayer
.
screenshot
().
then
(
data
=>
{
console
.
log
(
data
)
wx
.
miniProgram
.
postMessage
({
data
:{
src
:
data
}
})
// console.log(data)
this
.
screenshotEnd
(
data
)
// wx.miniProgram.postMessage({ data:{src:data} })
// Toast.success('截图成功');
}).
catch
(
err
=>
{
})
},
// 截图出口
screenshotEnd
(
imgData
){
console
.
log
(
imgData
)
// let reg = new RegExp('data:image/jpeg;base64,');
// let regPng = new RegExp('data:image/png;base64,');
// let pic = imgData.replace(reg, '')
// pic = pic.replace(regPng, '')
let
par
=
{
restaurantName
:
this
.
params
.
gateName
,
fileData
:
imgData
,
}
// console.log(par)
this
.
$axios
({
method
:
'post'
,
url
:
process
.
env
.
NODE_ENV
===
'production'
?
`/api/v1/upload_images`
:
`/qxh/api/v1/upload_images`
,
data
:
par
,
headers
:{
accessKeyid
:
'ca8e162ca2c9263a8f32882feea9d506'
,
sign
:
'99d20df345a9d58521279f85a55833ab'
},
}).
then
((
res
)
=>
{
// console.log(res)
if
(
res
.
data
.
code
===
0
)
{
// 跳转页面
// console.log(`http://dining-sit.huian365.com/camera/CameraReport?userKey=${this.params.userKey}&restaurantId=${this.params.restaurantId}&imgUrl=${encodeURIComponent(res.data.data)}`)
window
.
open
(
`http://dining-sit.huian365.com/camera/CameraReport?userKey=
${
this
.
params
.
userKey
}
&restaurantId=
${
this
.
params
.
restaurantId
}
&imgUrl=
${
encodeURIComponent
(
res
.
data
.
data
)}
`
)
}
else
{
this
.
$message
({
message
:
'截图失败'
,
type
:
"warning"
,
});
}
}).
catch
((
error
)
=>
{
console
.
log
(
error
);
this
.
$message
({
message
:
'截图失败'
,
type
:
"warning"
,
});
});
},
// 关闭视频播放
stopPlay
()
{
...
...
@@ -237,4 +279,5 @@ export default {
height
:
16px
;
z-index
:
1000
;
}
</
style
>
h5/src/views/extension/videoTime.vue
View file @
dbfcf31
...
...
@@ -31,8 +31,11 @@
</div>
<!-- 操作按钮 -->
<div
class=
"operating-box"
>
<van-button
v-if=
"isNoBack&&ptzEnable==='1'"
type=
"info"
size=
"mini"
@
click=
"ptzControlChange"
>
{{
ptzControlShow
?
'隐藏云台'
:
'打开云台'
}}
</van-button>
<van-button
v-else-if=
"!isNoBack"
type=
"info"
size=
"mini"
@
click=
"backRealTime"
>
返回实时
</van-button>
<i
class=
"operating-jessibuca-icon jessibuca-icon-screenshot"
@
click=
"screenshotClick"
></i>
<i
v-if=
"isNoBack&&ptzEnable==='1'&&ptzControlShow"
class=
"operating-jessibuca-icon jessibuca-icon-ptzActive"
@
click=
"ptzControlChange"
></i>
<i
v-if=
"isNoBack&&ptzEnable==='1'&&!ptzControlShow"
class=
"operating-jessibuca-icon jessibuca-icon-ptz"
@
click=
"ptzControlChange"
></i>
<!--
<van-button
v-if=
"isNoBack&&ptzEnable==='1'"
type=
"info"
size=
"mini"
@
click=
"ptzControlChange"
>
{{
ptzControlShow
?
'隐藏云台'
:
'打开云台'
}}
</van-button>
-->
<van-button
v-if=
"!isNoBack"
type=
"info"
size=
"mini"
@
click=
"backRealTime"
>
实时
</van-button>
<!--
<div
v-if=
"isNoBack"
class=
"operating-btn"
@
click=
"ptzControlChange"
>
{{
ptzControlShow
?
'隐藏云台'
:
'打开云台'
}}
</div>
-->
<!--
<div
v-else
class=
"operating-btn"
@
click=
"backRealTime"
>
返回实时
</div>
-->
</div>
...
...
@@ -321,7 +324,10 @@ export default {
this
.
ptzControlShow
=
false
this
.
$forceUpdate
()
},
// 截图开启
screenshotClick
()
{
this
.
$emit
(
'screenshot'
)
},
// 云台控制显示
ptzControlChange
()
{
this
.
ptzControlShow
=
!
this
.
ptzControlShow
...
...
@@ -588,6 +594,9 @@ export default {
color
:
#ffffff
;
font-size
:
14px
;
text-align
:
right
;
display
:
inline-flex
;
justify-content
:
right
;
align-items
:
center
;
.operating-btn{
color
:
#ffffff
;
font-size
:
14px
;
...
...
@@ -730,4 +739,25 @@ export default {
/
deep
/
.van-calendar__popup
{
height
:
64%
!important
;
}
.operating-jessibuca-icon
{
cursor
:
pointer
;
width
:
16px
;
height
:
16px
;
display
:
inline-block
;
margin-right
:
10px
;
}
.jessibuca-icon-ptz
{
background
:
url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAAM1BMVEVHcEzMzMzMzMzMzMzMzMzMzMzNzc3MzMzNzc3MzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMxDm1AzAAAAEXRSTlMAHqw+E8It/gjxc03jhGDTlgAjE2kAAAI6SURBVEjHpVbZkoQgDBwg3Of/f+12gtfMbK1Yy4NampCju4Ov1y8ruNyyo9fyCibVlNW6vUu29GpWQwTVdPTernqwffHex0WP4Nro3k+PrMKCvew/PcZ95aoNsY9yua+cGxTZsnf2K7ch4CAdGnWwYx/5LgKZCgxGdrhH3BeqNmnwviFXPZbQJmcM25HJ5n7/Pczr2QqksMJfO7BJOHLKLWFdMiL1QXYRwFagMklb4GB1zS7s8Le3fqH7Q28tVLkKdIzeaOJB2OKtY8KfTQCUa4++dNsLbrqpTR7xguHGt8hfg8P+seuaEkNdBjahzOD7g1cHP21SL2LtMNBKMdTRJjffTX1wVgrsEb1ITJU6QknwYJAcQky2cE02NbzPp70KyKggtpu9xM7Ik+CBIqY+8FrYyRUkrs+MEm1TG6tG9LZxNDNFGDue63TYGgIHqUUcuNhvhyZtn5LnlDq3Juxa4noCuX0scErOpNMDCrVcHPCS5rFGuQR9KZpxnB6CQ0ZO+AIBcTPk3UdbTx1L7jLEEHsMW7ZYm8NlIFyxn8+xdL7MURYEhzd5k2N2TabxIAORwC2r00QQfNSgrnqTJfh7cDmDu9ggtV0EZFr7kGu4KAxtNDln406TLwF9iZCIwn9EfjPuncRHYm5x3NfK3cFAS5kWxljSnTFlPHBAUFg5HsCCVOd9cdwXq+027un2QJlMjqISJutCDceRtTTuT4+1Q3HWHR8cu0fh9sGvADTYH9iLah/9nPz5+/MDJnQfoIVoAnQAAAAASUVORK5CYII=)
no-repeat
50%
;
background-size
:
100%
100%
;
margin-left
:
4px
;
}
.jessibuca-icon-ptzActive
{
background
:
url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAANlBMVEVHcEwgmv8imPwimPwhmP8imP8imPwimPwmmf8imPwimPwhmP0imPwimPwimPwimPsimP0imPoLqfILAAAAEnRSTlMADprCJBnU/gXwh3LiUKxAXjJ/ELXKAAACbklEQVRIx5VW2bbjIAwLa1jM9v8/O7Iht+09MwPlpS2VwLZkJ9f1lxVG1joPdZ0u1ZIxurhv8DH6dMpQI5t439GAEc7xYPgTRnAtV7plReRhd5kDP8+fd+wzt70yPhIJzWT7/6DCJCAYLReZPMIuJC4pClSktHqbNpJO1aTmmAme3cvtWs9NSfq52CPhnJNjlbVHwgmWSWGHeQHcKFjj7fygwidf2fa4mbVOuladcnsoDn9/CKKAWf6HEtpANiJvUp9Fgr0SvocPP/sqjOCK9ktpyCAo4Kt/d4n4/6baseNKAt5XrauPN1A4ZLAd30RUI4kNfELVx+yd3lrXYIg1Bp/B/dGs5N8mPsJoVyiwkofQSlm+K9aiwmoQMDoI4wefoK/rhkESrSuV+BR2i6HZH9juLzxCtBmn6rFmB66gNJQwBOSxncT/N3FAlxAoLQfJDy2+6rMLI3aznl9fhOcGSdZzoNhex2K3TXJEVe3M4Zb6QhHuJc5BWakYIqqietcPw6FK+EHofUHRqtLEQ5X8dKVENXXgEpLOpcjwkFI30YFVHE8fyx2ShZJ/ydTKlZwZ4BCOv/af9uMi0DILe4kieynScgPbhai+DRDckTT6N6zJpI3HMghM3BMg+q9pHmwrbR0Q0D5wc0JHPy0E5Ur7Nf3Rk68LnR0NHfO28/T5P4cNr+uLFR7eEdiNxvMRbd5Onlqsis4iIVdme4di3akWOz+3T0aUnFWHa8QZrO51NO69MeLPafrNuBenxel/3d21j8k/jyxf+75OQabFxOtuT94G3Lpjzb0zBn2Dl0ep/waPidQ/p/XB60Dp7e8F/QO7WSJg4zEzdwAAAABJRU5ErkJggg==)
no-repeat
50%
;
background-size
:
100%
100%
;
margin-left
:
4px
;
}
.jessibuca-icon-screenshot
{
background
:
url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAJFBMVEVHcEzMzMzMzMzMzMzMzMzNzc3MzMzMzMzNzc3Nzc3MzMzMzMwv5ahDAAAAC3RSTlMAW+8S2UGVwyyZnOTRhEMAAAEfSURBVDjLzZKxbsJADIYdBQpsSCyVMlXAdEuQYGKpWFk6dWHJgsQ7sMDSpUv3PgITAQT0f7ly57ucQ45KXRAZot+/89k+X4ju9KzL4XOhlm3pR0enYrWViSRPXQIQSASkRSkIJEFRimYCuQAHSW89IOv6SH5TCsuAj68Ab1wDzqkAzqoC7AUAPtgsABgkBBgkCJiNHehGok//KRVsHqd+3Dj1/vukt3AH/Jj05s5/AmyZhFVWXDls44iVvfQWkCvgxU6g9ZdJfCLvjJbYaT3GvjOY4mQSG3SJGjhr/Y1Xohp+TGKqqzexZ/1GVGdNCitt6R8zVvb9d+JmKdl8o5sPWbtxT6zFuJcDQtk92MNmYiXHquYlZlVt1j4P6cd7fgHFW7Nhqu29TwAAAABJRU5ErkJggg==)
no-repeat
50%
;
background-size
:
100%
100%
;
}
</
style
>
h5/vue.config.js
View file @
dbfcf31
...
...
@@ -10,7 +10,14 @@ module.exports = defineConfig({
'/nvsthird/ptzcontrol'
:
{
target
:
'http://52.130.155.147:8888'
,
changeOrigin
:
true
},
'/qxh'
:
{
target
:
'https://openapi.huian365.com'
,
changeOrigin
:
true
,
pathRewrite
:
{
'^/qxh'
:
'/'
}
},
}
}
})
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment