Quantcast
Viewing all articles
Browse latest Browse all 8068

How to detect the idle time of your app

Hey guys! I want to know if there is a method to detect the idle time in your app. I've a simple view called start view which when idle for a certain amount of time will be invisible and a video starts playing, video on click will be closed and the process repeats.

I've used the setTimeout function but it happens only once..

function closeVideo(e){
    $.videoPlayer.stop();
    $.startView.visible =true;
}
 
setTimeout(function(){
        $.startView.visible = false;
            $.videoPlayer.play();
    },15000);
 
$.startView.addEventListener('touchend', function(e){
    setTimeout(function(){
        $.startView.visible = false;
            $.videoPlayer.play();
    },15000);
})
How to do it in loop...Please Help...Thanks in advance

Viewing all articles
Browse latest Browse all 8068

Trending Articles