K4RL Posted August 20, 2015 Share Posted August 20, 2015 I am currently using a YouTube field in Pages and the embedded player. I was wondering if there was any way to pull just the video id eg watch?v=auIy9YNxFDk so that I can use it to pull the associated YouTube image from them without having to manually enter the videoid as a separate field ?{$record->customFieldDisplayByKey('video', 'listing')|raw}Currently pulls the full URL. I am assuming that for formatting for the embedded player the videoid at the end is somehow split?I was wondering if somehow I could pull that id and enter it like bellow to pull the image?http://img.youtube.com/vi/ videoid /maxresdefault.jpg Link to comment Share on other sites More sharing options...
Netherlord Posted August 20, 2015 Share Posted August 20, 2015 I am currently using a YouTube field in Pages and the embedded player. I was wondering if there was any way to pull just the video id eg watch?v=auIy9YNxFDk so that I can use it to pull the associated YouTube image from them without having to manually enter the videoid as a separate field ?{$record->customFieldDisplayByKey('video', 'listing')|raw}Currently pulls the full URL. I am assuming that for formatting for the embedded player the videoid at the end is somehow split?I was wondering if somehow I could pull that id and enter it like bellow to pull the image?http://img.youtube.com/vi/ videoid /maxresdefault.jpg Its been a long time since i did anything like this but i used to use $vid_id; back when i was on wordpress but i think it may have changed. http://img.youtube.com/vi/<insert-youtube-video-id-here>/default.jpgGive this a read. You will most likely need a simple function php however to make it work. Like i said ITS been a been a long time so im sure this has changed. but might set you on the right path.http://stackoverflow.com/questions/2068344/how-do-i-get-a-youtube-video-thumbnail-from-the-youtube-api Link to comment Share on other sites More sharing options...
BomAleold Posted August 21, 2015 Share Posted August 21, 2015 check this regex Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.