[TIMOB-11864] iOS: Media - Video gets freeze if label (to start video) is doubletapped instead of singletap.
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2012-12-05T02:04:43.000+0000 |
Affected Version/s | Release 3.0.0 |
Fix Version/s | 2012 Sprint 25, 2012 Sprint 25 API |
Components | iOS |
Labels | api, qe-ios100112 |
Reporter | Anshu Mittal |
Assignee | Sabil Rahim |
Created | 2012-11-27T09:47:51.000+0000 |
Updated | 2014-06-19T12:42:50.000+0000 |
Description
Video gets freezed if label to start video is doubletapped instead of singletap.
This is not regression since the issue occurs in 2.1.4GA and 2.1.3GA as well.
Steps to reproduce:
1. Create an app using the code below.
2. doubletap on 'start video' label.
Actual:
The video screen goes black and gets freeze.
Expected:
The video should play as usual.
var win1 = Titanium.UI.createWindow({
title:'Test',
backgroundColor:'#fff'
});
var label = Ti.UI.createLabel({
top: 30,
width:100,
height:30,
text: 'start video',
backgroundColor:'white'
});
win1.add(label);
label.addEventListener('singletap', function(e){
activeMovie = Titanium.Media.createVideoPlayer({
width: 640/4, //if the aspect is not video default, then you'll get an exception
height: 360/4, //if the aspect is not video default, then you'll get an exception
fullscreen: true, //this one must be true, or the video must be resized for the exception
autoplay: false,
url: 'movie.mp4',
backgroundColor:'#000',
movieControlMode:Ti.Media.VIDEO_CONTROL_DEFAULT,
scalingMode:Ti.Media.VIDEO_SCALING_ASPECT_FIT
});
win1.add(activeMovie);
activeMovie.addEventListener('complete', function(e){
Ti.API.info('movie finished playing');
if (activeMovie.playing == true) {
Ti.API.info('movie is playing');
activeMovie.stop();
} else {
Ti.API.info('movie is stopped');
}
activeMovie.fullscreen = false;
win1.remove(activeMovie);
Ti.API.info('movie onComplete finished');
});
activeMovie.play();
});
win1.open();
The issue here is not with the video player but with eventing. The label is listening for
singletap
events. Singletap events generally would be fired multiple times if you have not registered for adoubletap
event. This is the intended behavior. If you have registered for doubletap, then this goes away and singletap will only be invoked when single tap occur. Solution to this ticket is either useclick
event listener instead ofsingletap
or register fordoubletap
on label. Marking ticket as invalid. Corrected code with soultion [1](https://raw.github.com/gist/4211444/abbe2137ec9adccec0e3efd3268b7e6fdfcc552d/app.js) , [2](https://raw.github.com/gist/4211452/9e576a5d40fc5fc52c92e77d5bee6695fb2b9108/app.js)Tested with: SDK: 3.1.0.v20130409124549 Studio:3.1.0.201304011603 Device: iPad2(v 5.1) OS: OSX 10.7.5 Video doesn't get freeze if 'click' is used instead of 'singletap' or 'doubletap' is handled.