Added support for FLV. Might need to replace the FLV player

if we don't get explicit permission for this one.

Thanks to Julian Ridden for the code!
This commit is contained in:
moodler
2005-10-25 07:40:09 +00:00
parent 175f8a766d
commit d07851e131
5 changed files with 42 additions and 0 deletions
+8
View File
@@ -49,4 +49,12 @@
set_config( 'filter_mediaplugin_enable_avi', 1 );
}
}
if (!isset($CFG->filter_mediaplugin_enable_flv)) {
if (isset($CFG->filter_mediaplugin_ignore_flv)) {
set_config( 'filter_mediaplugin_enable_flv', !$CFG->filter_mediaplugin_ignore_flv );
}
else {
set_config( 'filter_mediaplugin_enable_flv', 1 );
}
}
?>
+21
View File
@@ -69,6 +69,27 @@ function mediaplugin_filter($courseid, $text) {
$text = preg_replace($search, $replace, $text);
}
if ($CFG->filter_mediaplugin_enable_flv) {
$search = '/<a(.*?)href=\"([^<]+)\.flv\"([^>]*)>(.*?)<\/a>/is';
$replace = '\\0&nbsp;<object class="mediaplugin flv" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
$replace .= ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ';
$replace .= ' width="480" height="360" id="flvplayer">';
$replace .= " <param name=\"movie\" value=\"$CFG->wwwroot/filter/mediaplugin/flvplayer.swf?file=\\2.flv\" />";
$replace .= ' <param name="quality" value="high" />';
$replace .= ' <param name="bgcolor" value="#FFFFFF" />';
$replace .= ' <param name="flashvars" value="'.$c.'" />';
$replace .= " <embed src=\"$CFG->wwwroot/filter/mediaplugin/flvplayer.swf?file=\\2.flv\" ";
$replace .= " quality=\"high\" bgcolor=\"#FFFFFF\" width=\"480\" height=\"360\" name=\"flvplayer\" ";
$replace .= ' type="application/x-shockwave-flash" ';
$replace .= ' flashvars="'.$c.'" ';
$replace .= ' pluginspage="http://www.macromedia.com/go/getflashplayer">';
$replace .= '</embed>';
$replace .= '</object>&nbsp;';
$text = preg_replace($search, $replace, $text);
}
if ($CFG->filter_mediaplugin_enable_mov) {
$search = '/<a(.*?)href=\"([^<]+)\.mov\"([^>]*)>(.*?)<\/a>/is';
+6
View File
@@ -10,6 +10,7 @@
$txt->mediapluginwmv = get_string( 'mediapluginwmv','admin' );
$txt->mediapluginmpg = get_string( 'mediapluginmpg','admin' );
$txt->mediapluginavi = get_string( 'mediapluginavi','admin' );
$txt->mediapluginflv = get_string( 'mediapluginflv','admin' );
$txt->yes = get_string( 'yes' );
$txt->no = get_string( 'no' );
@@ -47,4 +48,9 @@
<td><?php choose_from_menu( $yesno,'filter_mediaplugin_enable_avi',
$CFG->filter_mediaplugin_enable_avi ); ?></td>
</tr>
<tr valign="top">
<td align="right"><?php echo $txt->mediapluginflv ?></td>
<td><?php choose_from_menu( $yesno,'filter_mediaplugin_enable_flv',
$CFG->filter_mediaplugin_enable_flv ); ?></td>
</tr>
</table>
+7
View File
@@ -0,0 +1,7 @@
The FLV player is by Jeroen Wijering - www.jeroenwijering.com
produced under the creative commons license
(exact terms: http://creativecommons.org/licenses/by-nc-sa/2.5/)
We are currently waiting for clearance from him to include this
in Moodle under the GPL ... it will be removed if he says no.
Binary file not shown.