'; $video_mp4 = '.mp4" type="video/mp4" /> '; $videomp4 = '.mp4" '; $video_webm = '.webm" type="video/webm" /> '; $videowebm = '.webm" '; $extinfo = ".ogv/.mp4/.webm"; $ivfilene = ""; $ivn = ""; $ipadplace = ""; $preext = ""; $premime = ""; $isiPad = (bool) strpos($_SERVER['HTTP_USER_AGENT'],'iPad'); if ($isiPad === false) { $isiPad = (bool) strpos($_SERVER['HTTP_USER_AGENT'],'iPhone'); } if ($isiPad === false) { $isiPad = (bool) strpos($_SERVER['HTTP_USER_AGENT'],'Android'); } function url_exists($url) { // Thanks to http://stackoverflow.com/questions/2280394/how-can-i-check-if-a-url-exists-via-php $exists = false; if (strpos($url, "https:") !== false) { if (!$fp = curl_init($url)) return false; return true; } else { $file = $url; $file_headers = @get_headers($file); if (strpos($file_headers[0], " 404 ") !== false) { // == 'HTTP/1.1 404 Not Found') { $exists = false; } else { $exists = true; } } return $exists; } function uflist($inext) { global $extinfo, $ivfilene, $isiPad, $preext, $premime, $ivn; $howmany = 0; $outoptions = ""; $outext = "$@#!"; if (strpos($ivfilene, ".") !== false) { $stuff = explode("/", $ivfilene); if (strpos($stuff[sizeof($stuff) - 1], ".") !== false) { $stuffdot = explode(".", $stuff[sizeof($stuff) - 1]); $outext = "." . $stuffdot[sizeof($stuffdot) - 1]; } } // Mime types ... thanks to http://webdesign.about.com/od/multimedia/a/mime-types-by-content-type.htm and // http://voice.firefallpro.com/2012/03/html5-audio-video-mime-types.html $earray = array( "audio/mp4" => ".m4a", "audio/ogg" => ".ogg", "audio/basic" => ".au", "audio/basic" => ".snd", "audio/mid" => ".mid", "audio/mid" => ".rmi", "audio/mpeg" => ".mp3", "audio/x-aiff" => ".aif", "audio/x-aiff" => ".aifc", "audio/x-aiff" => ".aiff", "audio/x-mpegurl" => ".m3u", "audio/x-pn-realaudio" => ".ram", "audio/x-wav" => ".wav", "image/bmp" => ".bmp", "image/cis-cod" => ".cod", "image/gif" => ".gif", "image/ief" => ".ief", "image/jpeg" => ".jpe", "image/jpeg" => ".jpeg", "image/jpeg" => ".jpg", "image/pipeg" => ".jfif", "image/svg+xml" => ".svg", "image/tiff" => ".tif", "image/tiff" => ".tiff", "image/x-cmu-raster" => ".ras", "image/x-cmx" => ".cmx", "image/x-icon" => ".ico", "image/x-portable-anymap" => ".pnm", "image/x-portable-bitmap" => ".pbm", "image/x-portable-graymap" => ".pgm", "image/x-portable-pixmap" => ".ppm", "image/x-rgb" => ".rgb", "image/x-xbitmap" => ".xbm", "image/x-xpixmap" => ".xpm", "image/x-xwindowdump" => ".xwd", "video/mp4" => ".m4v", "video/mpeg" => ".mp2", "video/mpeg" => ".mpa", "video/mpeg" => ".mpe", "video/mpeg" => ".mpeg", "video/mpeg" => ".mpg", "video/mpeg" => ".mpv2", "video/quicktime" => ".mov", "video/quicktime" => ".qt", "video/x-la-asf" => ".lsf", "video/x-la-asf" => ".lsx", "video/x-ms-asf" => ".asf", "video/x-ms-asf" => ".asr", "video/x-ms-asf" => ".asx", "video/x-msvideo" => ".avi", "video/x-sgi-movie" => ".movie", "video/ogg" => ".ogv", "video/webm" => ".webm" ); foreach ($earray as $sext => $key) { if (url_exists(str_replace($outext, "", $ivfilene) . $earray[$sext])) { if (($earray[$sext] == $outext || $earray[$sext] == $inext) && (strpos($sext, "video/") !== false || strpos($sext, "image/") !== false)) { if ($earray[$sext] != ".ogg" && $earray[$sext] != ".wav" && $earray[$sext] != ".mp3") $extinfo = ""; if (strpos($sext, "video/") !== false) { $howmany = $howmany + 1; $outoptions .= ""; } else { $outoptions .= ""; } if ($earray[$sext] == $outext) { if ($premime == "") $premime = $sext; $ivfilene = str_replace($outext, "", $ivfilene); $ivn = str_replace($outext, "", $ivn); } } else if ((strpos($sext, "video/") !== false || strpos($sext, "image/") !== false)) { if ($earray[$sext] != ".ogg" && $earray[$sext] != ".wav" && $earray[$sext] != ".mp3") $extinfo = ""; if (strpos($sext, "video/") !== false) { $howmany = $howmany + 1; $outoptions .= ""; } else { $outoptions .= ""; } if ($earray[$sext] == $outext) { if ($premime == "") $premime = $sext; $ivfilene = str_replace($outext, "", $ivfilene); $ivn = str_replace($outext, "", $ivn); } } } } if ($howmany == 1 && strpos($outoptions, " selected>") === false && strpos($outext, ".") === false && strpos($outoptions, "video/") !== false) { $outoptions = str_replace(" '; $video_mp4 = '" type="' . $stuff[1] . '" /> '; $videomp4 = '" '; $video_webm = '" type="' . $stuff[1] . '" /> '; $videowebm = '" '; $ivfilene = $pf; header('Content-type: ' . $stuff[1]); echo file_get_contents($ivfilene); exit; } } if ($isdataurl == "") { if (isset($_GET['domain'])) { $iscalled = "y"; $ivd = urldecode($_GET['domain']); } else if (isset($_POST['domain'])) { $iscalled = "y"; $ivd = urldecode($_POST['domain']); } else if (isset($_GET['dom'])) { $ivd = urldecode($_GET['dom']); } else if (isset($_POST['dom'])) { $ivd = urldecode($_POST['dom']); } else { $ivd = "http://" . $_SERVER['SERVER_NAME'] . ":" . $_SERVER['SERVER_PORT'] . "" . str_replace("?" . $_SERVER['QUERY_STRING'], "", str_replace("video_generic.php", "", $_SERVER['REQUEST_URI'])); // 'http://www.rjmprogramming.com.au/PHP/'; } if (isset($_GET['path'])) { $iscalled = "y"; $ivfp = urldecode($_GET['path']); } else if (isset($_POST['path'])) { $iscalled = "y"; $ivfp = urldecode($_POST['path']); } else if (isset($_GET['pat'])) { $ivfp = urldecode($_GET['pat']); } else if (isset($_POST['pat'])) { $ivfp = urldecode($_POST['pat']); } else { $ivfp = 'videos/'; } if (isset($_GET['filename'])) { $iscalled = "y"; $ivn = urldecode($_GET['filename']); } else if (isset($_POST['filename'])) { $iscalled = "y"; $ivn = urldecode($_POST['filename']); } else if (isset($_GET['filen'])) { $ivn = urldecode($_GET['filen']); } else if (isset($_POST['filen'])) { $ivn = urldecode($_POST['filen']); } else { $ivn = 'GoToMeeting'; //'Nala_HideAndSeek'; } $ivdir = $ivd . $ivfp; $ivfilene = $ivdir . $ivn; $preext = ""; $premime = ""; if (isset($_GET['ext'])) { $pext = explode(":", urldecode($_GET['ext'])); $preext = $pext[0]; if (sizeof($pext) > 1) $premime = $pext[1]; } else if (isset($_POST['ext'])) { $pext = explode(":", urldecode($_POST['ext'])); $preext = $pext[0]; if (sizeof($pext) > 1) $premime = $pext[1]; } $midbit = uflist($preext); if ($midbit != "") { $selinfo = ""; } else { $selinfo = ""; } if (isset($_GET['ext'])) { if ($_GET['ext'] == "") { $ivfile = $ivfilene . '.mp3'; } else { $ivfilene .= $preext; $ivfile = $ivfilene; if ($isiPad) { $ipadplace = $ivfile; } else { header('Content-type: ' . $premime); echo file_get_contents($ivfile); exit; } } } else if (isset($_POST['ext'])) { if ($_POST['ext'] == "") { $ivfile = $ivfilene . '.mp4'; } else { $ivfilene .= $preext; $ivfile = $ivfilene; if ($isiPad) { $ipadplace = $ivfile; } else { header('Content-type: ' . $premime); echo file_get_contents($ivfile); exit; } } } else { $ivfile = $ivfilene . '.mp4'; } } $ua = strtolower($_SERVER['HTTP_USER_AGENT']); if (strpos($ua, "msie 8") !== false || strpos($ua, "msie 7") !== false || strpos($ua, "msie 6") !== false) { $huh = file_get_contents($ivfile); header('Content-type: video/mp4'); echo $huh; exit; } ?>
Play Video in Various Browsers'; ?>Autoplay: \n"; ?> | Controls: \n"; ?> | Loop: \n"; ?> |
\n"; ?> | \n"; ?> | " . $selinfo . "\n"; ?> |
Autostart: \n"; ?> | Loop: \n"; ?> | Hidden: \n"; ?> |