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
2e2438b3
Commit
2e2438b3
authored
Sep 19, 2024
by
李纪文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: hkH5player支持wss视频回放
parent
9e255750
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
index.js
...base-components/VmsVideo/src/recVideo/hkh5player/index.js
+9
-1
No files found.
packages/base-components/VmsVideo/src/recVideo/hkh5player/index.js
View file @
2e2438b3
...
...
@@ -226,7 +226,8 @@ const HKh5player = (props, ref) => {
// 视频开始播放
const
playbackStart
=
(
times
)
=>
{
const
index
=
0
;
const
playURL
=
`ws://
${
window
?.
location
?.
host
||
''
}
/openUrl/
$
{
videoUrl
.
current
}
`;
const
defaultUrl
=
`ws://
${
window
?.
location
?.
host
||
''
}
`;
const playURL = `
$
{
getVideoUrl
()
||
defaultUrl
}
/openUrl/
$
{
videoUrl
.
current
}
`;
const beginTime = times.beginTime.replaceAll(' ', 'T') + 'Z';
const endTime = times.endTime.replaceAll(' ', 'T') + 'Z';
setSping(true);
...
...
@@ -557,4 +558,11 @@ const HKh5player = (props, ref) => {
);
};
export const getVideoUrl = () => {
const protocol = window.location.protocol;
const port = window.location.port ? '' : ':443';
const address = protocol === "https:" ? `
$
{
window
.
location
.
origin
.
replace
(
protocol
,
'wss:'
)}
$
{
port
}
` : window.location.origin.replace(protocol, 'ws:');
return `
$
{
address
}
`;
};
export default HKh5player;
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