- last update
over 1 year ago run-tests.sh fatal error - last update
over 1 year ago Composer error. Unable to continue. - last update
over 1 year ago run-tests.sh fatal error - π«π·France prudloff Lille
The YouTube API refuses non-HTTPS requests and it is a bad practice to call external services without HTTPS.
- Status changed to Needs work
9 months ago 3:21pm 9 July 2024 - π§πͺBelgium herved
I see some overlap here with π Add "title" attribute to YouTube, Vimeo, and Playlist embeds Needs review which seems a bit better scoped and ahead in terms of implementation IMHO.
Hence, moving to needs work. I will focus on the other issue for our project needs.Some observations:
-
+++ b/src/Plugin/Field/FieldFormatter/Video.php @@ -92,21 +92,22 @@ class Video extends FormatterBase implements ContainerFactoryPluginInterface { + $element[$delta]['#cache']['max-age'] = 0;
Why do we need to kill the page cache here?
-
+++ b/src/Plugin/video_embed_field/Provider/Vimeo.php @@ -78,7 +72,9 @@ class Vimeo extends ProviderPluginBase { + $title = (($this->oEmbedData() !== FALSE) ? $this->filterCharaters($this->oEmbedData()->title) . ' | ' : '');
This calls oEmbedData() twice, so will fetch twice which could be avoided by caching the response, similar to what is done in π Add "title" attribute to YouTube, Vimeo, and Playlist embeds Needs review
-
+++ b/src/ProviderPluginInterface.php @@ -72,11 +73,13 @@ interface ProviderPluginInterface extends PluginInspectionInterface { + public function renderEmbedCode($width, $height, $autoplay, $instance_id);
This changes the method signature, so breaks backwards compatibility which isn't ideal.
-
+++ b/src/Plugin/video_embed_field/Provider/Vimeo.php @@ -48,11 +37,16 @@ class Vimeo extends ProviderPluginBase { + $data = \json_decode($requestOembed->getBody()->getContents());
I think it would be best to use \Drupal\Component\Serialization\Json::decode
-
- π«π·France prudloff Lille
The Twig spaceless filter is deprecated: https://twig.symfony.com/doc/3.x/filters/spaceless.html
The spaceless filter is deprecated as of Twig 3.12. While not a full replacement, you can check the whitespace control features.
- π«π·France prudloff Lille
Why do we need to kill the page cache here?
Just noticed this as well, it bubbles and disables cache for the entire page.
I see some overlap here with π Add "title" attribute to YouTube, Vimeo, and Playlist embeds Needs review which seems a bit better scoped and ahead in terms of implementation IMHO.
I agree that π Add "title" attribute to YouTube, Vimeo, and Playlist embeds Needs review has the same goal and is more active, closing as duplicate.