Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-7628] Android: VideoPlayer doesn't clip properly

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionWon't Do
Resolution Date2020-01-09T19:49:17.000+0000
Affected Version/sRelease 1.8.0.1, Release 3.1.0
Fix Version/sn/a
ComponentsAndroid
Labelsparity
ReporterArthur Evans
AssigneeIngo Muschenetz
Created2012-02-13T10:18:13.000+0000
Updated2020-01-09T19:49:17.000+0000

Description

When running with scalingMode === VIDEO_SCALING_ASPECT_FILL, the video player content does not respect the width value set on the control, but scales to fit the height of the video player while maintaining aspect ratio, overflowing the sides of the control. In this mode, neither background color or border settings appears to be respected. When running with scalingMode === VIDEO_SCALING_MODE_FILL, the entire video player area is used, and no borders are visible. I believe the video view should be accounting for the width of the borders, here. Finally, when running with scalingMode === VIDEO_SCALING_ASPECT_FIT with a square view and a wide-screen video clip, the borders are drawn everywhere except the edges of the picture, where the video overwrites the border. On iOS, if borderRadius is specified, the corners are also clipped to fit the radius. Will open a separate ticket for this as it may be a bigger can of worms. Expected behavior: video should be clipped such that the borders are visible. Test case:
var vidWin = Titanium.UI.createWindow({
	title : 'Video View Test',
	backgroundColor : '#fff'
});

var activeMovie = Titanium.Media.createVideoPlayer({
	top : 0,
	autoplay : true,
	backgroundColor : 'red',
	height : 300,
	width : 300,
	borderRadius : 20,
	borderWidth : 2,
	borderColor : 'blue',
	mediaControlStyle : Titanium.Media.VIDEO_CONTROL_EMBEDDED,
	scalingMode : Titanium.Media.VIDEO_SCALING_ASPECT_FILL
});

activeMovie.url = 'movie.mp4';
if(activeMovie.fullscreen === true) {
	activeMovie.show();
} else {
	vidWin.add(activeMovie);
}

vidWin.open();
Note that when running this on Android, the video fills the width of the screen instead of being cropped to the width of the view (although, oddly, the on-screen video controls appear to be cropped to the width of the view). On iOS, the video is cropped to a rounded square, with a blue border. Swap in the other scaling modes to try the other effects.

Comments

  1. Shameer Jan 2013-03-05

    The problem reproduce with release 3.0.2 and master release 3.1.0 tested on Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 Titanium SDK version: 3.0.2 Device: Samsung galaxy s duos Android version: 4.0.4 Android Emulator: Android SDK version: 2.2
  2. Shawn Lipscomb 2014-09-12

    The problem with VIDEO_SCALING_ASPECT_FILL is apparent in SDK 3.2.3 as well. VideoPlayer needs to respect it's given boundries when fullscreen is false.
  3. Alan Hutton 2020-01-09

    It has been decided that this issue should be closed as “Won’t do.” This issue is out of date with our current supported SDK release (7.5.2.GA as of the date of closure), and out of date with mobile OS versions. If community members feel that the issue is still valid, please create a new ticket. Please reference this closed ticket number, include SDK used, comments, and code that demonstrates/reproduces the issue.

JSON Source