2
當我嘗試上傳,我得到以下錯誤:Facebook的視頻上傳錯誤1363030
Error code:1363030, msg: Your video upload timed out before it could be completed. This is probably because of a slow network connection or because the video you're trying to upload is too large. Please try again.
我使用的Facebook的Javascript SDK 2.5。 我錯過了什麼或錯誤?
<script>
var files;
var fileData = '';
function handleFileSelect(evt) {
files = evt.target.files; // FileList object
var input = evt.target;
var reader = new FileReader();
reader.onload = function (e) {
fileData = e.target.result;
};
reader.readAsDataURL(input.files[0]);
// files is a FileList of File objects. List some properties.
var output = [];
for (var i = 0, f; f = files[i]; i++) {
output.push('<li class="list-group-item">', escape(f.name), '(', f.type || 'n/a', ') - ',
f.size, ' bytes','</li>');
}
document.getElementById('list').innerHTML = output.join('');
}
document.getElementById('files').addEventListener('change', handleFileSelect, false);
$(document).ready(function()
{
$("#upload").click(function(){
var token = $('#token').val();
FB.api(
"/me/videos",
"POST",
{
"access_token" : token,
"title" : 'test',
"source": fileData
},
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);
})
});
</script>
這裏是樣品site
那麼你的視頻太大了,或者你的上傳速度很慢? –
它的小小於200kB的測試我上傳 這是我的速度測試 http://www.speedtest.net/my-result/4995493200 –
這裏沒有涉及到實際問題,只是一個提示:您可以讓數據生成很簡單,如果你只是使用['FormData'](https://developer.mozilla.org/de/docs/Web/API/FormData)對象。這樣,您不必自己閱讀文件內容,製作它的數據URI等。 – CBroe