Trigger and wait video processing from the dialog/widget

Hello, I am using the upload widget and I’d like to trigger and wait for video processing after a video is successfully uploaded.
Is there a common flow t manage that?

So far, I think I found a way but not sure it is ideal…

dialog.fileColl.onAdd.add(file => {
      file.progress(progressInfo => {
        // If state === ready 
        // -> trigger the video processing
        // -> display a loading overlay 
        // -> once processing finished, hide overlay
        // then set the new file in the dialog?
      });
    });

Any feedback on this?

Thanks