Video is not capturing in Landscape mode while running appium script in iPad


#1

Appium script is running in LANDSCAPE mode in iPad but Video is capturing in PORTRAIT mode. Can you please let me know how to capture video in Landscape mode ? Please find the below code.

DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
desiredCapabilities.setCapability(“automationName”, “XCUITest”);
desiredCapabilities.setCapability(“platformName”, “iOS”);
desiredCapabilities.setCapability(“platformVersion”, version);
desiredCapabilities.setCapability(“deviceName”, deviceName);
desiredCapabilities.setCapability(“udid”, deviceName);
desiredCapabilities.setCapability(“orientation”, “LANDSCAPE”);

Video Recording Code:

((CanRecordScreen) driver.getAppiumDriver()).startRecordingScreen();

try
{
String video = ((CanRecordScreen) driver.getAppiumDriver()).stopRecordingScreen();
byte[] decodedVideo = Base64.getMimeDecoder().decode(video);

            Path testVideoDir = Paths.get(properties.getProperty("VideoRecordPath").trim());
            try {
				Files.createDirectories(testVideoDir);
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
            
            Path testVideoFile = Paths.get(testVideoDir.toString(), String.format("%s-%d.%s", "test", System.currentTimeMillis(), "mp4"));
            try {
				Files.write(testVideoFile, decodedVideo);
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
           
           }catch(Exception e)
		{
			
		}