youtube Video Crash my web app Tv

youtube player is showing the video but when i press the button to come back to the previous page it crash the whole application
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
  <script type="text/javascript" src="./js/jquery-1.9.1.js"></script>
       <script type="text/javascript" src="./js/TVKeyValue.js"></script>
<title>Insert title here</title>
</head>
<body>
    <iframe id="dummy" width="200" height="200"  src="http://www.youtube.com/embed/XGSy3_Czz8k?modestbranding=1&autoplay=1"> </iframe>
<script>
window.onload = function () {
	       document.addEventListener('tizenhwkey', function(e) {
        if(e.keyName == "back")
	try {
	    tizen.application.getCurrentApplication().exit();
	} catch (ignore) {
	}
    });   
   document.addEventListener('keydown', function(e) {
    	switch(e.keyCode){
    	case TvKeyCode.KEY_LEFT: //LEFT arrow 	
    		console.log("LEFT");
    		break;
    	case TvKeyCode.KEY_UP: //UP arrow
    		navigation("UP");
    		break;
    	case TvKeyCode.KEY_RIGHT : //RIGHT arrow 
    		console.log("RIGHT");
    		break;
    	case TvKeyCode.KEY_DOWN: //DOWN arrow
    		   window.location="./MenuTutorial.html"; 		
    		break;
    	case TvKeyCode.KEY_ENTER: //OK button
    		go_to(current_item);
    		console.log("ENTER Button");
    		break;
    	case 10009: //RETURN button
    		console.log("Return");	
    		parent.location="./MenuTutorial.html";
    		break;	
    	default:
    		console.log("Key code : " + e.keyCode);
    		break;   		
    	}
    });    
};
</script>
</body>
</html>

Responses

0 Replies