Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-9959] Android: ScrollableView: v8- The application crashes when scrolling a scrollable view with video playing

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2014-02-22T00:03:45.000+0000
Affected Version/sRelease 2.1.0, Release 3.1.0
Fix Version/s2014 Sprint 04, 2014 Sprint 04 API
ComponentsAndroid
Labelscore, qe-testadded
ReporterEvgenii Tcarev
AssigneeSunila
Created2012-07-12T17:52:36.000+0000
Updated2017-03-16T20:53:56.000+0000

Description

Scrolling a scrollable view while a video is playing resulted in an app crash. This is not a regression it occurs on SDK 2.1.0.GA

var win=Ti.UI.createWindow();
		
win.backgroundColor='white';
win.orientationModes=[Ti.UI.PORTRAIT,Ti.UI.LANDSCAPE_LEFT,Ti.UI.LANDSCAPE_RIGHT];

var videoParams = {
  mediaControlStyle: Titanium.Media.VIDEO_CONTROL_EMBEDDED,
  scalingMode: Ti.Media.VIDEO_SCALING_ASPECT_FIT,
  height: '72%'
};
   
var videoViews = [];
  
var curVideo = null;
   
for(var i=0; i<7; i++){
  videoViews.push(Ti.Media.createVideoPlayer(videoParams));
}
   
var scrollableView = Ti.UI.createScrollableView({
  views: videoViews,
  showPagingControl: true
});
   
scrollableView.addEventListener('scrollEnd', function(e){
    if (curVideo)
    {
        if (curVideo == videoViews[e.currentPage])
        {
            return;
        }
        curVideo.stop();
        curVideo.url = null;
    }
    curVideo = videoViews[e.currentPage];
    curVideo.url = 'movie.mp4';
    curVideo.play();
});	
   
win.add(scrollableView);
 
win.addEventListener('open',function(e){
    curVideo = videoViews[scrollableView.currentPage];
    curVideo.url = 'movie.mp4';
    curVideo.play();
})

win.open();

		
Steps to reproduce:
 1) Create new studio project with attached code and run on device
 2) 
Scroll to any view Result: 1) A scrollable view is shown with first view as the current view. A video start playing when application opens 2) The application crashes Expected Result: 1) A scrollable view is shown with first view as the current view. A video start playing when application opens 2) On scrolling to any view the video plays from the start.

Comments

  1. jithinpv 2013-03-06

    Issue reproduces with Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 (03/11/13 15:43 0c88429) Titanium SDK version: 3.0.2 (02/07/13 16:46 a4def81) Device: Samsung galaxy s duos Android version: 4.0.4
  2. Sunila 2014-02-09

    Added null check when setting url in videoview https://github.com/appcelerator/titanium_mobile/pull/5342
  3. Lee Morris 2017-03-16

    Closing ticket as fixed.

JSON Source