Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-4300] iOS: status bar appears when video is played

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionHold
Resolution Date2017-03-20T22:17:32.000+0000
Affected Version/sRelease 2.1.0
Fix Version/sn/a
ComponentsiOS
Labelsapi
ReporterKincy Clark
AssigneeVishal Duggal
Created2011-05-31T15:30:26.000+0000
Updated2017-03-20T22:17:36.000+0000

Description

This is in reference to a bug that was marked as resolved in my opinion incorrectly: TIMOB-2768 Stephen Tramer is indeed correct that showing the statusbar upon a video launch is correct behaviour, and Apple indeed make a valid argument. But however. Upon pressing DONE, the statusbar DOES NOT hide again, and is VISIBLE OVER the navbar, a bug. And Apple have confirmed this and are rejecting apps because of this bug. So who is right here? Stephen Tramer or Apple? In my opinion this is a bug in Appcelerator that the statusbar is visible AFTER the video has been CLOSED (using the DONE button) or has finished playing. The original thread is as follows: In tiapp.xml, setting the status bar hidden, hides the status bar as expected. But when a movie is played using 'createVideoPlayer' the status bar appears and cannot be hidden again. This is from a Help Desk ticket: http://developer.appcelerator.com/helpdesk/view/63571 Here is a sample code: http://pastie.org/private/qvp8jfkqm2jgi33qvurniq

Comments

  1. Ben S. 2012-07-19

    Very critical issue to me, as well. Will this be fixed anytime, soon?
  2. Ben S. 2012-07-20

    Here is my test code, showing the bug from a different use case: http://pastie.org/private/cqqctj6px18sczgwoskeoa Tested with TI SDK 2.1.0 / iOS SDK 5.1, iPhone and iPad simulator
  3. Vishal Duggal 2012-08-02

    We rely on the MoviePlayer notifications to restore the statusBar to original state when the VideoPlayer enters and exits fullscreen. However it seems that with the controlStyle set to fullScreen the corresponding fullscreen notifications are never fired. (Have verified this with both Titanium and native apps). So this is definitely not a Titanium SDK issue. The JS workaround is pretty simple. Add an event listener for the complete event and hide the status bar as part of that event. Sample Code attached
       var win = Ti.UI.createWindow({backgroundColor:'#ccc', navBarHidden:true, fullscreen:true});
       
       var playMovieButton = Ti.UI.createButton({title:"Play", width:200, height:200});
       
       playMovieButton.addEventListener("click", function(e) {
       	
       	var sbStatus = Ti.UI.iPhone.statusBarHidden;
       	var activeMovie = Titanium.Media.createVideoPlayer({
       		contentURL:'movie.mp4',
       	    backgroundColor:'#111',
       	    mediaControlStyle:Titanium.Media.VIDEO_CONTROL_FULLSCREEN,
       	    scalingMode:Titanium.Media.VIDEO_SCALING_ASPECT_FIT 
       	});
       	
       	//Add custom property
       	activeMovie.statusBarHidden = sbStatus;
       	win.add(activeMovie);
       	
       	activeMovie.addEventListener('complete',function(e){
       	 	win.remove(e.source);
       	 	
       	 	if(e.source.statusBarHidden){
       	 		Ti.UI.iPhone.hideStatusBar()
       	 	}
       	 	else {
       	 		Ti.UI.iPhone.showStatusBar()
       	 	}
       	 	e.source = null;
       	});
       });
         
       win.add(playMovieButton);
       win.open();
       
  4. Vishal Duggal 2012-08-02

    Marking ticket as HOLD. Looks like an apple bug. JS workaround provided in ticket.
  5. Ben S. 2012-08-02

    In my app, the status bar then re-appeared again, even though I've manually hidden it. But will try it again with your workaround.
  6. Lee Morris 2017-03-20

    Closing ticket due to time passed.

JSON Source