Where can I set the following HTML attribute to my custom field? I'm developing a custom module with an image field.

Where can I set the following HTML attribute to my custom field?

&lt;input type=file
       accept="image/*"
       capture=environment&gt;


I have created the image field and i'm able to process some OCR with an external library uploading the image but I need to use webcam instead and I can't find the way to set the "capture=enviroment" tag to my input form in the field widget file.

Thank you
Solved with formElement, at least form mobile devices. Just was I was looking for.

  /**
   * {@inheritdoc}
   */
  public function formElement(FieldItemListInterface $items, $delta, array $element, array &amp;$form, FormStateInterface $form_state) {
    $element = parent::formElement($items, $delta, $element, $form, $form_state);

    $element['#accept'] = 'image/*;capture=camera';

    return $element;
  }


Thank you!