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
e73d2550
Commit
e73d2550
authored
Aug 12, 2022
by
liujiangnan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat
parent
431000f3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
xy_video.js
assets/xy_video/Scene/xy_video.js
+11
-11
No files found.
assets/xy_video/Scene/xy_video.js
View file @
e73d2550
...
@@ -95,35 +95,36 @@ cc.Class({
...
@@ -95,35 +95,36 @@ cc.Class({
cc
.
macro
.
ENABLE_TRANSPARENT_CANVAS
=
true
;
cc
.
macro
.
ENABLE_TRANSPARENT_CANVAS
=
true
;
this
.
node
.
on
(
'
ready-to-play
'
,
()
=>
{
this
.
videoPlayer
.
node
.
on
(
'
ready-to-play
'
,
()
=>
{
console
.
log
(
'
ready-to-play
'
);
console
.
log
(
'
ready-to-play
'
);
});
});
this
.
node
.
on
(
'
meta-loaded
'
,
()
=>
{
this
.
videoPlayer
.
node
.
on
(
'
meta-loaded
'
,
()
=>
{
console
.
log
(
'
meta-loaded
'
);
console
.
log
(
'
meta-loaded
'
);
this
.
_isReadyToPlay
=
true
;
this
.
_isReadyToPlay
=
true
;
this
.
durationLabel
.
string
=
this
.
formatTime
(
this
.
videoPlayer
.
getDuration
());
this
.
durationLabel
.
string
=
this
.
formatTime
(
this
.
videoPlayer
.
getDuration
());
// this.videoPlayer.resume();
// this.videoPlayer.resume();
this
.
videoPlayer
.
stop
();
this
.
videoPlayer
.
stop
();
});
});
this
.
node
.
on
(
'
clicked
'
,
()
=>
{
this
.
videoPlayer
.
node
.
on
(
'
clicked
'
,
()
=>
{
console
.
log
(
'
clicked
'
);
console
.
log
(
'
clicked
'
);
});
});
this
.
node
.
on
(
'
playing
'
,
()
=>
{
this
.
videoPlayer
.
node
.
on
(
'
playing
'
,
()
=>
{
console
.
log
(
'
playing
'
);
console
.
log
(
'
playing
'
);
this
.
durationLabel
.
string
=
this
.
formatTime
(
this
.
videoPlayer
.
getDuration
());
this
.
playButton
.
node
.
active
=
false
;
this
.
playButton
.
node
.
active
=
false
;
this
.
pauseButton
.
node
.
active
=
true
;
this
.
pauseButton
.
node
.
active
=
true
;
});
});
this
.
node
.
on
(
'
paused
'
,
()
=>
{
this
.
videoPlayer
.
node
.
on
(
'
paused
'
,
()
=>
{
console
.
log
(
'
paused
'
);
console
.
log
(
'
paused
'
);
// this.playButton.node.active = true;
// this.playButton.node.active = true;
// this.pauseButton.node.active = false;
// this.pauseButton.node.active = false;
});
});
this
.
node
.
on
(
'
stopped
'
,
()
=>
{
this
.
videoPlayer
.
node
.
on
(
'
stopped
'
,
()
=>
{
console
.
log
(
'
stopped
'
);
console
.
log
(
'
stopped
'
);
// this.playButton.node.active = true;
// this.playButton.node.active = true;
// this.pauseButton.node.active = false;
// this.pauseButton.node.active = false;
});
});
this
.
node
.
on
(
'
completed
'
,
()
=>
{
this
.
videoPlayer
.
node
.
on
(
'
completed
'
,
()
=>
{
console
.
log
(
'
completed
'
);
console
.
log
(
'
completed
'
);
this
.
videoPlayer
.
currentTime
=
0
;
this
.
videoPlayer
.
currentTime
=
0
;
// this.playButton.node.active = true;
// this.playButton.node.active = true;
...
@@ -142,7 +143,6 @@ cc.Class({
...
@@ -142,7 +143,6 @@ cc.Class({
// this.initListener();
// this.initListener();
this
.
initdDrag
();
this
.
initdDrag
();
// console.log(11111)
// console.log(11111)
// this.videoPlayer = this.node.getComponent(cc.VideoPlayer);
this
.
videoPlayer
.
getImpl
=
function
()
{
this
.
videoPlayer
.
getImpl
=
function
()
{
return
this
.
_impl
;
return
this
.
_impl
;
}
}
...
@@ -205,8 +205,8 @@ cc.Class({
...
@@ -205,8 +205,8 @@ cc.Class({
this
.
updateBarByPos
(
newX
);
this
.
updateBarByPos
(
newX
);
// console.log("ProgressBar TOUCH_START", newX);
// console.log("ProgressBar TOUCH_START", newX);
});
});
this
.
node
.
off
(
cc
.
Node
.
EventType
.
TOUCH_START
);
this
.
videoPlayer
.
node
.
off
(
cc
.
Node
.
EventType
.
TOUCH_START
);
this
.
node
.
on
(
cc
.
Node
.
EventType
.
TOUCH_START
,
(
e
)
=>
{
this
.
videoPlayer
.
node
.
on
(
cc
.
Node
.
EventType
.
TOUCH_START
,
(
e
)
=>
{
console
.
log
(
"
screen TOUCH_START
"
);
console
.
log
(
"
screen TOUCH_START
"
);
this
.
triggerInteractive
()
this
.
triggerInteractive
()
});
});
...
@@ -324,7 +324,7 @@ cc.Class({
...
@@ -324,7 +324,7 @@ cc.Class({
this
.
currentTimeLabel
.
string
=
this
.
formatTime
(
ct
);
this
.
currentTimeLabel
.
string
=
this
.
formatTime
(
ct
);
const
dur
=
this
.
videoPlayer
.
getDuration
();
const
dur
=
this
.
videoPlayer
.
getDuration
();
const
percent
=
ct
/
dur
;
const
percent
=
ct
/
dur
;
const
maxX
=
this
.
ProgressBar
.
node
.
width
;
const
maxX
=
this
.
ProgressBar
.
node
.
width
-
20
;
const
minX
=
0
;
const
minX
=
0
;
let
newX
=
percent
*
maxX
;
let
newX
=
percent
*
maxX
;
newX
=
Math
.
min
(
maxX
,
Math
.
max
(
newX
,
minX
));
newX
=
Math
.
min
(
maxX
,
Math
.
max
(
newX
,
minX
));
...
...
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