Commit bc8e89a6 authored by 李维's avatar 李维

Add slience audio

parent f9105bc9
...@@ -88,6 +88,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -88,6 +88,7 @@ export class PlayComponent implements OnInit, OnDestroy {
g_partTitle_x = null; g_partTitle_x = null;
g_mainTitle_x = null; g_mainTitle_x = null;
g_dragDelay = 300 //放置拖拽事件触发播放音效 g_dragDelay = 300 //放置拖拽事件触发播放音效
g_playSlienceAudio = false;
// ------------------------------------ // ------------------------------------
// ------------ 私有数据 ------------ // ------------ 私有数据 ------------
...@@ -535,6 +536,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -535,6 +536,7 @@ export class PlayComponent implements OnInit, OnDestroy {
element.timeoutID = null element.timeoutID = null
this.subscribeMapDragEvent(element.id, ()=>{ this.subscribeMapDragEvent(element.id, ()=>{
this.triggerSlienceAudio()
element.timeoutID = setTimeout(() => { element.timeoutID = setTimeout(() => {
if(item.media.audio_url) { if(item.media.audio_url) {
this.g_cartoon.stopAllAudio() this.g_cartoon.stopAllAudio()
...@@ -592,6 +594,8 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -592,6 +594,8 @@ export class PlayComponent implements OnInit, OnDestroy {
element.timeoutID = null element.timeoutID = null
this.subscribeMapDragEvent(element.id, ()=>{ this.subscribeMapDragEvent(element.id, ()=>{
text.ref.alpha = 0.5; text.ref.alpha = 0.5;
this.triggerSlienceAudio()
this.triggerSlienceAudio()
element.timeoutID = setTimeout(() => { element.timeoutID = setTimeout(() => {
this.g_cartoon.stopAllAudio() this.g_cartoon.stopAllAudio()
this.g_cartoon.playAudio(this.g_formData.wordLeft_audio_url) this.g_cartoon.playAudio(this.g_formData.wordLeft_audio_url)
...@@ -650,6 +654,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -650,6 +654,7 @@ export class PlayComponent implements OnInit, OnDestroy {
element.timeoutID = null element.timeoutID = null
this.subscribeMapDragEvent(element.id, ()=>{ this.subscribeMapDragEvent(element.id, ()=>{
text.ref.alpha = 0.5; text.ref.alpha = 0.5;
this.triggerSlienceAudio()
element.timeoutID = setTimeout(() => { element.timeoutID = setTimeout(() => {
this.g_cartoon.stopAllAudio() this.g_cartoon.stopAllAudio()
this.g_cartoon.playAudio(this.g_formData.wordMiddle_audio_url) this.g_cartoon.playAudio(this.g_formData.wordMiddle_audio_url)
...@@ -707,6 +712,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -707,6 +712,7 @@ export class PlayComponent implements OnInit, OnDestroy {
element.timeoutID = null element.timeoutID = null
this.subscribeMapDragEvent(element.id, ()=>{ this.subscribeMapDragEvent(element.id, ()=>{
text.ref.alpha = 0.5; text.ref.alpha = 0.5;
this.triggerSlienceAudio()
element.timeoutID = setTimeout(() => { element.timeoutID = setTimeout(() => {
this.g_cartoon.stopAllAudio() this.g_cartoon.stopAllAudio()
this.g_cartoon.playAudio(this.g_formData.wordRight_audio_url) this.g_cartoon.playAudio(this.g_formData.wordRight_audio_url)
...@@ -1125,6 +1131,13 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1125,6 +1131,13 @@ export class PlayComponent implements OnInit, OnDestroy {
} }
} }
triggerSlienceAudio() {
if(!this.g_playSlienceAudio) {
this.g_cartoon.playAudio("sm-slience", false, ()=>{
this.g_playSlienceAudio = true;
})
}
}
......
...@@ -78,7 +78,8 @@ const localAudios = { ...@@ -78,7 +78,8 @@ const localAudios = {
'sm-choice-timeup-3': 'assets/default/audio/sm-choice-timeup-3.mp3', 'sm-choice-timeup-3': 'assets/default/audio/sm-choice-timeup-3.mp3',
'sm-go': 'assets/default/audio/sm-go.mp3', 'sm-go': 'assets/default/audio/sm-go.mp3',
'sm-ready': 'assets/default/audio/sm-ready.mp3', 'sm-ready': 'assets/default/audio/sm-ready.mp3',
'sm-slience': 'assets/default/audio/sm-slience.mp3',
'cuowu': 'assets/play/sound/cuowu.mp3' 'cuowu': 'assets/play/sound/cuowu.mp3'
}; };
......
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