diff options
Diffstat (limited to 'func.php')
| -rw-r--r-- | func.php | 22 |
1 files changed, 21 insertions, 1 deletions
@@ -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\" |
