31 if (!isset($this->mediaFolder) || (empty($this->mediaFolder)))
33 $this->mediaFolder =
"media/video/";
36 if (!isset($this->folder) || (empty($this->folder)))
46 if (isset($this->poster) && (!empty($this->poster)))
49 $this->posterJSON =
",poster:\"$this->poster\"";
53 $this->posterJSON =
"";
57 if (isset($this->download) && (!empty($this->download)))
59 if ($this->download ===
"true")
62 $this->downloadJSON =
",free:\"$this->download\"";
66 $this->downloadJSON =
"";
72 if (is_dir($this->mediaFolder))
75 if ($dh = opendir($this->mediaFolder))
77 while (($file = readdir($dh)) !=
false)
79 if ($file ==
"." || $file ==
".." || is_dir($file))
90 if (strpos($file,
".m4v") || (strpos($file,
".M4V")) !==
false)
92 $file = rawurlencode($file);
94 $title = rtrim($title,
".m4v");
95 $title = rtrim($title,
".M4V");
97 echo
"{ name:\"$title\",m4v:\"$this->mediaFolder/$file\" $this->downloadJSON $this->posterJSON },\n\r";
103 else if (strpos($file,
".ogv") || (strpos($file,
".OGV")) !==
false)
105 $file = rawurlencode($file);
107 $title = rtrim($title,
".ogv");
108 $title = rtrim($title,
".OGV");
110 echo
"{ name:\"$title\",ogv:\"$this->mediaFolder/$file\" $this->downloadJSON $this->posterJSON },\n\r";
115 else if (strpos($file,
".flv") || (strpos($file,
".FLV")) !==
false)
117 $file = rawurlencode($file);
119 $title = rtrim($title,
".flv");
120 $title = rtrim($title,
".FLV");
122 echo
"{ name:\"$title\",flv:\"$this->mediaFolder/$file\" $this->downloadJSON $this->posterJSON },\n\r";
127 else if (strpos($file,
".mpg") || (strpos($file,
".MPG")) !==
false)
129 $file = rawurlencode($file);
131 $title = rtrim($title,
".mpg");
132 $title = rtrim($title,
".MPG");
134 echo
"{ name:\"$title\",mpg:\"$this->mediaFolder/$file\" $this->downloadJSON $this->posterJSON },\n\r";
139 else if (strpos($file,
".mp4") || (strpos($file,
".MP4")) !==
false)
141 $file = rawurlencode($file);
143 $title = rtrim($title,
".mp4");
144 $title = rtrim($title,
".MP4");
146 echo
"{ name:\"$title\",mp4:\"$this->mediaFolder/$file\" $this->downloadJSON $this->posterJSON },\n\r";