summaryrefslogtreecommitdiff
path: root/func.php
diff options
context:
space:
mode:
authorHorus32014-09-14 23:43:51 +0200
committerHorus32014-09-14 23:43:51 +0200
commit3a8085d8981c6521cdf5dd3b5ed3412b2aac011e (patch)
tree954df040371a63fcd0fe7b7bef9d6011db999bc9 /func.php
parent8fcfc80ca2bb393a1a4b7d4cd16e1186b7ae3597 (diff)
downloadvideo-dl-3a8085d8981c6521cdf5dd3b5ed3412b2aac011e.tar.gz
added support for webm videos
Diffstat (limited to 'func.php')
-rw-r--r--func.php22
1 files changed, 21 insertions, 1 deletions
diff --git a/func.php b/func.php
index 3c6adb7..e1bf9bb 100644
--- a/func.php
+++ b/func.php
@@ -68,7 +68,26 @@ function video_xt_audio($VIDEO, $CACHEDIR, $FILENAME){
return true;
}
-function pr_player($file, $thumb, $mime, $title, $vid){
+function convert_video($FILENAME){
+ $fp=fopen($CACHEDIR."/".$FILENAME.".webm.txt", "w");
+ $content="extracting audio: ".$FILENAME."\n";
+ fputs($fp, $content);
+ fclose($fp);
+ if(file_exists($FILENAME.".mp4") || file_exists($FILENAME.".webm"))
+ return;
+ rename($CACHEDIR . "/" . $FILENAME, $CACHEDIR . "/" . $FILENAME. ".mp4");
+ exec("ffmpeg -i " . $CACHEDIR . "/" . $VID . ".mp4 " . $CACHEDIR . "/" . $VID . ".webm", $pid, $ret);
+ rename($CACHEDIR . "/" . $FILENAME . ".mp4", $CACHEDIR . "/" . $FILENAME);
+ if($ret != 0){
+ return false;
+ }
+
+ return true;
+}
+
+function pr_player($file, $thumb, $mime, $title, $vid, $html5 = false){
+if($html5)
+ $WEBMVIDEO = "<source src=\"/".htmlentities($file.".webm")."\" type='video/webm' />";
echo "
<h1>".htmlentities($title)."</h1>
<br>
@@ -78,6 +97,7 @@ echo "
poster=\"".htmlentities($thumb)."\"
data-setup='{\"techOrder\":[\"html5\",\"flash\"]}'>
<source src=\"/".htmlentities($file)."\" type='".htmlentities($mime)."' />
+ ".$WEBMVIDEO."
<p class=\"vjs-no-js\">To view this video please enable JavaScript, and consider upgrading to a web browser that <a href=\"http://videojs.com/html5-video-support/\" target=\"_blank\">supports HTML5 video</a></p>
<object id=\"flash_fallback_1\" class=\"vjs-flash-fallback\" width=\"640\" height=\"264\" type=\"application/x-shockwave-flash\"