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; }
I can see that the thumbnail image is being replaced by custom image in media view but when i tried to use that media in page , it is still rendering youtube thumbnail image. any help on this is greatly appreciated