Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26765] Android : videoPlayer rotation not working

GitHub Issuen/a
TypeBug
PriorityNone
StatusClosed
ResolutionWon't Fix
Resolution Date2019-11-01T13:25:56.000+0000
Affected Version/sRelease 7.5.0
Fix Version/sn/a
ComponentsAndroid
Labelsn/a
ReporterAminul Islam
AssigneeUnknown
Created2019-01-25T16:06:31.000+0000
Updated2019-11-01T13:25:56.000+0000

Description

Hello! In my project, there is a video player. but only text get rotating, not the video player gets rotating. Look my screenshot, text: Hi I am your table Get rotated in the second half but the video contains "9" number not get rotated in the second half. The first half is 0-degree rotation & the second half is the 180-degree rotation. Test Code:
exports.dummy=function(win)
{

	mainUI = function(vwWelcome) {
		
		var lblIam = Ti.UI.createLabel({

			top : "0dp",
			color : '#f7f7f7',
			font : {
				fontSize : "40dp"
				//fontFamily : require('main').FuturaStdBook,
			},
			text : "Hi, I’m your table for today",
			textAlign : Ti.UI.TEXT_ALIGNMENT_CENTER,
			opacity : 1 // for now

		});

		vwWelcome.add(lblIam); 

		var videoPlayer = Titanium.Media.createVideoPlayer({
			//top : 2,
			
			autoplay : true,
			//backgroundColor : 'blue',
			height : Ti.UI.FILL,
			width : Ti.UI.FILL,
			//rotation:180,
			//fullscreen:false,
			//ControlStyle : Titanium.Media.VIDEO_CONTROL_DEFAULT,
			scalingMode : Titanium.Media.VIDEO_SCALING_RESIZE_ASPECT_FILL
		});

		videoPlayer.url = '/video/Comp 1 (1).mp4';

		vwWelcome.add(videoPlayer);
		videoPlayer = null;

	};

	vwToplayer = Ti.UI.createView({
		height : "200dp",

		width : Ti.UI.FILL,
		backgroundColor : '#000000',
		top : "10dp",
		rotation:0

	});

	win.add(vwToplayer);

	vwBottomlayer = Ti.UI.createView({
		height : "183dp",

		width : Ti.UI.FILL,
		backgroundColor : '#000000',
		bottom: "10dp",
		rotation:180

	});

	win.add(vwBottomlayer);
	

	setTimeout(function() {

		if (vwBottomlayer !== null && vwToplayer !== null) {

			mainUI(vwBottomlayer);
			mainUI(vwToplayer);

			//slidefortableConnect(vwBottomlayer);
			//slidefortableConnect(vwToplayer);

		}

	}, 1000); 

			

};
Test Environment:
Operating System
  Name                        = Microsoft Windows 10 Pro
  Version                     = 10.0.17134
  Architecture                = 32bit
  # CPUs                      = 4
  Memory                      = 17091956736
Node.js
  Node.js Version             = 8.9.1
  npm Version                 = 5.5.1
Titanium CLI
  CLI Version                 = 5.1.1
Titanium SDK
  SDK Version                 = 7.5.0.GA
Android Devices : Samsung j7 (Android 8.0)
Thanks

Attachments

FileDateSize
Screenshot_20190125-214049.jpg2019-01-25T16:01:16.000+000086641

Comments

  1. Joshua Quick 2019-04-12

    It's been a few years, but I remember that you can't reliably rotate Android's native views such as the Java [VideoView](https://developer.android.com/reference/android/widget/VideoView) and [EditText](https://developer.android.com/reference/android/widget/EditText) via the view's native rotate() method like you can on iOS. Your only option is to rotate the entire device from portrait to landscape (or vice-versa) and let the Android OS rotate the entire activity window for you. This is especially true for the Java [VideoView](https://developer.android.com/reference/android/widget/VideoView) since it is a [SurfaceView](https://developer.android.com/reference/android/view/SurfaceView.html), which is rendered on a separate thread and composited by the Android OS into the app window's UI (which is known to have z-ordering bugs on Google's end). Bottom line, don't do this. Don't use a fixed orientation window and and let the OS do this for you via device orientation changes.

JSON Source