Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MRBR_video
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
MRBR_video
Commits
fccce5a8
Commit
fccce5a8
authored
Nov 14, 2022
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加视频背景
parent
23ac0969
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
355 additions
and
123 deletions
+355
-123
MRBR_video.fire
assets/MRBR_video/scene/MRBR_video.fire
+304
-121
MRBR_video.js
assets/MRBR_video/scene/MRBR_video.js
+15
-2
bg_video.jpg
assets/MRBR_video/texture/bg_video.jpg
+0
-0
bg_video.jpg.meta
assets/MRBR_video/texture/bg_video.jpg.meta
+36
-0
No files found.
assets/MRBR_video/scene/MRBR_video.fire
View file @
fccce5a8
This diff is collapsed.
Click to expand it.
assets/MRBR_video/scene/MRBR_video.js
View file @
fccce5a8
...
@@ -781,6 +781,13 @@ cc.Class({
...
@@ -781,6 +781,13 @@ cc.Class({
// this.checkStart();
// this.checkStart();
},
},
// 设置视频背景
initVideoBg
(
width
,
height
)
{
const
maskNode
=
cc
.
find
(
'
Canvas/video_bg
'
).
getComponent
(
cc
.
Mask
);
maskNode
.
width
=
width
;
maskNode
.
height
=
height
;
},
getVideoUrl
(
callback
)
{
getVideoUrl
(
callback
)
{
const
url1
=
this
.
data
.
video_url
;
const
url1
=
this
.
data
.
video_url
;
const
url2
=
url1
.
replace
(
/.mp4$/g
,
"
_m.mp4
"
);
const
url2
=
url1
.
replace
(
/.mp4$/g
,
"
_m.mp4
"
);
...
@@ -1047,8 +1054,14 @@ cc.Class({
...
@@ -1047,8 +1054,14 @@ cc.Class({
console
.
log
(
"
in initVideoRemote url:
"
,
url
);
console
.
log
(
"
in initVideoRemote url:
"
,
url
);
const
videoSizeW
=
1920
;
const
videoConfigSize
=
this
.
data
.
videoType
.
solit
(
'
_
'
);
const
videoSizeH
=
1080
;
let
videoSizeW
=
1920
;
let
videoSizeH
=
1080
;
if
(
videoConfigSize
.
length
==
2
&&
!
isNaN
(
Number
(
videoConfigSize
[
0
]))
&&
!
isNaN
(
Number
(
videoConfigSize
[
1
])))
{
videoSizeW
=
Number
(
videoConfigSize
[
0
]);
videoSizeH
=
Number
(
videoConfigSize
[
1
]);
}
this
.
initVideoBg
(
videoSizeW
,
videoSizeH
);
const
videoRemoteNode
=
new
cc
.
Node
();
const
videoRemoteNode
=
new
cc
.
Node
();
videoRemoteNode
.
width
=
videoSizeW
;
videoRemoteNode
.
width
=
videoSizeW
;
...
...
assets/MRBR_video/texture/bg_video.jpg
0 → 100644
View file @
fccce5a8
81.4 KB
assets/MRBR_video/texture/bg_video.jpg.meta
0 → 100644
View file @
fccce5a8
{
"ver": "2.3.5",
"uuid": "881bc070-a78c-4362-9165-750f7ebd04a7",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 2000,
"height": 2000,
"platformSettings": {},
"subMetas": {
"bg_video": {
"ver": "1.0.4",
"uuid": "5509c4ec-1745-4fdd-9a1d-af63bae692a8",
"rawTextureUuid": "881bc070-a78c-4362-9165-750f7ebd04a7",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 2000,
"height": 2000,
"rawWidth": 2000,
"rawHeight": 2000,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ 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