我要插入的数据是 blob 或文件这是用于学校项目的,讲师说现在将其插入数据库。
这就是我现在拥有的
function stop() {
cancelAnimationFrame(rafId);
endTime = Date.now();
$('#stop-me').disabled = true;
document.title = ORIGINAL_DOC_TITLE;
toggleActivateRecordButton();
console.log('frames captured: ' + frames.length + ' => ' +
((endTime - startTime) / 1000) + 's video');
embedVideoPreview();
};
function embedVideoPreview(opt_url) {
var url = opt_url || null;
var video = $('#video-preview video') || null;
var downloadLink = $('#video-preview a[download]') || null;
if (!video) {
video = document.createElement('video');
video.autoplay = true;
video.controls = true;
video.loop = true;
//video.style.position = 'absolute';
//video.style.top = '70px';
//video.style.left = '10px';
video.style.width = canvas.width + 'px';
video.style.height = canvas.height + 'px';
$('#video-preview').appendChild(video);
downloadLink = document.createElement('a');
downloadLink.download = 'capture.webm';
downloadLink.textContent = '[ download video ]';
downloadLink.title = 'Download your .webm video';
var p = document.createElement('p');
p.appendChild(downloadLink);
$('#video-preview').appendChild(p);
} else {
window.URL.revokeObjectURL(video.src);
}
if (!url) {
var webmBlob = Whammy.fromImageArray(frames, 1000 / 60);
url = window.URL.createObjectURL(webmBlob);
}
video.src = url;
downloadLink.href = url;
这就是我从同一页面将其插入数据库的方式,我也不确定视频 blob 的创建位置。
<?php
require("connect.php");
$namey = video;
$up = mysql_query("INSERT INTO video VALUES ($namey)");
?>