Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10129] Android: VideoPlayer: Application crashes when videos on multiple views of scrollableview

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionDuplicate
Resolution Date2014-02-21T14:31:22.000+0000
Affected Version/sRelease 2.1.1, Release 3.1.0
Fix Version/sn/a
ComponentsAndroid
Labelsapi, qe-and070112
ReporterNeha Chhabra
AssigneeSunila
Created2012-07-25T05:58:26.000+0000
Updated2014-07-17T10:12:03.000+0000

Description

On Android platform, the application crashes when videos on multiple views of scrollableview. This is not a regression. It even occurs on 2.1.0 Steps to Reproduce: 1. Install and launch the application on to the android device. 2. Scroll to any view. Expected Result: 1. A scrollable view is shown with first view as the current view. A video start playing when application opens 2. The video starts playing in that view. On scrolling to any view the video plays from the start. Actual result: The application crashes when scrolled to the other view.find attached the log.txt (This works fine on iOS)

var _window= Ti.UI.createWindow();
_window.backgroundColor='white';
	    _window.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();
		});	
		   
		_window.add(scrollableView);
		 
		_window.addEventListener('open',function(e){
		    curVideo = videoViews[scrollableView.currentPage];
		    curVideo.url = 'movie.mp4';
		    curVideo.play();
		})

_window.open();

Attachments

FileDateSize
log.txt2012-07-25T05:58:26.000+00004716

Comments

  1. jithinpv 2013-02-27

    issue reproduces with sdk 3.0.2 and sdk 3.1.0 . this works fine on ios.
  2. Sunila 2014-02-21

    Duplicate of TIMOB-9959

JSON Source