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
83cf299f
Commit
83cf299f
authored
Oct 24, 2023
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整翻页按钮显示隐藏
parent
e53860d5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
112 additions
and
64 deletions
+112
-64
sn03_playVideo.fire
assets/sn03_playVideo/Scene/sn03_playVideo.fire
+106
-44
sn03_playVideo.ts
assets/sn03_playVideo/Scene/sn03_playVideo.ts
+6
-20
No files found.
assets/sn03_playVideo/Scene/sn03_playVideo.fire
View file @
83cf299f
...
@@ -96,28 +96,25 @@
...
@@ -96,28 +96,25 @@
"__id__": 119
"__id__": 119
},
},
{
{
"__id__": 124
"__id__": 130
},
{
"__id__": 129
},
},
{
{
"__id__": 13
2
"__id__": 13
3
},
},
{
{
"__id__": 13
4
"__id__": 13
5
}
}
],
],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
"__id__": 136
},
{
{
"__id__": 137
"__id__": 137
},
},
{
{
"__id__": 138
"__id__": 138
},
{
"__id__": 139
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -5420,22 +5417,87 @@
...
@@ -5420,22 +5417,87 @@
},
},
{
{
"__type__": "cc.Node",
"__type__": "cc.Node",
"_name": "
btn_last
",
"_name": "
pageButton
",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 2
"__id__": 2
},
},
"_children": [
{
"__id__": 120
},
{
"__id__": 125
}
],
"_active": true,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "b5mILpcM5Ou4v8DVL0n7wo"
},
{
"__type__": "cc.Node",
"_name": "btn_last",
"_objFlags": 0,
"_parent": {
"__id__": 119
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 12
0
"__id__": 12
1
},
},
{
{
"__id__": 12
1
"__id__": 12
2
},
},
{
{
"__id__": 12
3
"__id__": 12
4
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -5462,7 +5524,7 @@
...
@@ -5462,7 +5524,7 @@
"ctor": "Float64Array",
"ctor": "Float64Array",
"array": [
"array": [
-658.5,
-658.5,
88.5
,
150
,
0,
0,
0,
0,
0,
0,
...
@@ -5491,7 +5553,7 @@
...
@@ -5491,7 +5553,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 1
19
"__id__": 1
20
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -5523,7 +5585,7 @@
...
@@ -5523,7 +5585,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 1
19
"__id__": 1
20
},
},
"_enabled": true,
"_enabled": true,
"_normalMaterial": null,
"_normalMaterial": null,
...
@@ -5532,7 +5594,7 @@
...
@@ -5532,7 +5594,7 @@
"zoomScale": 1.2,
"zoomScale": 1.2,
"clickEvents": [
"clickEvents": [
{
{
"__id__": 12
2
"__id__": 12
3
}
}
],
],
"_N$interactable": true,
"_N$interactable": true,
...
@@ -5588,7 +5650,7 @@
...
@@ -5588,7 +5650,7 @@
"hoverSprite": null,
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$disabledSprite": null,
"_N$target": {
"_N$target": {
"__id__": 1
19
"__id__": 1
20
},
},
"_id": "63sqlR0bVEJrqaAhyT+FzF"
"_id": "63sqlR0bVEJrqaAhyT+FzF"
},
},
...
@@ -5607,19 +5669,19 @@
...
@@ -5607,19 +5669,19 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 1
19
"__id__": 1
20
},
},
"_enabled": true,
"_enabled": true,
"alignMode": 1,
"alignMode": 1,
"_target": {
"_target": {
"__id__": 2
"__id__": 2
},
},
"_alignFlags":
9
,
"_alignFlags":
10
,
"_left": 250,
"_left": 250,
"_right": 0,
"_right": 0,
"_top": 400,
"_top": 400,
"_bottom":
0
,
"_bottom":
577
,
"_verticalCenter": 0,
"_verticalCenter":
15
0,
"_horizontalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsRight": true,
...
@@ -5628,7 +5690,7 @@
...
@@ -5628,7 +5690,7 @@
"_isAbsHorizontalCenter": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalWidth": 0,
"_originalHeight":
0
,
"_originalHeight":
103
,
"_id": "09WKwl6N9DlIVhmb+dle11"
"_id": "09WKwl6N9DlIVhmb+dle11"
},
},
{
{
...
@@ -5636,19 +5698,19 @@
...
@@ -5636,19 +5698,19 @@
"_name": "btn_next",
"_name": "btn_next",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__":
2
"__id__":
119
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 12
5
"__id__": 12
6
},
},
{
{
"__id__": 12
6
"__id__": 12
7
},
},
{
{
"__id__": 12
8
"__id__": 12
9
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -5675,7 +5737,7 @@
...
@@ -5675,7 +5737,7 @@
"ctor": "Float64Array",
"ctor": "Float64Array",
"array": [
"array": [
658.5,
658.5,
88.5
,
150
,
0,
0,
0,
0,
0,
0,
...
@@ -5704,7 +5766,7 @@
...
@@ -5704,7 +5766,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 12
4
"__id__": 12
5
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -5736,7 +5798,7 @@
...
@@ -5736,7 +5798,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 12
4
"__id__": 12
5
},
},
"_enabled": true,
"_enabled": true,
"_normalMaterial": null,
"_normalMaterial": null,
...
@@ -5745,7 +5807,7 @@
...
@@ -5745,7 +5807,7 @@
"zoomScale": 1.2,
"zoomScale": 1.2,
"clickEvents": [
"clickEvents": [
{
{
"__id__": 12
7
"__id__": 12
8
}
}
],
],
"_N$interactable": true,
"_N$interactable": true,
...
@@ -5801,7 +5863,7 @@
...
@@ -5801,7 +5863,7 @@
"hoverSprite": null,
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$disabledSprite": null,
"_N$target": {
"_N$target": {
"__id__": 12
4
"__id__": 12
5
},
},
"_id": "3aZJp/FzlONJO+/okrPRip"
"_id": "3aZJp/FzlONJO+/okrPRip"
},
},
...
@@ -5820,19 +5882,19 @@
...
@@ -5820,19 +5882,19 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 12
4
"__id__": 12
5
},
},
"_enabled": true,
"_enabled": true,
"alignMode": 1,
"alignMode": 1,
"_target": {
"_target": {
"__id__": 2
"__id__": 2
},
},
"_alignFlags": 3
3
,
"_alignFlags": 3
4
,
"_left": 1580.964,
"_left": 1580.964,
"_right": 250,
"_right": 250,
"_top": 400,
"_top": 400,
"_bottom": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_verticalCenter":
15
0,
"_horizontalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsRight": true,
...
@@ -5855,10 +5917,10 @@
...
@@ -5855,10 +5917,10 @@
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 13
0
"__id__": 13
1
},
},
{
{
"__id__": 13
1
"__id__": 13
2
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -5914,7 +5976,7 @@
...
@@ -5914,7 +5976,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 1
29
"__id__": 1
30
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -5947,7 +6009,7 @@
...
@@ -5947,7 +6009,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 1
29
"__id__": 1
30
},
},
"_enabled": true,
"_enabled": true,
"alignMode": 1,
"alignMode": 1,
...
@@ -5980,7 +6042,7 @@
...
@@ -5980,7 +6042,7 @@
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__": 13
3
"__id__": 13
4
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -6036,7 +6098,7 @@
...
@@ -6036,7 +6098,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 13
2
"__id__": 13
3
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -6074,7 +6136,7 @@
...
@@ -6074,7 +6136,7 @@
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__": 13
5
"__id__": 13
6
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -6130,7 +6192,7 @@
...
@@ -6130,7 +6192,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 13
4
"__id__": 13
5
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -6247,7 +6309,7 @@
...
@@ -6247,7 +6309,7 @@
"__id__": 36
"__id__": 36
},
},
"loadingSprite": {
"loadingSprite": {
"__id__": 13
4
"__id__": 13
5
},
},
"_id": "c0ovD3YW1IbKk/Fh2N2zzp"
"_id": "c0ovD3YW1IbKk/Fh2N2zzp"
}
}
...
...
assets/sn03_playVideo/Scene/sn03_playVideo.ts
View file @
83cf299f
...
@@ -134,17 +134,6 @@ export default class VideoPlayerComponent extends cc.Component {
...
@@ -134,17 +134,6 @@ export default class VideoPlayerComponent extends cc.Component {
cc
.
debug
.
setDisplayStats
(
false
);
cc
.
debug
.
setDisplayStats
(
false
);
this
.
initSize
();
this
.
initSize
();
// cc.find('Canvas/bg').scale = this._mapScaleMax;
// cc.find('Canvas/video_node/bg').scale = this._mapScaleMax;
// cc.find('Canvas/bgwhite').zIndex=-2
// cc.find('Canvas/bg').zIndex=-1
// cc.find('Canvas/VideoNode').zIndex=0
// cc.find('Canvas/video_node').zIndex=1
// cc.find('Canvas/Controls').zIndex=3
// cc.find('Canvas/videolist').zIndex=4
// cc.find('Canvas/btn_return').zIndex=5
// cc.find('Canvas/title').zIndex=5
this
.
_isReadyToPlay
=
false
;
this
.
_isReadyToPlay
=
false
;
cc
.
macro
.
ENABLE_TRANSPARENT_CANVAS
=
true
;
cc
.
macro
.
ENABLE_TRANSPARENT_CANVAS
=
true
;
...
@@ -152,7 +141,6 @@ export default class VideoPlayerComponent extends cc.Component {
...
@@ -152,7 +141,6 @@ export default class VideoPlayerComponent extends cc.Component {
this
.
videoPlayer
.
node
.
on
(
'
ready-to-play
'
,
()
=>
{
this
.
videoPlayer
.
node
.
on
(
'
ready-to-play
'
,
()
=>
{
console
.
log
(
'
ready-to-play
'
);
console
.
log
(
'
ready-to-play
'
);
this
.
playButton
.
node
.
active
=
true
;
this
.
playButton
.
node
.
active
=
true
;
// cc.find(`Canvas/loading`).active = false;
this
.
durationLabel
.
string
=
this
.
formatTime
(
this
.
videoPlayer
.
getDuration
());
this
.
durationLabel
.
string
=
this
.
formatTime
(
this
.
videoPlayer
.
getDuration
());
this
.
_isReadyToPlay
=
true
;
this
.
_isReadyToPlay
=
true
;
this
.
_isPlayComplated
=
false
;
this
.
_isPlayComplated
=
false
;
...
@@ -242,8 +230,9 @@ export default class VideoPlayerComponent extends cc.Component {
...
@@ -242,8 +230,9 @@ export default class VideoPlayerComponent extends cc.Component {
refreshLastNextBtns
(){
refreshLastNextBtns
(){
cc
.
find
(
"
Canvas/btn_last
"
).
active
=
this
.
videoPlayIndex
!=
0
cc
.
find
(
"
Canvas/btn_last
"
).
active
=
this
.
videoPlayIndex
!=
0
if
(
this
.
videoItemList
)
if
(
this
.
videoItemList
)
{
cc
.
find
(
"
Canvas/btn_next
"
).
active
=
this
.
videoPlayIndex
!=
this
.
videoItemList
.
length
-
1
cc
.
find
(
"
Canvas/btn_next
"
).
active
=
this
.
videoPlayIndex
!=
this
.
videoItemList
.
length
-
1
}
}
}
onClickNext
(){
onClickNext
(){
...
@@ -440,10 +429,6 @@ export default class VideoPlayerComponent extends cc.Component {
...
@@ -440,10 +429,6 @@ export default class VideoPlayerComponent extends cc.Component {
cc
.
find
(
`Canvas/video_node`
).
width
*=
1.2
;
cc
.
find
(
`Canvas/video_node`
).
width
*=
1.2
;
cc
.
find
(
`Canvas/video_node`
).
height
*=
1.2
;
cc
.
find
(
`Canvas/video_node`
).
height
*=
1.2
;
cc
.
find
(
`Canvas/video_node`
).
y
=
93.311
;
cc
.
find
(
`Canvas/video_node`
).
y
=
93.311
;
cc
.
find
(
`Canvas/btn_last`
).
x
=
-
734.101
;
cc
.
find
(
`Canvas/btn_last`
).
y
=
-
39.603
;
cc
.
find
(
`Canvas/btn_next`
).
x
=
734.101
;
cc
.
find
(
`Canvas/btn_next`
).
y
=
-
39.603
;
cc
.
find
(
`Canvas/VideoNode`
).
scale
=
1.439
;
cc
.
find
(
`Canvas/VideoNode`
).
scale
=
1.439
;
cc
.
find
(
`Canvas/Controls`
).
scale
=
1.2
;
cc
.
find
(
`Canvas/Controls`
).
scale
=
1.2
;
cc
.
find
(
`Canvas/Controls`
).
y
=
-
670
;
cc
.
find
(
`Canvas/Controls`
).
y
=
-
670
;
...
@@ -577,7 +562,7 @@ export default class VideoPlayerComponent extends cc.Component {
...
@@ -577,7 +562,7 @@ export default class VideoPlayerComponent extends cc.Component {
cc
.
find
(
`Canvas/Controls/exitfull`
).
active
=
this
.
isVideoFull
;
cc
.
find
(
`Canvas/Controls/exitfull`
).
active
=
this
.
isVideoFull
;
cc
.
find
(
`Canvas/btn_return`
).
active
=
!
this
.
isVideoFull
;
cc
.
find
(
`Canvas/btn_return`
).
active
=
!
this
.
isVideoFull
;
cc
.
find
(
`Canvas/title`
).
active
=
!
this
.
isVideoFull
;
cc
.
find
(
`Canvas/title`
).
active
=
!
this
.
isVideoFull
;
cc
.
find
(
'
Canvas/pageButton
'
).
active
=
false
;
const
videoContainer
=
cc
.
find
(
'
Canvas/video_node
'
);
const
videoContainer
=
cc
.
find
(
'
Canvas/video_node
'
);
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;
...
@@ -625,7 +610,8 @@ export default class VideoPlayerComponent extends cc.Component {
...
@@ -625,7 +610,8 @@ export default class VideoPlayerComponent extends cc.Component {
cc
.
find
(
`Canvas/Controls/exitfull`
).
active
=
this
.
isVideoFull
;
cc
.
find
(
`Canvas/Controls/exitfull`
).
active
=
this
.
isVideoFull
;
cc
.
find
(
`Canvas/btn_return`
).
active
=
!
this
.
isVideoFull
;
cc
.
find
(
`Canvas/btn_return`
).
active
=
!
this
.
isVideoFull
;
cc
.
find
(
`Canvas/title`
).
active
=
!
this
.
isVideoFull
;
cc
.
find
(
`Canvas/title`
).
active
=
!
this
.
isVideoFull
;
cc
.
find
(
'
Canvas/pageButton
'
).
active
=
true
;
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