create media item from url drupal 8 code example
Example: drupal 8 get media image uri
$image_url = $media->field_media_image->entity->getFileUri();
file_create_url($image_url);
$image_url = $media->field_media_image->entity->getFileUri();
file_create_url($image_url);