메인메뉴 바로가기

HOME으로 가기


사용자함수 하이브리드앱 비활성시 음원 꺼주기 함수 >>> App.inFarm(), App.outFarm()

페이지 정보

profile_image
작성자 너갱이
댓글 0건 조회 1,694회 작성일 19-04-08 10:23

본문

var  App = {

lastStdMode : null,  // "word", "ebook", "check", "main"
isPlaying : false, 

outFarm : function(){

this.lastStdMode = Farm.std; //now study code..

switch(this.lastStdMode){

case "ebook" : {
if(BK.autoPlay) {
$("btn_play").click();  ; //toggle mode
this.isPlaying = true;
}
break;
}

case "word" : 
case "check" : {
if(!Farm[this.lastStdMode].audio.paused) {
Farm[this.lastStdMode].audio.pause()​;
this.isPlaying = true;
}
break;
}
}
},

inFarm : function(){
     
     Farm.go(this.lastStdMode);

if(this.isPlaying) {

switch(this.lastStdMode){

case "ebook" : {
$("btn_play").click();
}
case "word" : 
case "check" : {
Farm[this.lastStdMode].audio.play()​;
}
}
this.isPlaying = false;
}
             this.lastStdMode = null;
     }

}

//앱 비활성시  App.outFarm();
//앱 활성시   App.inFarm();​

댓글목록

등록된 댓글이 없습니다.