Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wisdom-components
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
wisdom-components
Commits
a05fd9f5
Commit
a05fd9f5
authored
Jul 25, 2024
by
李纪文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 视频增加海康ISC-RTSP更新直播流
parent
7f4e3168
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
69 additions
and
11 deletions
+69
-11
App.jsx
packages/base-components/VmsVideo/src/App.jsx
+34
-10
index.js
packages/base-components/VmsVideo/src/apis/index.js
+10
-0
dmeo1.tsx
packages/base-components/VmsVideo/src/demos/dmeo1.tsx
+25
-1
No files found.
packages/base-components/VmsVideo/src/App.jsx
View file @
a05fd9f5
import
React
from
'react'
;
import
ReactDOM
from
'react-dom'
;
import
{
updateStream
}
from
'./apis'
;
import
CloudPlate
from
'./components/CloudPlate'
;
import
style
from
'./App.less'
;
...
...
@@ -36,11 +37,15 @@ class App extends React.Component {
}
}
componentDidMount
()
{
this
.
createAll
();
this
.
jessibuca
.
on
(
'pause'
,
function
(
data
)
{
// console.log('pause:', data);
});
const
{
VideoInfo
}
=
this
.
props
;
switch
(
VideoInfo
?.
protocol
)
{
case
'海康ISC-RTSP'
:
this
.
updateISCStream
();
break
;
default
:
this
.
createAll
();
break
;
}
}
componentWillUnmount
()
{
this
.
destroy
();
...
...
@@ -223,11 +228,30 @@ class App extends React.Component {
}
toQueryString
(
obj
)
{
return
Object
.
keys
(
obj
)
.
map
(
key
=>
encodeURIComponent
(
key
)
+
'='
+
encodeURIComponent
(
obj
[
key
]))
.
join
(
'&'
);
}
toQueryString
(
obj
)
{
return
Object
.
keys
(
obj
)
.
map
(
key
=>
encodeURIComponent
(
key
)
+
'='
+
encodeURIComponent
(
obj
[
key
]))
.
join
(
'&'
);
}
updateISCStream
()
{
// 更新海康ISC-RTSP协议直播流
const
{
VideoInfo
}
=
this
.
props
;
const
navigatorAgent
=
/
(
iPhone|iOS|Android|Windows Phone
)
/i
.
test
(
navigator
?.
userAgent
);
const
userInfo
=
localStorage
.
getItem
(
"userInfo"
)
?
JSON
.
parse
(
localStorage
.
getItem
(
"userInfo"
))
:
{};
const
code
=
!
navigatorAgent
?
window
?.
globalConfig
?.
userInfo
?.
LocalSite
||
window
?.
globalConfig
?.
userInfo
?.
site
||
''
:
userInfo
?.
localSite
||
userInfo
?.
LocalSite
||
''
;
const
data
=
{
id
:
VideoInfo
.
id
,
siteCode
:
code
,
};
updateStream
(
data
)
.
then
((
res
)
=>
{
this
.
createAll
();
})
.
catch
((
error
)
=>
{
this
.
createAll
();
});
}
render
()
{
return
<
div
className=
{
style
.
root
}
ref=
{
this
.
domRef
}
>
{
this
.
renderCheckedArr
()
}
</
div
>;
...
...
packages/base-components/VmsVideo/src/apis/index.js
View file @
a05fd9f5
...
...
@@ -41,4 +41,13 @@ export function hiswsUrl(data) {
method
:
REQUEST_METHOD_POST
,
data
,
});
}
// 更新海康ISC-RTSP协议直播流
export
function
updateStream
(
data
)
{
return
request
({
url
:
`
${
baseURI
}${
CommonPath
}
/pandavms/camera/isc/updatestream`
,
method
:
REQUEST_METHOD_POST
,
data
,
});
}
\ No newline at end of file
packages/base-components/VmsVideo/src/demos/dmeo1.tsx
View file @
a05fd9f5
...
...
@@ -72,6 +72,30 @@ const Demo1 = (props) => {
address
:
'172.16.19.2'
,
};
VideoParam1
=
{
id
:
'1CD26291-A19B-4709-8AEB-94CFC01CABBE'
,
name
:
'回龙水厂_回龙药房及水池'
,
protocol
:
'海康ISC-RTSP'
,
username
:
'27565776'
,
password
:
'4HUFPqij3igUJ0xkQ2gm'
,
dataRate
:
'Sub'
,
// Main 主码流 Sub 子码流
pandavmsHost
:
'ws://222.179.7.166:8200/'
,
address
:
'183.64.178.118'
,
gateway
:
true
,
};
VideoParam1
=
{
id
:
'28AC17B5-EE3D-404F-B897-EE83078A5794'
,
name
:
'回龙水厂_回龙球机'
,
protocol
:
'海康ISC-RTSP'
,
username
:
'27565776'
,
password
:
'4HUFPqij3igUJ0xkQ2gm'
,
dataRate
:
'Sub'
,
// Main 主码流 Sub 子码流
pandavmsHost
:
'ws://222.179.7.166:8200/'
,
address
:
'183.64.178.118'
,
gateway
:
true
,
};
/*{
id: '11F102BC-CE03-4E32-AE60-F297934DFE3F', // 398993BB-A795-4237-BE75-B6A7EC9D675
name: '琼海电信小区', // 设备名称
...
...
@@ -147,7 +171,7 @@ const Demo1 = (props) => {
return
()
=>
{
console
.
log
(
'销毁。。。。。。。。。。。。。。。。。。。。。。。。。'
);
stopVideo
();
//
stopVideo();
};
},
[]);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment