Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
X
xy_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
xy_video
Commits
bfb54bdd
Commit
bfb54bdd
authored
Aug 11, 2022
by
liujiangnan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 初始化
parent
fe63b0cb
Changes
21
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
695 additions
and
1734 deletions
+695
-1734
xy_video.fire
assets/xy_video/Scene/xy_video.fire
+646
-1429
xy_video.js
assets/xy_video/Scene/xy_video.js
+47
-10
BRLNSDB.TTF
assets/xy_video/Texture/BRLNSDB.TTF
+0
-0
BRLNSDB.TTF.meta
assets/xy_video/Texture/BRLNSDB.TTF.meta
+0
-5
barbg.png
assets/xy_video/Texture/barbg.png
+0
-0
barbg.png.meta
assets/xy_video/Texture/barbg.png.meta
+0
-36
bartag.png
assets/xy_video/Texture/bartag.png
+0
-0
bartag.png.meta
assets/xy_video/Texture/bartag.png.meta
+0
-36
direction.png
assets/xy_video/Texture/direction.png
+0
-0
direction.png.meta
assets/xy_video/Texture/direction.png.meta
+0
-36
pause.png
assets/xy_video/Texture/pause.png
+0
-0
pause.png.meta
assets/xy_video/Texture/pause.png.meta
+0
-36
pbbg1.png
assets/xy_video/Texture/pbbg1.png
+0
-0
pbbg1.png.meta
assets/xy_video/Texture/pbbg1.png.meta
+0
-36
play.png
assets/xy_video/Texture/play.png
+0
-0
play.png.meta
assets/xy_video/Texture/play.png.meta
+0
-36
replay.png
assets/xy_video/Texture/replay.png
+0
-0
replay.png.meta
assets/xy_video/Texture/replay.png.meta
+0
-36
singleColor.png
assets/xy_video/Texture/singleColor.png
+0
-0
singleColor.png.meta
assets/xy_video/Texture/singleColor.png.meta
+0
-36
processbg.png.meta
assets/xy_video/Texture/video/processbg.png.meta
+2
-2
No files found.
assets/xy_video/Scene/xy_video.fire
View file @
bfb54bdd
This diff is collapsed.
Click to expand it.
assets/xy_video/Scene/xy_video.js
View file @
bfb54bdd
...
@@ -2,10 +2,10 @@ cc.Class({
...
@@ -2,10 +2,10 @@ cc.Class({
extends
:
cc
.
Component
,
extends
:
cc
.
Component
,
properties
:
{
properties
:
{
//
videoPlayer: {
videoPlayer
:
{
//
default: null,
default
:
null
,
//
type: cc.VideoPlayer
type
:
cc
.
VideoPlayer
//
},
},
ProgressBar
:
{
ProgressBar
:
{
default
:
null
,
default
:
null
,
type
:
cc
.
ProgressBar
type
:
cc
.
ProgressBar
...
@@ -41,18 +41,52 @@ cc.Class({
...
@@ -41,18 +41,52 @@ cc.Class({
barTag
:
{
barTag
:
{
default
:
null
,
default
:
null
,
type
:
cc
.
Node
type
:
cc
.
Node
},
bar
:
{
default
:
null
,
type
:
cc
.
Node
}
}
// defaults, set visually when attaching this script to the Canvas
// defaults, set visually when attaching this script to the Canvas
// text: 'Hello, World!'
// text: 'Hello, World!'
},
},
_designSize
:
null
,
// 设计分辨率
_frameSize
:
null
,
// 屏幕分辨率
_mapScaleMin
:
null
,
// 场景中常用缩放(取大值)
_mapScaleMax
:
null
,
// 场景中常用缩放(取小值)
_cocosScale
:
null
,
// cocos 自缩放 (较少用到)
initSize
()
{
// 注意cc.winSize只有在适配后(修改fitHeight/fitWidth后)才能获取到正确的值,因此使用cc.getFrameSize()来获取初始的屏幕大小
let
screen_size
=
cc
.
view
.
getFrameSize
().
width
/
cc
.
view
.
getFrameSize
().
height
let
design_size
=
cc
.
Canvas
.
instance
.
designResolution
.
width
/
cc
.
Canvas
.
instance
.
designResolution
.
height
let
f
=
screen_size
>=
design_size
cc
.
Canvas
.
instance
.
fitHeight
=
f
cc
.
Canvas
.
instance
.
fitWidth
=
!
f
const
frameSize
=
cc
.
view
.
getFrameSize
();
this
.
_frameSize
=
frameSize
;
this
.
_designSize
=
cc
.
view
.
getDesignResolutionSize
();
let
sx
=
cc
.
winSize
.
width
/
frameSize
.
width
;
let
sy
=
cc
.
winSize
.
height
/
frameSize
.
height
;
this
.
_cocosScale
=
Math
.
min
(
sx
,
sy
);
sx
=
frameSize
.
width
/
this
.
_designSize
.
width
;
sy
=
frameSize
.
height
/
this
.
_designSize
.
height
;
this
.
_mapScaleMin
=
Math
.
min
(
sx
,
sy
)
*
this
.
_cocosScale
;
this
.
_mapScaleMax
=
Math
.
max
(
sx
,
sy
)
*
this
.
_cocosScale
;
cc
.
director
[
'
_scene
'
].
width
=
frameSize
.
width
;
cc
.
director
[
'
_scene
'
].
height
=
frameSize
.
height
;
},
// use this for initialization
// use this for initialization
onLoad
:
function
()
{
onLoad
:
function
()
{
const
{
width
:
dw
,
height
:
dh
}
=
cc
.
view
.
getDesignResolutionSize
();
const
{
width
:
fw
,
height
:
fh
}
=
cc
.
view
.
getFrameSize
();
const
minScale
=
Math
.
min
(
fw
/
dw
,
fh
/
dh
);
// cc.Canvas.instance.node.scale = minScale;
this
.
initSize
();
const
bgNode
=
cc
.
find
(
'
Canvas/bg
'
);
bgNode
.
scale
=
this
.
_mapScaleMax
;
this
.
_isReadyToPlay
=
false
;
this
.
_isReadyToPlay
=
false
;
window
[
'
vv
'
]
=
this
;
window
[
'
vv
'
]
=
this
;
...
@@ -99,7 +133,7 @@ cc.Class({
...
@@ -99,7 +133,7 @@ cc.Class({
});
});
this
.
initdDrag
();
this
.
initdDrag
();
// console.log(11111)
// console.log(11111)
this
.
videoPlayer
=
this
.
node
.
getComponent
(
cc
.
VideoPlayer
);
//
this.videoPlayer = this.node.getComponent(cc.VideoPlayer);
this
.
videoPlayer
.
getImpl
=
function
()
{
this
.
videoPlayer
.
getImpl
=
function
()
{
return
this
.
_impl
;
return
this
.
_impl
;
}
}
...
@@ -167,7 +201,7 @@ cc.Class({
...
@@ -167,7 +201,7 @@ cc.Class({
const
pgBar
=
this
.
ProgressBar
.
node
;
const
pgBar
=
this
.
ProgressBar
.
node
;
this
.
tw
=
new
(
function
(){
this
.
tw
=
new
(
function
(){
this
.
_tw
=
cc
.
tween
(
pgBar
).
delay
(
3
).
to
(.
6
,
{
this
.
_tw
=
cc
.
tween
(
pgBar
).
delay
(
3
).
to
(.
6
,
{
opacity
:
0
opacity
:
255
}).
call
(()
=>
{
}).
call
(()
=>
{
console
.
log
(
'
This is a callback
'
);
console
.
log
(
'
This is a callback
'
);
this
.
running
=
false
;
this
.
running
=
false
;
...
@@ -267,6 +301,7 @@ cc.Class({
...
@@ -267,6 +301,7 @@ cc.Class({
let
newX
=
percent
*
maxX
;
let
newX
=
percent
*
maxX
;
newX
=
Math
.
min
(
maxX
,
Math
.
max
(
newX
,
minX
));
newX
=
Math
.
min
(
maxX
,
Math
.
max
(
newX
,
minX
));
this
.
barTag
.
x
=
newX
;
this
.
barTag
.
x
=
newX
;
this
.
bar
.
width
=
newX
;
},
},
formatTime
(
time
)
{
formatTime
(
time
)
{
if
(
time
===
undefined
)
{
if
(
time
===
undefined
)
{
...
@@ -302,6 +337,7 @@ cc.Class({
...
@@ -302,6 +337,7 @@ cc.Class({
},
},
play
(){
play
(){
this
.
videoPlayer
.
node
.
active
=
true
;
this
.
videoPlayer
.
play
();
this
.
videoPlayer
.
play
();
this
.
triggerInteractive
()
this
.
triggerInteractive
()
},
},
...
@@ -320,6 +356,7 @@ cc.Class({
...
@@ -320,6 +356,7 @@ cc.Class({
},
},
replay
(){
replay
(){
this
.
videoPlayer
.
currentTime
=
0
;
this
.
videoPlayer
.
currentTime
=
0
;
this
.
videoPlayer
.
play
();
this
.
triggerInteractive
()
this
.
triggerInteractive
()
},
},
...
...
assets/xy_video/Texture/BRLNSDB.TTF
deleted
100644 → 0
View file @
fe63b0cb
File deleted
assets/xy_video/Texture/BRLNSDB.TTF.meta
deleted
100644 → 0
View file @
fe63b0cb
{
"ver": "1.1.0",
"uuid": "2b4706dd-52dd-463a-865d-a5cee0dd7598",
"subMetas": {}
}
\ No newline at end of file
assets/xy_video/Texture/barbg.png
deleted
100644 → 0
View file @
fe63b0cb
1.93 KB
assets/xy_video/Texture/barbg.png.meta
deleted
100644 → 0
View file @
fe63b0cb
{
"ver": "2.3.5",
"uuid": "7babf1e0-399f-4c50-a3cc-c747f4d314e4",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 21,
"height": 21,
"platformSettings": {},
"subMetas": {
"barbg": {
"ver": "1.0.4",
"uuid": "9c0a9a1c-f515-419f-a98b-d1926c0d9791",
"rawTextureUuid": "7babf1e0-399f-4c50-a3cc-c747f4d314e4",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 21,
"height": 21,
"rawWidth": 21,
"rawHeight": 21,
"borderTop": 10,
"borderBottom": 10,
"borderLeft": 10,
"borderRight": 10,
"subMetas": {}
}
}
}
\ No newline at end of file
assets/xy_video/Texture/bartag.png
deleted
100755 → 0
View file @
fe63b0cb
55.9 KB
assets/xy_video/Texture/bartag.png.meta
deleted
100644 → 0
View file @
fe63b0cb
{
"ver": "2.3.5",
"uuid": "fe2f92d5-98f1-488f-ac31-a8a2552d1023",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 192,
"height": 234,
"platformSettings": {},
"subMetas": {
"bartag": {
"ver": "1.0.4",
"uuid": "88113a42-ecd9-4466-92f3-473d8d95f1df",
"rawTextureUuid": "fe2f92d5-98f1-488f-ac31-a8a2552d1023",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 192,
"height": 234,
"rawWidth": 192,
"rawHeight": 234,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
assets/xy_video/Texture/direction.png
deleted
100755 → 0
View file @
fe63b0cb
23.1 KB
assets/xy_video/Texture/direction.png.meta
deleted
100644 → 0
View file @
fe63b0cb
{
"ver": "2.3.5",
"uuid": "3958e883-f0f5-4d3d-a194-d3a19297733d",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 135,
"height": 138,
"platformSettings": {},
"subMetas": {
"direction": {
"ver": "1.0.4",
"uuid": "ad3edd55-2906-4438-937b-9bd900ec782c",
"rawTextureUuid": "3958e883-f0f5-4d3d-a194-d3a19297733d",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 135,
"height": 138,
"rawWidth": 135,
"rawHeight": 138,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
assets/xy_video/Texture/pause.png
deleted
100644 → 0
View file @
fe63b0cb
49 KB
assets/xy_video/Texture/pause.png.meta
deleted
100644 → 0
View file @
fe63b0cb
{
"ver": "2.3.5",
"uuid": "8a3fc755-6a40-4dcb-aae0-b31cb9c3a699",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 213,
"height": 180,
"platformSettings": {},
"subMetas": {
"pause": {
"ver": "1.0.4",
"uuid": "3c9a6fa7-92a9-439a-9771-9dfe16c27d02",
"rawTextureUuid": "8a3fc755-6a40-4dcb-aae0-b31cb9c3a699",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 213,
"height": 180,
"rawWidth": 213,
"rawHeight": 180,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
assets/xy_video/Texture/pbbg1.png
deleted
100755 → 0
View file @
fe63b0cb
784 Bytes
assets/xy_video/Texture/pbbg1.png.meta
deleted
100644 → 0
View file @
fe63b0cb
{
"ver": "2.3.5",
"uuid": "4aae83cf-809c-4556-86f0-08bfefacc909",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 886,
"height": 16,
"platformSettings": {},
"subMetas": {
"pbbg1": {
"ver": "1.0.4",
"uuid": "1eb8f65f-e646-43ae-8af0-21995ddd351d",
"rawTextureUuid": "4aae83cf-809c-4556-86f0-08bfefacc909",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 886,
"height": 16,
"rawWidth": 886,
"rawHeight": 16,
"borderTop": 4,
"borderBottom": 4,
"borderLeft": 10,
"borderRight": 10,
"subMetas": {}
}
}
}
\ No newline at end of file
assets/xy_video/Texture/play.png
deleted
100644 → 0
View file @
fe63b0cb
50.2 KB
assets/xy_video/Texture/play.png.meta
deleted
100644 → 0
View file @
fe63b0cb
{
"ver": "2.3.5",
"uuid": "65ac1dc4-ec2d-4dce-8e05-d5f8bd54fa36",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 213,
"height": 180,
"platformSettings": {},
"subMetas": {
"play": {
"ver": "1.0.4",
"uuid": "9b421b39-8aa4-4e39-bfb5-a2f7325df219",
"rawTextureUuid": "65ac1dc4-ec2d-4dce-8e05-d5f8bd54fa36",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 213,
"height": 180,
"rawWidth": 213,
"rawHeight": 180,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
assets/xy_video/Texture/replay.png
deleted
100755 → 0
View file @
fe63b0cb
28.9 KB
assets/xy_video/Texture/replay.png.meta
deleted
100644 → 0
View file @
fe63b0cb
{
"ver": "2.3.5",
"uuid": "0e014438-2aac-418d-8ab1-a934a0c00bba",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 141,
"height": 171,
"platformSettings": {},
"subMetas": {
"replay": {
"ver": "1.0.4",
"uuid": "84e9a926-e72c-47b2-9f49-36279947554d",
"rawTextureUuid": "0e014438-2aac-418d-8ab1-a934a0c00bba",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 141,
"height": 171,
"rawWidth": 141,
"rawHeight": 171,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
assets/xy_video/Texture/singleColor.png
deleted
100644 → 0
View file @
fe63b0cb
82 Bytes
assets/xy_video/Texture/singleColor.png.meta
deleted
100644 → 0
View file @
fe63b0cb
{
"ver": "2.3.5",
"uuid": "a8027877-d8d6-4645-97a0-52d4a0123dba",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 2,
"height": 2,
"platformSettings": {},
"subMetas": {
"singleColor": {
"ver": "1.0.4",
"uuid": "410fb916-8721-4663-bab8-34397391ace7",
"rawTextureUuid": "a8027877-d8d6-4645-97a0-52d4a0123dba",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 2,
"height": 2,
"rawWidth": 2,
"rawHeight": 2,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
assets/xy_video/Texture/video/processbg.png.meta
View file @
bfb54bdd
...
@@ -26,8 +26,8 @@
...
@@ -26,8 +26,8 @@
"height": 50,
"height": 50,
"rawWidth": 744,
"rawWidth": 744,
"rawHeight": 50,
"rawHeight": 50,
"borderTop":
0
,
"borderTop":
15
,
"borderBottom":
0
,
"borderBottom":
21
,
"borderLeft": 35,
"borderLeft": 35,
"borderRight": 37,
"borderRight": 37,
"subMetas": {}
"subMetas": {}
...
...
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