From: Brian Wolff Date: Sat, 22 Mar 2014 02:28:38 +0000 (-0300) Subject: Add default implementation of getLength to base MediaHandler class X-Git-Tag: 1.31.0-rc.0~16530^2 X-Git-Url: http://git.cyclocoop.org/data/Fool?a=commitdiff_plain;h=8d0f7a0ec324971404cf6683534b4f9316edc546;p=lhc%2Fweb%2Fwiklou.git Add default implementation of getLength to base MediaHandler class It was being called in File::getLength, but was only implemented in a subclass, that's not even in core. Any method of a handler class called from a method in File class should work on any subclass of MediaHandler. Change-Id: I94eda90ec3dd64b6ff2e3a5732aa539366cec521 --- diff --git a/includes/media/MediaHandler.php b/includes/media/MediaHandler.php index ee11599f4a..e4caf351a8 100644 --- a/includes/media/MediaHandler.php +++ b/includes/media/MediaHandler.php @@ -798,4 +798,18 @@ abstract class MediaHandler { public function getDefaultRenderLanguage( File $file ) { return null; } + + /** + * If its an audio file, return the length of the file. Otherwise 0. + * + * File::getLength() existed for a long time, but was calling a method + * that only existed in some subclasses of this class (The TMH ones). + * + * @param File $file + * @return float Length in seconds + * @since 1.23 + */ + public function getLength( $file ) { + return 0.0; + } }