私のセットアップ: サーバー 2008 R2 IIS 7.5 PHP 5
Webページが出力を使用できるパラメーターを使用してコマンドラインexeを実行するページの1つにPHPスクリプトを配置しようとしています。
ビデオを変換してコマンドが実行された場所に保存するコマンド ライン プログラムがあります。PHP で Web ページからそれを実行し、Web ページで変換されたファイルを取得して、見るための組み込みプレーヤー??
これも可能ですか:-s
私のセットアップ: サーバー 2008 R2 IIS 7.5 PHP 5
Webページが出力を使用できるパラメーターを使用してコマンドラインexeを実行するページの1つにPHPスクリプトを配置しようとしています。
ビデオを変換してコマンドが実行された場所に保存するコマンド ライン プログラムがあります。PHP で Web ページからそれを実行し、Web ページで変換されたファイルを取得して、見るための組み込みプレーヤー??
これも可能ですか:-s
ひび割れた!
助けてくれてありがとう、しかしなんとかそれを機能させることができました:)
バックティック内のコマンドをphp Webページに渡すコマンドラインツールを使用しました。プログラムが特定の URL (フォームの POST から取得された変数) からビデオをダウンロードし、そのダウンロードしたビデオを、フラッシュへのフォールバックを持つ埋め込み HTLM 5 ビデオ要素に戻します。
特定のブラウザーでは mp4 をプルし、他のブラウザーでは webm をプルする if ステートメントを作成したので、タグをサポートしていない古いブラウザーのフラッシュで常に機能するはずです。
うまく動作します:)
参照用コード:-
<?php
$input = $_POST['url'];
function browser_info($agent=null) {
$known = array('msie', 'firefox', 'safari', 'webkit', 'opera', 'netscape',
'konqueror', 'gecko');
$agent = strtolower($agent ? $agent : $_SERVER['HTTP_USER_AGENT']);
$pattern = '#(?<browser>' . join('|', $known) .
')[/ ]+(?<version>[0-9]+(?:\.[0-9]+)?)#';
if (!preg_match_all($pattern, $agent, $matches)) return array();
$i = count($matches['browser'])-1;
return array($matches['browser'][$i] => $matches['version'][$i]);
};
$ua = browser_info();
if($ua['firefox']):
$filename = `C:\Windows\dl.exe -e -f 45/44/43/35/34/5 $input`;
$download = `C:\Windows\dl.exe -o "%(title)s.%(ext)s" -f 45/44/43/35/34/5 $input`;
$output = `C:\Windows\dl.exe -g -f 45/44/43/35/34/5 $input`;
else:
$filename = `C:\Windows\dl.exe -e -f 22/18/35/34/5 $input`;
$download = `C:\Windows\dl.exe -o "%(title)s.%(ext)s" -f 22/18/35/34/5 $input`;
$output = `C:\Windows\dl.exe -g -f 22/18/35/34/5 $input`;
endif;
?>
<html>
<head>
<script type="text/javascript">
window.onunload=function(){
window.open('/watch/close.php', '_blank', '');
window.close();
};
</script>
<link rel="stylesheet" href="../css/navigation.css" type="text/css" media="screen" />
<link rel="stylesheet" href="index.css" type="text/css" media="screen" />
</head>
<body>
<ul class="t1">
<li class="t2"><a href="/">Home</a></li>
<li class="t2 t3"><a href="../Video">Videos</a></li>
<li class="t2 t4"><a href="/Downloads">Downloads</a></li>
<li class="t2 t8"><a href="/web">Proxy</a></li>
<li class="t2 t5"><a href="../Forsale">For Sale</a></li>
<li class="t2 t6"><a href="/owa">E-mail</a></li>
<li class="t2 t7"><a href="/CV">My CV</a></li>
</ul>
<br />
<div class="white">
<video controls id="vid" width="800" height="450" autoplay="autoplay" preload="none" poster="../Images/loading.jpg">
<source src="<?php echo $filename; ?>.mp4">
<source src="<?php echo $filename; ?>.webm" type="video/webm; codecs="vp8, vorbis"">
<object>
<embed
src="player.swf"
width="640" height="360"
bgcolor="000000"
allowscriptaccess="always"
allowfullscreen="true"
type="application/x-shockwave-flash"
flashvars="width=640&height=360&type=video&fullscreen=true&volume=100&autostart=true&file='<?php echo $filename; ?>.flv'"
/>
</object>
</video>
</div>
<div class="white">
<a onmouseover="self.status='Downloadable file'; return true" onmouseout="self.status=''" onclick="alert('Please right click and use \'Save Target/Link As\'.'); return false" href="<?php echo $output; ?>">Download this video</a>
</div>
</body>
</html>