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
900f700e
Commit
900f700e
authored
May 18, 2023
by
程恺文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
视频大小兼容
parent
b20f3662
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
+9
-7
dmeo1.tsx
packages/base-components/VmsVideo/src/demos/dmeo1.tsx
+3
-1
index.jsx
packages/base-components/VmsVideo/src/index.jsx
+6
-6
No files found.
packages/base-components/VmsVideo/src/demos/dmeo1.tsx
View file @
900f700e
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: 634665781 634665781@qq.com
* @Author: 634665781 634665781@qq.com
* @Date: 2023-04-11 13:40:18
* @Date: 2023-04-11 13:40:18
* @LastEditors: 634665781 634665781@qq.com
* @LastEditors: 634665781 634665781@qq.com
* @LastEditTime: 2023-0
4-17 11:05:27
* @LastEditTime: 2023-0
5-18 15:15:16
* @FilePath: \wisdom-components\packages\base-components\TestVideo\src\demos\dmeo1.tsx
* @FilePath: \wisdom-components\packages\base-components\TestVideo\src\demos\dmeo1.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
*/
...
@@ -112,7 +112,9 @@ const Demo1 = (props) => {
...
@@ -112,7 +112,9 @@ const Demo1 = (props) => {
<
button
onClick=
{
startVideo
}
>
开始
</
button
>
<
button
onClick=
{
startVideo
}
>
开始
</
button
>
<
button
onClick=
{
testVideo
}
>
测试
</
button
>
<
button
onClick=
{
testVideo
}
>
测试
</
button
>
<
button
onClick=
{
destroyVideo
}
>
销毁
</
button
>
<
button
onClick=
{
destroyVideo
}
>
销毁
</
button
>
<
div
style=
{
{
height
:
'500px'
}
}
>
<
Video
{
...
{
JessibucaObj
:
JessibucaObj
,
VideoInfo
:
VideoParam
}}
ref=
{
jessibuca
}
/>
<
Video
{
...
{
JessibucaObj
:
JessibucaObj
,
VideoInfo
:
VideoParam
}}
ref=
{
jessibuca
}
/>
</
div
>
</
div
>
</
div
>
);
);
};
};
...
...
packages/base-components/VmsVideo/src/index.jsx
View file @
900f700e
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: 634665781 634665781@qq.com
* @Author: 634665781 634665781@qq.com
* @Date: 2023-04-11 13:40:18
* @Date: 2023-04-11 13:40:18
* @LastEditors: 634665781 634665781@qq.com
* @LastEditors: 634665781 634665781@qq.com
* @LastEditTime: 2023-05-18 1
4:47:06
* @LastEditTime: 2023-05-18 1
5:11:54
* @FilePath: \wisdom-components\packages\base-components\VmsVideo\src\index.jsx
* @FilePath: \wisdom-components\packages\base-components\VmsVideo\src\index.jsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
*/
...
@@ -36,7 +36,7 @@ import style from './index.less';
...
@@ -36,7 +36,7 @@ import style from './index.less';
const
Video
=
(
props
,
ref
)
=>
{
const
Video
=
(
props
,
ref
)
=>
{
const
_video
=
useRef
(
null
);
const
_video
=
useRef
(
null
);
const
Players
=
useRef
(
null
);
const
Players
=
useRef
(
null
);
const
ref
=
useRef
(
null
);
const
ref
s
=
useRef
(
null
);
const
[
width
,
setWidth
]
=
useState
(
0
);
const
[
width
,
setWidth
]
=
useState
(
0
);
const
[
height
,
setHeight
]
=
useState
(
0
);
const
[
height
,
setHeight
]
=
useState
(
0
);
let
PlayersA
=
''
;
let
PlayersA
=
''
;
...
@@ -51,9 +51,9 @@ const Video = (props, ref) => {
...
@@ -51,9 +51,9 @@ const Video = (props, ref) => {
key
:
`摄像头`
,
key
:
`摄像头`
,
};
};
useLayoutEffect
(()
=>
{
useLayoutEffect
(()
=>
{
console
.
log
(
ref
.
current
.
offsetWidth
,
ref
.
current
.
offsetHeight
,
'宽高'
);
console
.
log
(
ref
s
.
current
.
offsetWidth
,
refs
.
current
.
offsetHeight
,
'宽高'
);
setWidth
(
ref
.
current
.
offsetWidth
);
setWidth
(
ref
s
.
current
.
offsetWidth
);
setHeight
(
ref
.
current
.
offsetHeight
);
setHeight
(
ref
s
.
current
.
offsetHeight
);
},
[]);
},
[]);
const
getToken
=
async
()
=>
{
const
getToken
=
async
()
=>
{
axios
axios
...
@@ -136,7 +136,7 @@ const Video = (props, ref) => {
...
@@ -136,7 +136,7 @@ const Video = (props, ref) => {
},
[]);
},
[]);
return
(
return
(
<
div
ref=
{
ref
}
className=
{
style
.
app
}
>
<
div
ref=
{
ref
s
}
className=
{
style
.
app
}
>
{
VideoInfo
.
protocol
==
'萤石EZOPEN'
?
(
{
VideoInfo
.
protocol
==
'萤石EZOPEN'
?
(
<
div
id=
{
keyID
}
></
div
>
<
div
id=
{
keyID
}
></
div
>
)
:
(
)
:
(
...
...
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