diff options
| author | root | 2014-09-14 23:44:49 +0200 |
|---|---|---|
| committer | root | 2014-09-14 23:44:49 +0200 |
| commit | dfc4ee6bfbff601328f6bf8dadf9716a58cbd903 (patch) | |
| tree | 6860b0def3434f40b95ccbfb87fd216d91ef5a1c /func.php | |
| parent | eb414bfb80480c1fcac7ded7e07a3dd579d3712c (diff) | |
| parent | 3a8085d8981c6521cdf5dd3b5ed3412b2aac011e (diff) | |
| download | video-dl-dfc4ee6bfbff601328f6bf8dadf9716a58cbd903.tar.gz | |
Merge branch 'master' of git.iamfabulous.de:bootstrap-video-dl
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\" |
