Commit 44d15aaf authored by yu's avatar yu

1

parent eccee385
......@@ -92,6 +92,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this._results[idx].push(null);
});
});
this.isPlayBgAudio = true;
}
private stopQuestionAudio() {
......@@ -160,9 +161,12 @@ export default class SceneComponent extends MyCocosSceneComponent {
play.active = false;
stop.active = true;
pg.audio.stopAudio(this.itemAudio);
element.getComponent(Item).playing();
this.playAudioByUrl(quest.audio, () => {
pg.audio.playAudioByUrl(quest.audio, () => {
element.getComponent(Item).stop();
}).then((audioId: number) => {
this.itemAudio = audioId;
});
});
......@@ -237,6 +241,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
record_start.on('click', () => {
this.playLocalAudio('btn');
this.stopBgAudio();
mask.active = true;
// icon_record.getComponent(dragonBones.ArmatureDisplay).timeScale = 1;
......@@ -319,6 +324,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.log('idx:' + idx);
if (window['courseware']) {
this.playBgAudio();
window['courseware'].stopTest((res) => {
this.log('--------录音返回结果 stopTest ------------');
this.log('res' + res);
......@@ -386,6 +392,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
onHomeworkFinish({ stone: 10, details: this._results });
});
} else {
this.playBgAudio();
if (idx !== -1) {
let content = cc.find("view/content", this.pagContent.children[this.roundIdx]);
content.children[idx].getComponent(Item).recorded();
......@@ -397,12 +404,15 @@ export default class SceneComponent extends MyCocosSceneComponent {
});
this.btn_arrow.on(cc.Node.EventType.TOUCH_END, this.onArrow, this);
this.btn_last.on(cc.Node.EventType.TOUCH_END, this.onLast, this);
this.btn_audio_off.on(cc.Node.EventType.TOUCH_END, this.onAudioOff, this);
this.btn_audio_on.on(cc.Node.EventType.TOUCH_END, this.onAudioOn, this);
this.setPagBg();
this.refreshArrow();
if (this.data.bgAudio && this.data.bgAudio != "") {
this.btn_audio_on.active = true;
}
}
private itemAudio = -1;
private onAudioOn() {
this.btn_audio_off.active = true;
this.btn_audio_on.active = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment