[TIMOB-3420] iOS: Videoplayer closed before loaded still plays
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Trivial |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2012-05-22T20:56:56.000+0000 |
Affected Version/s | Release 1.6.0 |
Fix Version/s | n/a |
Components | iOS |
Labels | n/a |
Reporter | Alan Leard |
Assignee | Neeraj Gupta |
Created | 2011-04-15T03:44:54.000+0000 |
Updated | 2017-03-09T23:00:29.000+0000 |
Description
Problem
If a window containing a videoplayer is on a window that is closed before the video loads, the video will still play even if it is stopped, released and/or removed.
Test Code
Paste at the bottom of default app.js
// TESTING VIDEO PLAYER
var openVideo = function () {
var win3 = Ti.UI.createWindow();
var videoPlayer = Ti.Media.createVideoPlayer({
url: 'http://clips.vorwaerts-gmbh.de/VfE_html5.mp4',
//autoplay:false
});
tab1.open(win3);
win3.add(videoPlayer);
videoPlayer.addEventListener('loadstate',function(e){
Ti.API.info(e.loadState);
//if(e.loadState == 1){videoPlayer.autoplay = true;}
});
win3.addEventListener('close', function () {
Ti.API.info('Window Closed');
videoPlayer.stop();
videoPlayer.release();
win3.remove(videoPlayer);
});
};
win1.addEventListener('click', function () {
openVideo();
});
As a work around, you can set autoplay to false and then turn it on when the loadstate is 1.
Ticket Reference
http://developer.appcelerator.com/helpdesk/view/76612">http://developer.appcelerator.com/helpdesk/view/76612
Sample code doesn't seem to load the movie on the iOS simulator and I'm unable to open the link. Ticket closed.
Closing ticket as invalid.