Issue
App is not able to get fullscreen video to close properly on an iPad device/simulator.
Also, _complete_ event listener gets fired twice
[INFO] 1BestPractices/1.0 (2.1.4.GA.51f2c64)
[INFO] Movie Complete
[INFO] Movie Complete
Expected results
Get window closed when "DONE" button get clicked
Tested on
iOS 5.1.5 iPad Simulator
On iOS 6 is not reproducible
Steps to reproduce
1. Grab and paste app.js below
2. Run in iPad simulator
3. Hold till video get played
4. Click "DONE" button, notice how the Fullscreen video can't be get closed
5. Repeat steps 1 to 4 on iOS 6 - the DONE button might work in such Ti SDK
Repro sequence
function playFullscreenVideo(videoUrl) {
var win = Ti.UI.createWindow({
orientationModes: [Ti.UI.LANDSCAPE_LEFT, Ti.UI.LANDSCAPE_RIGHT]
});
var player = Ti.Media.createVideoPlayer({
mediaControlStyle: Ti.Media.VIDEO_CONTROL_FULLSCREEN,
scalingMode: Ti.Media.VIDEO_SCALING_ASPECT_FIT,
fullscreen: true,
url: videoUrl
});
player.addEventListener('complete', function(e) {
Ti.API.info('Movie Complete');
//player.setFullscreen(false);//Added
player.stop();
player.release();
win.close();
});
player.addEventListener('fullscreen', function(e) {
if (!e.entering) {
Ti.API.info('Entering fullscreen');
player.stop();
player.release();
win.close();
}
});
win.add(player);
win.open();
}
//Providing x video ...
var contentURL = 'http://movies.apple.com/media/us/ipad/2010/tours/apple-ipad-video-us-20100127_r848-9cie.mov';
playFullscreenVideo( contentURL );
Workaround
Remove "mediaControlStyle" property of Ti.Media.VideoPlayer object.
cannot reproduce Tested with Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 iOS iPhone Simulator: iOS SDK version: 6.0
Tested with: SDK:3.1.1.v20130508233955 Appcelerator Studio: 3.1.1.201305072102 OS: OSX 10.7.5 Device:ipad simulator Cannot reproduce