Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sn03_playVideo
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
template admin
sn03_playVideo
Commits
e5ad276e
Commit
e5ad276e
authored
Oct 30, 2023
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
使用widget进行全屏
parent
6505c14a
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
304 additions
and
268 deletions
+304
-268
sn03_playVideo.fire
assets/sn03_playVideo/Scene/sn03_playVideo.fire
+292
-262
sn03_playVideo.ts
assets/sn03_playVideo/Scene/sn03_playVideo.ts
+12
-6
No files found.
assets/sn03_playVideo/Scene/sn03_playVideo.fire
View file @
e5ad276e
This diff is collapsed.
Click to expand it.
assets/sn03_playVideo/Scene/sn03_playVideo.ts
View file @
e5ad276e
...
@@ -602,8 +602,8 @@ export default class VideoPlayerComponent extends cc.Component {
...
@@ -602,8 +602,8 @@ export default class VideoPlayerComponent extends cc.Component {
this
.
tempPos
.
videoPos
=
{
x
:
videoContainer
.
x
,
y
:
videoContainer
.
y
,
width
:
videoContainer
.
width
,
height
:
videoContainer
.
height
,
scale
:
this
.
videoPlayer
.
node
.
scale
};
this
.
tempPos
.
videoPos
=
{
x
:
videoContainer
.
x
,
y
:
videoContainer
.
y
,
width
:
videoContainer
.
width
,
height
:
videoContainer
.
height
,
scale
:
this
.
videoPlayer
.
node
.
scale
};
// this.tempPos.videoPos.width *= videoContainer.scale;
// this.tempPos.videoPos.width *= videoContainer.scale;
// this.tempPos.videoPos.height *= videoContainer.scale;
// this.tempPos.videoPos.height *= videoContainer.scale;
videoContainer
.
width
=
this
.
node
.
width
;
//
videoContainer.width = this.node.width;
videoContainer
.
height
=
this
.
node
.
height
;
//
videoContainer.height = this.node.height;
videoContainer
.
x
=
0
;
videoContainer
.
x
=
0
;
videoContainer
.
y
=
0
;
videoContainer
.
y
=
0
;
...
@@ -624,13 +624,13 @@ export default class VideoPlayerComponent extends cc.Component {
...
@@ -624,13 +624,13 @@ export default class VideoPlayerComponent extends cc.Component {
controlBg
.
opacity
=
240
;
controlBg
.
opacity
=
240
;
controlBg
.
width
=
this
.
node
.
width
;
controlBg
.
width
=
this
.
node
.
width
;
const
sx
=
this
.
node
.
width
/
this
.
videoPlayer
.
node
.
width
;
const
sy
=
this
.
node
.
height
/
this
.
videoPlayer
.
node
.
height
;
const
scale
=
Math
.
min
(
sx
,
sy
)
this
.
videoPlayer
.
node
.
scale
=
scale
this
.
videoPlayer
.
node
.
x
=
0
;
this
.
videoPlayer
.
node
.
x
=
0
;
this
.
videoPlayer
.
node
.
y
=
0
;
this
.
videoPlayer
.
node
.
y
=
0
;
const
videoNode
=
cc
.
find
(
"
Canvas/VideoNode
"
);
const
widget
=
videoNode
.
getComponent
(
cc
.
Widget
)
widget
.
enabled
=
true
;
this
.
time1
=
setTimeout
(()
=>
{
this
.
time1
=
setTimeout
(()
=>
{
this
.
videoPlayer
.
stayOnBottom
=
false
;
this
.
videoPlayer
.
stayOnBottom
=
false
;
cc
.
find
(
`Canvas/Controls`
).
active
=
false
;
cc
.
find
(
`Canvas/Controls`
).
active
=
false
;
...
@@ -649,6 +649,12 @@ export default class VideoPlayerComponent extends cc.Component {
...
@@ -649,6 +649,12 @@ export default class VideoPlayerComponent extends cc.Component {
cc
.
find
(
`Canvas/title`
).
active
=
!
this
.
isVideoFull
;
cc
.
find
(
`Canvas/title`
).
active
=
!
this
.
isVideoFull
;
cc
.
find
(
'
Canvas/pageButton
'
).
active
=
true
;
cc
.
find
(
'
Canvas/pageButton
'
).
active
=
true
;
const
videoNode
=
cc
.
find
(
"
Canvas/VideoNode
"
);
const
widget
=
videoNode
.
getComponent
(
cc
.
Widget
)
widget
.
enabled
=
false
;
videoNode
.
width
=
967
;
videoNode
.
height
=
544
;
const
videoContainer
=
cc
.
find
(
'
Canvas/video_node
'
);
const
videoContainer
=
cc
.
find
(
'
Canvas/video_node
'
);
videoContainer
.
width
=
this
.
tempPos
.
videoPos
.
width
;
videoContainer
.
width
=
this
.
tempPos
.
videoPos
.
width
;
videoContainer
.
height
=
this
.
tempPos
.
videoPos
.
height
;
videoContainer
.
height
=
this
.
tempPos
.
videoPos
.
height
;
...
...
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