- Issue created by @agelospanagiotakis
- First commit to issue fork.
- Merge request !5Issue #3519611 by mably: Video Embed Field 3.0.x compatibility → (Open) created by mably
- 🇫🇷France mably
I suggest to create a new 3.x branch for the 3.0.x compatible release.
- 🇫🇷France mably
It would be interesting to be able to fetch the video title using the FB graph API.
Here is a piece of code ChatGPT generated that could be of some help to do that:
use Drupal::httpClient; $video_id = '1234567890'; $access_token = 'your-access-token'; $response = \Drupal::httpClient()->get("https://graph.facebook.com/{$video_id}", [ 'query' => [ 'fields' => 'title', 'access_token' => $access_token, ], ]); $data = json_decode($response->getBody(), true); $title = $data['title'] ?? 'Unknown Title';
- 🇫🇷France mably
And it looks like the thumbnail fetching code needs to be updated too:
AI generated code posted here, just in case:
use Drupal::httpClient; $video_id = '1234567890'; $access_token = 'your-access-token'; $response = \Drupal::httpClient()->get("https://graph.facebook.com/{$video_id}", [ 'query' => [ 'fields' => 'thumbnails', 'access_token' => $access_token, ], ]); $data = json_decode($response->getBody(), true); $thumbnail_url = $data['thumbnails']['data'][0]['uri'] ?? NULL;