trac #201 Add flowplayer to enable multimedia playback capability.

This commit is contained in:
Robin Millette
2009-02-16 17:46:24 +00:00
parent faf82eebfe
commit 9c9b6790ce
11 changed files with 111 additions and 0 deletions

View File

@@ -474,11 +474,17 @@ function common_replace_urls_callback($text, $callback) {
function common_linkify($url) {
// It comes in special'd, so we unspecial it before passing to the stringifying
// functions
$ext = pathinfo($url, PATHINFO_EXTENSION);
$url = htmlspecialchars_decode($url);
$video_ext = array('mp4', 'flv', 'avi', 'mpg', 'mp3', 'ogg');
$display = $url;
$url = (!preg_match('#^([a-z]+://|(mailto|aim|tel):)#i', $url)) ? 'http://'.$url : $url;
$attrs = array('href' => $url, 'rel' => 'external');
if (in_array($ext, $video_ext)) {
$attrs['class'] = 'media';
}
if ($longurl = common_longurl($url)) {
$attrs['title'] = $longurl;