实际上您可以将视频文件保存在您的服务器中。在这种情况下,您必须转到生成链接的代码。然后通过ajax$.post方法将视频url发送到一个php页面。然后在php页面中编写一个php“复制”函数。请参阅下面的代码:-
先到index.php页面中的fileReady()获取视频url:-
function fileReady(fileName) {
$('#recorder').hide();
$('#message').html('This file is now dowloadable for five minutes over
<a href='+fileName+'>here</a>.');
var x=fileName;
if (x != null){
$.post('ack.php', {x: x}, function(){
//successful ajax request
}).error(function(){
alert('error... ohh no!');
});
}
var fileNameNoExtension=fileName.replace(".mp4", "");
jwplayer("mediaplayer").setup({
width:320,
height:240,
file: fileName,
image: fileNameNoExtension+"_0000.jpg"
});
$('#mediaplayer').show();
}
创建一个 php 页面,就像我创建的 ack.php 一样。然后编写以下代码:-
ack.php
$val=$_POST['x'];
$file = $val;
$newfile = 'video/output.mp4';
if (!copy($file, $newfile)) {
echo "failed to copy $file...\n";
}
这很好用,但问题是视频质量不是很好。如果有人可以给我解决方案,我该如何提高 scriptcam 中的视频质量,那对我非常有帮助。