Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sb_karaoke_cocos
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
sb_karaoke_cocos
Commits
9e33abd9
Commit
9e33abd9
authored
Dec 17, 2021
by
liujiaxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
b95990fe
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
karaoke.js
...ts/sb_karaoke_cocos/components/karaoke/scripts/karaoke.js
+8
-3
No files found.
assets/sb_karaoke_cocos/components/karaoke/scripts/karaoke.js
View file @
9e33abd9
...
@@ -518,7 +518,7 @@ cc.Class({
...
@@ -518,7 +518,7 @@ cc.Class({
// this._lrcNextLineTime = this._lrcData[this._lrcLineIndex] ? this._lrcData[this._lrcLineIndex].time : 0;
// this._lrcNextLineTime = this._lrcData[this._lrcLineIndex] ? this._lrcData[this._lrcLineIndex].time : 0;
// return this._remainContent.shift();
// return this._remainContent.shift();
// }
// }
if
(
!
time
)
{
if
(
!
time
||
time
<
0
)
{
time
=
0
;
time
=
0
;
}
}
let
idx
=
0
;
let
idx
=
0
;
...
@@ -612,12 +612,12 @@ cc.Class({
...
@@ -612,12 +612,12 @@ cc.Class({
let
endIndex
=
nextLineObj
.
index
;
let
endIndex
=
nextLineObj
.
index
;
while
(
line
=
this
.
_lrcData
[
endIndex
])
{
while
(
line
=
this
.
_lrcData
[
endIndex
])
{
if
(
line
.
newLine
||
index
===
0
)
{
if
(
line
.
newLine
||
index
===
0
)
{
return
line
.
time
return
line
.
time
>
0
?
line
.
time
:
0
}
}
endIndex
-=
1
;
endIndex
-=
1
;
}
}
return
{
return
{
time
:
line
.
time
,
time
:
line
.
time
>
0
?
line
.
time
:
0
,
index
:
lineObj
.
index
index
:
lineObj
.
index
};
};
},
},
...
@@ -987,6 +987,9 @@ cc.Class({
...
@@ -987,6 +987,9 @@ cc.Class({
this
.
resetLRC
();
this
.
resetLRC
();
},
},
seek
(
time
)
{
seek
(
time
)
{
if
(
time
<
0
)
{
time
=
0
}
const
adSrc
=
this
.
getCurrentPlayingSource
();
const
adSrc
=
this
.
getCurrentPlayingSource
();
adSrc
.
setCurrentTime
(
time
);
adSrc
.
setCurrentTime
(
time
);
},
},
...
@@ -1021,12 +1024,14 @@ cc.Class({
...
@@ -1021,12 +1024,14 @@ cc.Class({
if
(
this
.
_audioSource
&&
this
.
_audioSource
.
audio
)
{
if
(
this
.
_audioSource
&&
this
.
_audioSource
.
audio
)
{
this
.
_audioSource
.
audio
.
stop
()
this
.
_audioSource
.
stop
();
this
.
_audioSource
.
stop
();
// this._audioSource.audio.destroy();
// this._audioSource.audio.destroy();
this
.
_audioSource
.
audio
=
null
;
this
.
_audioSource
.
audio
=
null
;
// this._audioSource._destruct();
// this._audioSource._destruct();
}
}
if
(
this
.
_audioACSource
&&
this
.
_audioACSource
.
audio
)
{
if
(
this
.
_audioACSource
&&
this
.
_audioACSource
.
audio
)
{
this
.
_audioACSource
.
audio
.
stop
()
this
.
_audioACSource
.
stop
();
this
.
_audioACSource
.
stop
();
// this._audioACSource.audio.destroy();
// this._audioACSource.audio.destroy();
this
.
_audioACSource
.
audio
=
null
;
this
.
_audioACSource
.
audio
=
null
;
...
...
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