Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
ls_gramophone
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
ls_gramophone
Commits
f1eb499d
Commit
f1eb499d
authored
May 23, 2022
by
李帅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
+1
parent
d74fbaab
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
ls_gramophone.ts
assets/ls_gramophone/scene/ls_gramophone.ts
+10
-3
No files found.
assets/ls_gramophone/scene/ls_gramophone.ts
View file @
f1eb499d
/*
/*
* @Author: ls
* @Author: ls
* @Date: 2022-05-15 18:22:18
* @Date: 2022-05-15 18:22:18
* @LastEditTime: 2022-05-23 1
2:39:28
* @LastEditTime: 2022-05-23 1
5:25:56
* @LastEditors: ls
* @LastEditors: ls
* @Description:
* @Description:
* @FilePath: \ls_gramophone\assets\ls_gramophone\scene\ls_gramophone.ts
* @FilePath: \ls_gramophone\assets\ls_gramophone\scene\ls_gramophone.ts
...
@@ -156,6 +156,11 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -156,6 +156,11 @@ export default class SceneComponent extends MyCocosSceneComponent {
cc
.
audioEngine
.
stopAll
();
cc
.
audioEngine
.
stopAll
();
element
.
getComponent
(
Item
).
playRecord
();
element
.
getComponent
(
Item
).
playRecord
();
//
//
if
(
this
.
_records
[
index
]
!=
null
)
{
this
.
playAudioByUrl
(
this
.
_records
[
index
],
()
=>
{
element
.
getComponent
(
Item
).
stopRecord
();
});
// 播放音效
}
});
});
myrecord_play
.
on
(
'
click
'
,
()
=>
{
myrecord_play
.
on
(
'
click
'
,
()
=>
{
cc
.
audioEngine
.
stopAll
();
cc
.
audioEngine
.
stopAll
();
...
@@ -187,7 +192,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -187,7 +192,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
_recording
=
true
;
this
.
_recording
=
true
;
if
(
window
[
'
courseware
'
])
{
if
(
window
[
'
courseware
'
])
{
window
[
'
courseware
'
].
startRecord
(
1
);
window
[
'
courseware
'
].
startRecord
(
0
);
}
}
});
});
record_stop
.
on
(
'
click
'
,
()
=>
{
record_stop
.
on
(
'
click
'
,
()
=>
{
...
@@ -226,7 +231,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -226,7 +231,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
if
(
res
&&
JSON
.
parse
(
res
).
audioUrl
)
{
if
(
res
&&
JSON
.
parse
(
res
).
audioUrl
)
{
if
(
idx
!==
-
1
)
{
if
(
idx
!==
-
1
)
{
this
.
_records
[
idx
]
=
JSON
.
parse
(
res
).
audioUrl
;
this
.
_records
[
idx
]
=
JSON
.
parse
(
res
).
audioUrl
;
onHomeworkFinish
(
res
);
onHomeworkFinish
(
res
);
}
}
}
}
...
@@ -236,6 +240,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -236,6 +240,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
content
.
children
[
idx
].
getComponent
(
Item
).
recorded
();
this
.
content
.
children
[
idx
].
getComponent
(
Item
).
recorded
();
}
}
// 模拟测试
// this._records[idx] = 'http://staging-teach.cdn.ireadabc.com/92ddbc65e9af775f7a8450a5bef1a732.mp3';
this
.
resetRecord
();
this
.
resetRecord
();
}
}
});
});
...
...
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