[AC-2847] VideoPlayer bug: iOS 5 (or iPhone 4s with iOS 5)
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Needs more info |
Resolution Date | 2011-12-21T15:26:00.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Studio, Titanium SDK & CLI |
Labels | ios5, iphone, iphone4, videoplayer |
Reporter | Joel Hulen |
Assignee | Paul Dowsett |
Created | 2011-11-11T08:07:37.000+0000 |
Updated | 2016-03-08T07:47:47.000+0000 |
Description
I have been developing an app that supports streaming video and audio, among other things. I've gotten everything to work perfectly on my iPhone 3S with iOS 4 as well as my Android device. Tonight, I deployed the app to my new iPhone 4S with iOS5 and now the VideoPlayer will not exit when I click on the "done" button on the top-left of the title bar! The video is playing full screen and I cannot get back to any of my application screens. Is this a known bug?
Please go to this Q&A question for reference: http://developer.appcelerator.com/question/127799/videoplayer-bug-ios-5-or-iphone-4s-with-ios-5
Here's my code to reproduce:
var contentURL = 'http://streaming.alburhan.tv/Video/GetURL/ME';
var win = Titanium.UI.currentWindow;
win.orientationModes = [Titanium.UI.PORTRAIT, Titanium.UI.LANDSCAPE_LEFT, Titanium.UI.LANDSCAPE_RIGHT];
var videoURL = "";
getURL();
//if(Ti.Platform.name == 'android') {
function getURL() {
var header, responseText;
//alert('Retrieving from ' + contentURL);
var xhr = Ti.Network.createHTTPClient();
xhr.timeout = 15000;
xhr.onload = function() {
try {
//alert('Connecting...');
Ti.API.info(this.responseText);
Ti.API.info(this.status);
if(this.status == 200) {
Ti.API.info('Response ' + this.responseText);
responseText = this.responseText;
} else {
Ti.API.info('Status ' + this.status);
Ti.API.info('Response ' + this.responseText);
}
//alert(responseText);
if (responseText) {
var evaluated = JSON.parse(responseText);
//alert(evaluated.URL);
videoURL = evaluated.URL;
var activeMovie = Titanium.Media.createVideoPlayer({
contentURL: videoURL,
backgroundColor:'#111',
//movieControlMode:Titanium.Media.VIDEO_CONTROL_DEFAULT,
//scalingMode:Titanium.Media.VIDEO_SCALING_MODE_FILL
movieControlMode:Titanium.Media.VIDEO_CONTROL_FULLSCREEN,
scalingMode:Titanium.Media.VIDEO_SCALING_ASPECT_FIT,
sourceType:Titanium.Media.VIDEO_SOURCE_TYPE_STREAMING
});
if (parseFloat(Titanium.Platform.version) >= 3.2)
{
win.add(activeMovie);
}
var windowClosed = false;
activeMovie.addEventListener('complete',function()
{
if (!windowClosed)
{
//Titanium.UI.createAlertDialog({title:'Movie', message:'Completed!'}).show();
}
win.close();
});
activeMovie.fullscreen = true;
activeMovie.play();
win.addEventListener('close', function()
{
if (!windowClosed)
{
windowClosed = true;
//alert("Window closed");
activeMovie.stop();
}
});
}
else {
alert('Could not load video data from the server. Please try again later.');
}
}
catch(E){
alert('There was an error retrieving stream data from the server: ' + E);
}
};
xhr.onerror = function(e) {
Ti.API.debug(e.error);
alert('Could not connect to the server in order to retrieve stream data: ' + e.error);
};
xhr.open("GET", contentURL);
xhr.send();
}
Joel Thank you for raising this ticket. Please note the minor changes I made. In order for me to escalate this to the core team, the test case must run without modification, as per the [Creating a Test Case](https://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report#HowtoSubmitaBugReport-CreatingaTestCase). I will close this for now. Please reopen the ticket once it is complete, and I will move it to the main project. Cheers
Closing due to inactivity. If this issue still exists, please raise a new ticket, including all the information in the [JIRA Ticket Checklist](https://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report#HowtoSubmitaBugReport-JIRATicketChecklist) to ensure that we can escalate it quickly. Read [How to Submit a Bug Report](https://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report) if you have not read it before, and always start a ticket using the [JIRA Ticket Template](https://wiki.appcelerator.org/display/guides/JIRA+Ticket+Template). Thanks in advance