How to display a field when a media is uploaded to the media library field?
I did with javascript because the field type media_library is not an actual input field.
I overrided the setMediaUploadFieldValue jQuery function of the media_library_form_element module.
(($, Drupal) =&gt; {
  Drupal.behaviors.VideoComponent = {
    attach: () =&gt; {
      $.fn.setMediaUploadFieldValue = (data, element) =&gt; {
        const mediaElement = document.querySelector(element);
        const currentValue = mediaElement.value;

        mediaElement.value = `${currentValue}${
          currentValue === &quot;&quot; ? &quot;&quot; : &quot;,&quot;
        }${data}`;

        try {
          fetch(`${my_url}`)
            .then(response =&gt; response.json())
            .then(result =&gt; {
              if (result) {
                // Do something
              }
            });
        } catch (error) {
          return false;
        }
      };
    }
  };
})(jQuery, Drupal);