blob: ab1f28727114b1e28815c4cc5342e6bc14ed29f4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
<?php
/**
* Elgg Videolist Plugin -
* This plugin allows users to watch videos
*
* @package Elgg
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
* @author Prateek Choudhary <synapticfield@gmail.com>
* @copyright Prateek Choudhary
*/
$videodiv = '';
$width = "600";
$height = "400";
$file = $vars['entity'];
if(isset($vars['entity'])) {
$videos = get_entity($vars['entity']);
$title = $videos->title;
$url = $videos->url;
$videoid = $videos->video_id;
$videodiv .= "<div class='video_view'>";
// view for plugins to extend
$videodiv .= elgg_view('videolist/options', array('entity' => $videos)) .
elgg_view_likes($videos); // include likes
if ($videos->videotype == "youtube") {
$videodiv .= "<br /><object width=\"$width\" height=\"$height\"><param name=\"movie\" value=\"http://{$url}&hl=en&fs=1&showinfo=0&auoplay=1\"></param><param name=\"allowFullScreen\" value=\"true\"></param><param name=\"wmode\" value=\"transparent\"></param><embed src=\"http://{$url}&hl=en&fs=1&showinfo=0&autoplay=1\" type=\"application/x-shockwave-flash\" allowfullscreen=\"true\" width=\"$width\" height=\"$height\" wmode=\"transparent\"></embed></object>";
} else if($videos->videotype == "metacafe"){
$videoid_id = $videoid;
$path = explode("/", $videos->thumbnail);
$path = array_reverse($path);
$thumbnailArray = explode(".", $path[0]);
$videoid = $videoid_id."/".$thumbnailArray[0].".swf";
$videodiv .= "<br /><embed src=\"http://www.metacafe.com/fplayer/".$videoid."\" type=\"application/x-shockwave-flash\" allowfullscreen=\"true\" allowscriptaccess=\"always\" width=\"$width\" height=\"$height\" wmode=\"transparent\" name=\"Metacafe_".$videoid_id."\"></embed>";
} else if($videos->videotype == "vimeo") {
$videodiv .= "<br /><object width=\"$width\" height=\"$height\"><param name=\"allowfullscreen\" value=\"true\" /><param name=\"allowscriptaccess\" value=\"always\" /><param name=\"wmode\" value=\"transparent\"></param><param name=\"movie\" value=\"http://vimeo.com/moogaloop.swf?clip_id=".$videoid."&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1\" /><embed src=\"http://vimeo.com/moogaloop.swf?clip_id=".$videoid."&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1\" type=\"application/x-shockwave-flash\" allowfullscreen=\"true\" allowscriptaccess=\"always\" width=\"$width\" height=\"$height\" wmode=\"transparent\"></embed></object>";
}
$videodiv .= "</div>";
$videodiv .= elgg_view_comments($videos);
print $videodiv;
}
|