Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-3725] Confirm TIMOB-2030 (video player scaling mode)

GitHub Issuen/a
TypeSub-task
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2011-05-04T13:03:50.000+0000
Affected Version/sRelease 1.7.0
Fix Version/sRelease 1.7.0, Sprint 2011-18
ComponentsAndroid
Labelsn/a
ReporterDon Thorp
AssigneeBill Dawson
Created2011-04-26T09:49:34.000+0000
Updated2011-05-04T13:03:50.000+0000

Description

Comments

  1. Bill Dawson 2011-04-27

    Because we have a 10MB upload limit, I couldn't attach my 11MB sample video I used for my test. You can get it [here](http://dl.dropbox.com/u/3756445/movie.mp4).
  2. Bill Dawson 2011-04-27

    When fooling around with the KitchenSink video's options, I didn't see any differences. I created my own app (see below, plus movie.mp4 attached here) which used a movie shot at 640x480 -- still no visual difference with different scaling modes. (Given the 1.3 ratio of the movie and the 1.67 ratio of the screen, I expected one of these modes to show something different than the others.)
       Titanium.UI.setBackgroundColor('#000');
       var win = Titanium.UI.createWindow({  
           title:'Test',
           backgroundColor:'#fff',
       	fullscreen: false,
       	layout: 'vertical',
       	exitOnClose: true
       });
       
       var options = [
       	{name: 'VIDEO_SCALING_ASPECT_FILL', value: Ti.Media.VIDEO_SCALING_ASPECT_FILL},
       	{name: 'VIDEO_SCALING_ASPECT_FIT', value: Ti.Media.VIDEO_SCALING_ASPECT_FIT},
       	{name: 'VIDEO_SCALING_MODE_FILL', value: Ti.Media.VIDEO_SCALING_MODE_FILL}
       ];
       
       function clickFactory(scalingMode) {
       	return function() {
       		var w = Ti.UI.createWindow({
       			fullscreen: true,
       			url: 'win.js',
       			scalingMode: scalingMode,
       			backgroundColor: 'green'
       		});
       		w.open();
       	};
       }
       
       
       for (var i = 0; i < options.length; i++) {
       	var btn = Ti.UI.createButton({
       		title: options[i].name,
       		top: 10, width: 'auto', height: 'auto'
       	});
       	btn.addEventListener('click', clickFactory(options[i].value));
       	win.add(btn);
       }
       
       win.open();
       
       
       var win = Ti.UI.currentWindow;
       Ti.API.info('SCALING MODE ' + win.scalingMode);
       var options = {
       	scalingMode: win.scalingMode,
       	url: 'movie.mp4'
       };
       function closeWin(){win.close();}
       var player = Ti.Media.createVideoPlayer(options);
       player.addEventListener('complete', closeWin);
       
       
       win.addEventListener('close', function() {
       	player.stop();
       });
       
       player.play();
       
  3. Bill Dawson 2011-04-27

    BTW testing with Titanium Mobile 1.7.0, 6b80fd9 on HTC Desire, Android 2.2
  4. Don Thorp 2011-04-27

    I used the basketball video when testing and it worked at the time. Will have to give it another look.
  5. Bill Dawson 2011-04-27

    Yeah I started with the b-ball video. You know, knowing HTC, I wouldn't be that surprised if there is a custom video player doing something wacky.
  6. Bill Dawson 2011-04-27

    I ran my test code with the basketball video on an emulator (to remove possible HTC weirdness from the equation). Same results. In fact, I used DDMS to take a snapshot of the final frame in each of the three test cases. The resulting three .PNG files are identical -- even with the same MD5 hash.
  7. Don Thorp 2011-05-04

    Fix has been pushed. Ready for testing again.
  8. Bill Dawson 2011-05-04

    Titanium Mobile 1.7.0 fbd779feb1 HTC Desire, Android 2.2 I couldn't really tell with the KS video (dunk fail), so I switched to a personal video which is 640x480 -- then it was very obvious. works!

JSON Source