Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-12156

iOS: In iOS6, Modal Window with video player in it leaves a black screen on close

    Details

      Description

      Modal window with a video player inside it does not close properly and leaves a black screen on completion of video. It happens only on iOS6. On iOS5, works as expected. Window closes properly and returns to the root window.
      Run the below code to see the behavior.

      var rootwin = Ti.UI.createWindow({
          backgroundColor : 'red',
          navBarHidden : true,
          top : 0,
          left : 0,
          right : 0,
          bottom : 0
      });
       
      var button = Ti.UI.createButton({
          title : 'Play Video',
          width : '250dp',
          height : '50dp'
      });
      button.addEventListener('click', function(e){
          var win = Ti.UI.createWindow({
              navBarHidden : true,
              backgroundColor : '#ffffff',
              exitOnClose : true,
              top : 0,
              left : 0,
              right : 0,
              bottom : 0,
              orientationModes:[Ti.UI.PORTRAIT,Ti.UI.LANDSCAPE_LEFT,Ti.UI.LANDSCAPE_RIGHT],
              modal : true // comment this line to see proper behavior
          });
          
          var videoPlayer = Titanium.Media.createVideoPlayer({
              repeatMode : Ti.Media.VIDEO_REPEAT_MODE_NONE,
              url : 'http://monactifry-tevolys.seb-cms-qual.bearstech.com/videos/9789.mp4',
              backgroundColor : 'black',
              mediaControlStyle : Titanium.Media.VIDEO_CONTROL_DEFAULT,
              scalingMode : Titanium.Media.VIDEO_SCALING_ASPECT_FIT,
              fullscreen : true,
              autoplay : true
          });
          
          function onComplete() {
              videoPlayer.stop();
              win.close();
          }
          
          function onFullScreen(e) {
              if (e.entering == 0) {
                  videoPlayer.stop();
                  win.close();    
              }
          }
          
          videoPlayer.addEventListener('complete', onComplete);
       
          videoPlayer.addEventListener('fullscreen', onFullScreen);
          
          win.add(videoPlayer);
       
          
          win.open();
      });
      rootwin.add(button);
       
      rootwin.open();
      
      

      Note: Opening just a modal window( without video player ) from root window works fine and expected.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                vduggal Vishal Duggal (Inactive)
                Reporter:
                anagesh Anirudh Nagesh
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-15241
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Integration