]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/VideoThumbnails/VideoThumbnailsPlugin.php
RepeatAction extends FormAction (and ManagedAction)
[quix0rs-gnu-social.git] / plugins / VideoThumbnails / VideoThumbnailsPlugin.php
index 7ffc94c3054735eec2b69b2611baf72283d6dffc..254931e5fbc0c9d0286f1f2eb18ca7474171347f 100644 (file)
@@ -41,12 +41,12 @@ class VideoThumbnailsPlugin extends Plugin
 {
     /*
      * This function should only extract an image from the video stream
-     * and disregard any scaling aspects in the resulting file, since
-     * this will be handled in the core thumbnail algorithm.
+     * and disregard any cropping or scaling in the resulting file, as
+     * that will be handled in the core thumbnail algorithm.
      */
-    public function onCreateFileImageThumbnail(MediaFile $file, &$imgPath, $media=null)
+    public function onCreateFileImageThumbnailSource(File $file, &$imgPath, $media=null)
     {
-        // This might accidentally pass application/ogg videos.
+        // The calling function might accidentally pass application/ogg videos.
         // If that's a problem, let's fix it in the calling function.
         if ($media !== 'video') {
             return true;
@@ -62,7 +62,7 @@ class VideoThumbnailsPlugin extends Plugin
         }
 
         // We failed to get a frame.
-        if ($frame === null) {
+        if (!$frame instanceof ffmpeg_frame) {
             return true;
         }
 
@@ -83,7 +83,7 @@ class VideoThumbnailsPlugin extends Plugin
                             'homepage' => 'https://www.gnu.org/software/social/',
                             'rawdescription' =>
                             // TRANS: Plugin description.
-                            _m('HTML5 media attachment support'));
+                            _m('Video thumbnail preview support.'));
         return true;
     }
 }