Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dg29_museum
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
dg29_museum
Commits
fafe14e5
Commit
fafe14e5
authored
Dec 31, 2023
by
Tt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改视频加载方式
parent
8903d1c1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
123 additions
and
12 deletions
+123
-12
dg29_museum.meta
assets/dg29_museum.meta
+15
-1
dg29_museum.fire
assets/dg29_museum/scene/dg29_museum.fire
+98
-3
dg29_museum.ts
assets/dg29_museum/scene/dg29_museum.ts
+10
-8
No files found.
assets/dg29_museum.meta
View file @
fafe14e5
{"ver":"1.1.2","uuid":"d2c00954-06de-4c50-ba53-cd2e7ec614fc","isBundle":true,"bundleName":"","priority":1,"compressionType":{},"optimizeHotUpdate":{},"inlineSpriteFrames":{},"isRemoteBundle":{"ios":true,"android":true},"subMetas":{}}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "d2c00954-06de-4c50-ba53-cd2e7ec614fc",
"isBundle": true,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {
"ios": true,
"android": true
},
"subMetas": {}
}
\ No newline at end of file
assets/dg29_museum/scene/dg29_museum.fire
View file @
fafe14e5
...
...
@@ -97,18 +97,21 @@
},
{
"__id__": 96
},
{
"__id__": 116
}
],
"_active": true,
"_components": [
{
"__id__": 11
6
"__id__": 11
8
},
{
"__id__": 11
7
"__id__": 11
9
},
{
"__id__": 1
18
"__id__": 1
20
}
],
"_prefab": null,
...
...
@@ -5344,6 +5347,95 @@
"preload": false,
"_id": "07vNH/g39C7LNy2dhk07d+"
},
{
"__type__": "cc.Node",
"_name": "touch_layer",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 117
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1920,
"height": 1080
},
"_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": "2dSVw+wY1H/o1H+4i08TP2"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 116
},
"_enabled": true,
"alignMode": 2,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "d41xNzt1RLRpYfDzpeOkmt"
},
{
"__type__": "cc.Canvas",
"_name": "",
...
...
@@ -5438,6 +5530,9 @@
"currentTimeLabel": {
"__id__": 88
},
"touchlayer": {
"__id__": 116
},
"layout_video": {
"__id__": 76
},
...
...
assets/dg29_museum/scene/dg29_museum.ts
View file @
fafe14e5
...
...
@@ -305,6 +305,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
@
property
(
cc
.
Label
)
currentTimeLabel
:
cc
.
Label
=
null
;
@
property
(
cc
.
Node
)
touchlayer
:
cc
.
Node
=
null
;
@
property
(
cc
.
Node
)
layout_video
:
cc
.
Node
=
null
;
@
property
(
cc
.
Node
)
videoControls
:
cc
.
Node
=
null
;
@
property
(
cc
.
Node
)
pauseButton
:
cc
.
Node
=
null
;
...
...
@@ -353,16 +354,16 @@ export default class SceneComponent extends MyCocosSceneComponent {
if
(
!
this
.
_isReadyToPlay
)
{
//首次播放
this
.
_isReadyToPlay
=
false
;
this
.
videoPlayer
.
remoteURL
=
this
.
data
.
video
;
//
this.videoPlayer.remoteURL = this.data.video;
pg
.
view
.
touchOn
(
this
.
playButton
,
this
.
play
,
this
);
pg
.
view
.
touchOn
(
this
.
pauseButton
,
this
.
pause
,
this
);
}
else
{
//重复播放
this
.
videoPlayer
.
currentTime
=
0
;
this
.
_isPlayComplated
=
false
;
this
.
play
();
}
//重复播放
this
.
videoPlayer
.
currentTime
=
0
;
this
.
_isPlayComplated
=
false
;
this
.
play
();
this
.
scheduleOnce
(()
=>
{
if
(
!
this
.
node
)
return
;
if
(
!
this
.
videoPlayer
)
return
;
...
...
@@ -390,12 +391,12 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
layout_video
.
active
=
false
;
this
.
showUI
();
}
@
property
(
cc
.
Node
)
touchlayer
:
cc
.
Node
=
null
;
initVideoUrl
()
{
this
.
prepared
=
true
;
this
.
touchlayer
.
on
(
cc
.
Node
.
EventType
.
TOUCH_START
,
this
.
tryPlayVideo
,
this
)
this
.
touchlayer
.
_touchListener
.
setSwallowTouches
(
false
)
this
.
videoPlayer
.
node
.
active
=
true
;
this
.
videoPlayer
.
remoteURL
=
this
.
data
.
video
_url
;
this
.
videoPlayer
.
remoteURL
=
this
.
data
.
video
;
this
.
videoPlayer
.
resourceType
=
cc
.
VideoPlayer
.
ResourceType
.
REMOTE
;
}
private
prepared
:
boolean
;
...
...
@@ -413,6 +414,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
initVideoPlayer
()
{
this
.
initVideoUrl
();
this
.
videoPlayer
.
node
.
x
=
-
10000
;
this
.
videoPlayer
.
node
.
y
=
-
10000
;
this
.
layout_video
.
active
=
false
;
...
...
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