Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8484] iOS: Ti.UI.Window not restoring correctly after a youtube-in-app view exits

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2012-04-13T17:39:06.000+0000
Affected Version/sRelease 1.8.2
Fix Version/sRelease 2.1.0, Sprint 2012-08
ComponentsiOS
LabelsSupportTeam, api, qe-port
ReporterJunaid Younus
AssigneeVishal Duggal
Created2012-04-02T09:14:18.000+0000
Updated2012-08-14T16:21:45.000+0000

Description

*Code* http://pastebin.com/NXYbpfRH *Expected behavior* When you run the app, watch the YouTube video, it should return without messing up any UI. *Actual behavior* Once the video has finished, it actually shows the status bar overlapping the window. *Steps to reproduce* 1) Click "Watch YouTube Video" 2) Click on webview to play Youtube video while holding device in PORTRAIT orientation 3) While video is loading, turn device to LANDSCAPE. You will notice that status bar moves to the PORTRAIT orientation. 4) While video is playing in LANDSCAPE, return device to PORTRAIT orientation (you will notice that statusbar is in proper position). 5) Return device to LANDSCAPE orientation, and end video by clicking "Done". 6) The Youtube player will close and the window will reopen with window's navbar underneath the status bar. *Notes* -Only happens on a device, I tried with an iPhone 3GS running 5.0.1. -HD ticket: http://support-admin.appcelerator.com/display/APP-333237

Comments

  1. Vishal Duggal 2012-04-12

    Pull pending https://github.com/appcelerator/titanium_mobile/pull/1991
  2. Blain Hamon 2012-04-13

    Code above is
       // this sets the background color of the master UIView (when there are no windows/tab groups on it)
       Titanium.UI.setBackgroundColor('#000');
       
       // create tab group
       var tabGroup = Titanium.UI.createTabGroup();
       tabGroup.orientationModes = [Titanium.UI.PORTRAIT];
       
       //
       // create base UI tab and root window
       //
       
       var win2 = Titanium.UI.createWindow({ title:'Tab 2', backgroundColor:'#fff' });
       var button2 = Ti.UI.createButton({ title:'Watch YouTube Video', height:40 });
       button2.addEventListener('click', function() {
       var win3 = Titanium.UI.createWindow({ title:'YouTube', backgroundColor:'#CCC' });
       var url = 'http://www.youtube.com/watch?v=6b4ZZQkcNEo';
       var html = '<html>' + 
       '<head><style type"text/css"> * { margin:0; padding:0; }</style></head>' +
       '<body>' +
       '<center>' +
       '<object width="320" height="240">' +
       '<param name="movie" value="' + url + '&autoplay=1&rel=0&hl=en_US&fs=1&"></param>' +
       '<param name="allowFullScreen" value="true"></param>' +
       '<param name="allowscriptaccess" value="always"></param>' +
       '<embed src="' + url + '&autoplay=1&rel=0&hl=en_US&fs=1&" type="application/x-shockwave-flash"' +
       'allowscriptaccess="always" allowfullscreen="true" width="320" height="240"></embed></object>' +
       '</center>' +
       '</body>' + 
       '</html>';
       var webview = Ti.UI.createWebView({ top: 0, left: 0, fullscreen:true, html: html, height:240, width:320 });
       win3.add(webview);
       
       // win3.addEventListener('focus', function() { // webview.html = html; // webview.height = 240; // webview.width = 320; // });
       tabGroup.activeTab.open(win3);
       });
       win2.add(button2);
       
       //
       // create tabs
       //
       var tab2 = Titanium.UI.createTab({ icon:'KS_nav_ui.png', title:'Tab 2', window:win2 });
       
       //
       // add tabs
       // 
       tabGroup.addTab(tab2);
       
       // open tab group
       tabGroup.open();
       
  3. Blain Hamon 2012-04-13

    Pull merged
  4. Olga Romero 2012-08-14

    Verified fix with: Titanium Studio, build: 2.1.1.201207271312 Titanium SDK: 2.2.0.v20120813184911 Devices: iPhone 4s 5.0.1 iPad1 5.1.1

JSON Source