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
17d22488
Commit
17d22488
authored
Oct 26, 2023
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复暂停播放失效的问题
parent
683ddab7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
22 deletions
+33
-22
sn03_playVideo.fire
assets/sn03_playVideo/Scene/sn03_playVideo.fire
+2
-2
sn03_playVideo.ts
assets/sn03_playVideo/Scene/sn03_playVideo.ts
+31
-20
No files found.
assets/sn03_playVideo/Scene/sn03_playVideo.fire
View file @
17d22488
...
...
@@ -831,8 +831,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
3.566
0000000000505
,
-1
73.50300000000007
,
3.566,
-1
82.545
,
0,
0,
0,
...
...
assets/sn03_playVideo/Scene/sn03_playVideo.ts
View file @
17d22488
...
...
@@ -530,10 +530,16 @@ export default class VideoPlayerComponent extends cc.Component {
this
.
videoPlayer
.
node
.
x
=
videoContainer
.
x
;
this
.
videoPlayer
.
node
.
y
=
videoContainer
.
y
;
this
.
videoPlayer
.
play
();
this
.
playButton
.
node
.
active
=
false
;
this
.
pauseButton
.
node
.
active
=
true
;
}
pause
()
{
this
.
videoPlayer
.
pause
();
this
.
playButton
.
node
.
active
=
true
;
this
.
pauseButton
.
node
.
active
=
false
;
}
forward
()
{
...
...
@@ -582,7 +588,9 @@ export default class VideoPlayerComponent extends cc.Component {
videoContainer
.
height
=
this
.
node
.
height
;
videoContainer
.
x
=
0
;
videoContainer
.
y
=
0
;
console
.
log
(
this
.
tempPos
.
videoPos
)
const
maskCom
=
videoContainer
.
getComponent
(
cc
.
Mask
);
maskCom
.
enabled
=
false
;
cc
.
find
(
`Canvas/videolist`
).
active
=
false
;
const
controls
=
cc
.
find
(
`Canvas/Controls`
);
...
...
@@ -635,6 +643,9 @@ export default class VideoPlayerComponent extends cc.Component {
this
.
videoPlayer
.
node
.
x
=
videoContainer
.
x
;
this
.
videoPlayer
.
node
.
y
=
videoContainer
.
y
;
const
maskCom
=
videoContainer
.
getComponent
(
cc
.
Mask
);
maskCom
.
enabled
=
true
;
cc
.
find
(
`Canvas/videolist`
).
active
=
this
.
data
.
dataArr
.
length
>
1
;
const
controls
=
cc
.
find
(
`Canvas/Controls`
);
...
...
@@ -674,25 +685,25 @@ export default class VideoPlayerComponent extends cc.Component {
if
(
ct
)
{
this
.
updateBarByTime
(
ct
);
}
//
if (this.videoPlayer.isPlaying()) {
//
if (this.playButton.node.active) {
//
this.playButton.node.active = false;
//
this.restartButton.node.active = false;
//
}
//
if (!this.pauseButton.node.active) {
//
this.pauseButton.node.active = true;
//
}
//
} else {
//
if (!this.playButton.node.active) {
//
this.playButton.node.active = true;
//
}
//
if (this.pauseButton.node.active) {
//
this.pauseButton.node.active = false;
//
}
//
if (this.restartButton.node.active) {
//
this.playButton.node.active = false;
//
}
//
}
if
(
this
.
videoPlayer
.
isPlaying
())
{
if
(
this
.
playButton
.
node
.
active
)
{
this
.
playButton
.
node
.
active
=
false
;
this
.
restartButton
.
node
.
active
=
false
;
}
if
(
!
this
.
pauseButton
.
node
.
active
)
{
this
.
pauseButton
.
node
.
active
=
true
;
}
}
else
{
if
(
!
this
.
playButton
.
node
.
active
)
{
this
.
playButton
.
node
.
active
=
true
;
}
if
(
this
.
pauseButton
.
node
.
active
)
{
this
.
pauseButton
.
node
.
active
=
false
;
}
if
(
this
.
restartButton
.
node
.
active
)
{
this
.
playButton
.
node
.
active
=
false
;
}
}
}
}
}
\ No newline at end of file
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