How to store previously played video timer for a new execution

hi

i wrote the following code to automate video player in an app

MobileElement seekBar = (MobileElement)driver.findElementByName(“seekBar”);
MobileElement PlayTime = (MobileElement) driver.findElementByName(“playTime”);
String plt = PlayTime.getText();
System.out.println(“Start Time:”+plt);

	int startX = seekBar.getLocation().getX();
	System.out.println(startX);
	int endX = seekBar.getSize().getWidth();
	System.out.println(endX);
	 int yAxis = seekBar.getLocation().getY();
	 //Random rand = null;
	
	 int moveToXDirectionAt =(int) (endX * 0.6);
	 //rand.nextInt((endX - startX ) + 1) + startX;
	 System.out.println("Moving seek bar at " + moveToXDirectionAt+" In X direction.");

TouchAction act=new TouchAction((MobileDriver) driver);

		 act.longPress(startX,yAxis).moveTo(moveToXDirectionAt,yAxis).release().perform();
	
    //act.longPress(startX,yAxis).moveTo(moveToXDirectionAt,yAxis).release().perform();
    MobileElement PlayTime1 = (MobileElement) driver.findElementByName("playTime");
	String plt1 = PlayTime1.getText();
	System.out.println("Moved to Timer is:"+plt1);

the code works absolutely fine. for the initial run. The problem starts when i re-run the code with the same uid. is there a way to store value of the previously played video so as to compare newly playing video.