i want to use custom image as thumbnail for remote video (youtube) in my paragraphs , I create one field called custom image under remote video and used the below code.
if ($entity->bundle() === 'remote_video' && isset($entity->get('field_custom_image')->target_id)) {
$entity->get('thumbnail')->target_id = $entity->get('field_optional_custom_image')->target_id;
}
The thumbnail image is replaced by a custom image in media view, but when I tried to use that media in page, it is still using the Youtube thumbnail image.
Any help on this is greatly appreciated.