Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dg_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
dg_video
Commits
ec6dea3c
Commit
ec6dea3c
authored
Nov 08, 2024
by
limingzhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: debug
parent
94b44dda
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
66 additions
and
2 deletions
+66
-2
dg_video.js
assets/dg_video/Scene/dg_video.js
+66
-2
No files found.
assets/dg_video/Scene/dg_video.js
View file @
ec6dea3c
...
@@ -236,11 +236,11 @@ cc.Class({
...
@@ -236,11 +236,11 @@ cc.Class({
if
(
nextItem
)
{
if
(
nextItem
)
{
// nextItem.emit('my_item_click');
// nextItem.emit('my_item_click');
this
.
clickVideoItem
(
null
,
nextItem
);
this
.
clickVideoItem
2
(
nextItem
);
}
else
{
}
else
{
// this.videoItemList[0].emit('my_item_click');
// this.videoItemList[0].emit('my_item_click');
this
.
clickVideoItem
(
null
,
this
.
videoItemList
[
0
]);
this
.
clickVideoItem
2
(
this
.
videoItemList
[
0
]);
}
}
});
});
cc
.
view
.
setResizeCallback
((
params
)
=>
{
cc
.
view
.
setResizeCallback
((
params
)
=>
{
...
@@ -387,6 +387,70 @@ cc.Class({
...
@@ -387,6 +387,70 @@ cc.Class({
},
},
async
clickVideoItem2
(
item
)
{
if
(
!
item
.
video_url
)
{
this
.
showTips
(
"
视频不存在
"
);
return
;
}
// 先暂停当前视频并释放资源
if
(
this
.
videoPlayer
.
isPlaying
())
{
this
.
videoPlayer
.
pause
();
}
// 在切换URL前先将视频组件停止并清空
this
.
videoPlayer
.
stop
();
this
.
videoPlayer
.
remoteURL
=
''
;
// 给系统一点时间来释放资源
await
asyncDelay
(
100
);
if
(
item
.
video_url
==
this
.
videoPlayer
.
remoteURL
)
{
this
.
showTips
(
"
该视频正在播放
"
);
return
;
}
this
.
videoPlayIndex
=
item
.
playIndex
;
this
.
_isReadyToPlay
=
false
;
cc
.
find
(
`Canvas/loading`
).
active
=
true
;
cc
.
find
(
`Canvas/bg`
).
active
=
true
;
cc
.
find
(
`Canvas/bgwhite`
).
active
=
true
;
cc
.
find
(
`Canvas/bg_video_shadow`
).
active
=
true
;
// this.videoPlayer.node.x = -5000;
// this.videoPlayer.node.y = -5000;
cc
.
find
(
`Canvas/videolist/view/content`
).
children
.
forEach
(
row
=>
{
cc
.
find
(
`item_active`
,
row
).
active
=
false
;
});
cc
.
find
(
`item_active`
,
item
).
active
=
true
;
this
.
videoPlayer
.
remoteURL
=
item
.
video_url
;
// 数据采集
for
(
let
i
=
0
;
i
<
this
.
data
.
dataArr
.
length
;
i
++
)
{
const
element
=
this
.
data
.
dataArr
[
i
];
if
(
element
.
video_url
==
item
.
video_url
)
{
const
count
=
this
.
data
.
dataArr
[
i
].
count
;
if
(
count
)
{
this
.
data
.
dataArr
[
i
].
count
++
;
}
else
{
this
.
data
.
dataArr
[
i
].
count
=
1
;
}
}
}
const
totalCount
=
this
.
data
.
totalCount
;
if
(
totalCount
)
{
this
.
data
.
totalCount
++
;
}
else
{
this
.
data
.
totalCount
=
1
;
}
},
start
()
{
start
()
{
let
getData
=
this
.
getData
.
bind
(
this
);
let
getData
=
this
.
getData
.
bind
(
this
);
if
(
window
&&
window
.
courseware
)
{
if
(
window
&&
window
.
courseware
)
{
...
...
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