Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
op_video_01
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
op_video_01
Commits
8abaa35e
Commit
8abaa35e
authored
Nov 02, 2025
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 调整视频播放器的初始位置
parent
a54a0333
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
21 deletions
+38
-21
op_video_01.meta
assets/op_video_01.meta
+15
-1
op_video_01.fire
assets/op_video_01/scene/op_video_01.fire
+3
-3
op_video_01.js
assets/op_video_01/scene/op_video_01.js
+20
-17
No files found.
assets/op_video_01.meta
View file @
8abaa35e
{"ver":"1.1.2","uuid":"25d9df1c-9ef4-4af7-9a5f-6d461ebda6f1","isBundle":false,"bundleName":"","priority":1,"compressionType":{},"optimizeHotUpdate":{},"inlineSpriteFrames":{},"isRemoteBundle":{"ios":false,"android":false},"subMetas":{}}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "25d9df1c-9ef4-4af7-9a5f-6d461ebda6f1",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {
"ios": false,
"android": false
},
"subMetas": {}
}
\ No newline at end of file
assets/op_video_01/scene/op_video_01.fire
View file @
8abaa35e
...
...
@@ -300,7 +300,7 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0
,
-9999
,
0,
0,
0,
...
...
@@ -358,8 +358,8 @@
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left":
0
,
"_right":
0
,
"_left":
-9999
,
"_right":
9999
,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
...
...
assets/op_video_01/scene/op_video_01.js
View file @
8abaa35e
...
...
@@ -545,6 +545,8 @@ cc.Class({
setTimeout
(()
=>
{
this
.
videoCanPlay
=
true
;
if
(
window
&&
window
[
"
air
"
]
&&
this
.
pageLoaded
)
{
cc
.
find
(
"
Canvas/VideoPlayer
"
).
x
=
0
;
this
.
alignVideoPlayer
();
window
[
"
air
"
].
hideAirClassLoading
();
}
},
100
);
...
...
@@ -569,13 +571,12 @@ cc.Class({
const
preloadArr
=
this
.
_imageResList
.
concat
(
this
.
_audioResList
).
concat
(
this
.
_animaResList
);
console
.
log
(
'
preloadArr:
'
,
JSON
.
stringify
(
preloadArr
));
cc
.
assetManager
.
loadAny
(
preloadArr
,
null
,
null
,
(
err
,
data
)
=>
{
this
.
videoplayer
.
remoteURL
=
this
.
data
.
video_url
;
this
.
addServerListener
();
this
.
pageLoaded
=
true
;
if
(
window
&&
window
[
"
air
"
]
&&
this
.
videoCanPlay
)
{
cc
.
find
(
"
Canvas/VideoPlayer
"
).
x
=
0
;
this
.
alignVideoPlayer
();
window
[
"
air
"
].
hideAirClassLoading
();
}
});
...
...
@@ -678,21 +679,8 @@ cc.Class({
}
},
initView
()
{
this
.
initBg
();
alignVideoPlayer
()
{
const
canvas
=
cc
.
find
(
'
Canvas
'
)
this
.
videoplayer
.
node
.
on
(
'
ready-to-play
'
,
this
.
onReadyToPlay
,
this
);
this
.
videoplayer
.
node
.
on
(
'
meta-loaded
'
,
this
.
onMetaLoaded
,
this
);
this
.
videoplayer
.
node
.
on
(
'
clicked
'
,
this
.
onClicked
,
this
);
this
.
videoplayer
.
node
.
on
(
'
playing
'
,
this
.
onPlaying
,
this
);
// this.videoplayer.node.on('paused', this.onPaused, this);
// this.videoplayer.node.on('stopped', this.onStoped, this);
this
.
videoplayer
.
node
.
on
(
'
completed
'
,
this
.
onCompleted
,
this
);
const
playerWidget
=
this
.
videoplayer
.
getComponent
(
cc
.
Widget
);
if
((
canvas
.
width
/
canvas
.
height
)
>=
1
)
{
// 横屏
...
...
@@ -706,6 +694,21 @@ cc.Class({
playerWidget
.
enabled
=
true
;
this
.
videoplayer
.
width
=
canvas
.
width
;
}
},
initView
()
{
this
.
initBg
();
this
.
videoplayer
.
node
.
on
(
'
ready-to-play
'
,
this
.
onReadyToPlay
,
this
);
this
.
videoplayer
.
node
.
on
(
'
meta-loaded
'
,
this
.
onMetaLoaded
,
this
);
this
.
videoplayer
.
node
.
on
(
'
clicked
'
,
this
.
onClicked
,
this
);
this
.
videoplayer
.
node
.
on
(
'
playing
'
,
this
.
onPlaying
,
this
);
// this.videoplayer.node.on('paused', this.onPaused, this);
// this.videoplayer.node.on('stopped', this.onStoped, this);
this
.
videoplayer
.
node
.
on
(
'
completed
'
,
this
.
onCompleted
,
this
);
this
.
alignVideoPlayer
();
// this.initPic();
// this.initBtn();
// this.initIcon();
...
...
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