code: private void hookDraggableViewListener() {
      draggableView.setDraggableListener(new DraggableListener() {
        @Override public void onMaximized() {
          startVideo();
        }
  
        //Empty
        @Override public void onMinimized() {
          //Empty
        }
  
        @Override public void onClosedToLeft() {
          pauseVideo();
        }
  
        @Override public void onClosedToRight() {
          pauseVideo();
        }
      });
    }
docs: Hook DraggableListener to draggableView to pause or resume VideoView.