From b236ae39b57977a90749818768b37e9462ff7dce Mon Sep 17 00:00:00 2001
From: Ariel Barreiro <16607-hanoii@users.noreply.drupalcode.org>
Date: Thu, 11 May 2023 11:23:57 +0000
Subject: [PATCH] Issue #3347969 by hanoii: Fatal error if ffmpeg is enabled
 but binary not found

---
 src/Plugin/video_embed_field/Provider/Html5.php | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/Plugin/video_embed_field/Provider/Html5.php b/src/Plugin/video_embed_field/Provider/Html5.php
index d2b6251..282cce5 100644
--- a/src/Plugin/video_embed_field/Provider/Html5.php
+++ b/src/Plugin/video_embed_field/Provider/Html5.php
@@ -50,7 +50,12 @@ class Html5 extends ProviderPluginBase {
 
     $this->phpFFMpeg = FALSE;
     if ($module_handler->moduleExists('php_ffmpeg')) {
-      $this->phpFFMpeg = \Drupal::service('php_ffmpeg');
+      try {
+        $this->phpFFMpeg = \Drupal::service('php_ffmpeg');
+      } catch (\Exception $e ) {
+        // do nothing, will remain as false
+      }
+
     }
     $this->fileSystem = $file_system;
     $this->config = $config_factory->get('video_embed_html5.config');
-- 
GitLab