Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-12352

HTML5 full screen video breaks backbutton listener

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 6.0.0
    • None
    • cordova-android, cordova-js

    Description

      I have application built with latest Phonegap CLI. I'm using html5 video tag to play video. After exiting from fullscreen and pressing back button, application closes instead of going to previous screen.

      Code I'm using (even alert wont show):

      cordova
      document.addEventListener("deviceready", onDeviceReady, false);
      
      function onDeviceReady() {
          document.addEventListener("backbutton", function (e) {
              alert('backbutton');
              if (mainView.activePage.name=='index'){
                  navigator.notification.confirm("Are you sure want to exit from App?", onConfirmExit, "Confirmation", "Yes,No");
                  function onConfirmExit(button) {
                      if(button==2){ //If User select a No, then return back;
                          return;
                      }else{
                          navigator.app.exitApp(); // If user select a Yes, quit from the app.
                      }
                  }
              }
              else{
                  mainView.router.back();
              }
          }, false);
      }
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            igor_maric Igor
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: