我試圖追加到與jQuery ajax媒體源緩衝區。jQuery ajax不能與'blob'dataType
以下總是導致error
。
$.ajax({url: 'streaminit.mp4', dataType: 'blob', async: false,
error: function() {
console.log('error');
}}).done(function(frag) {
sourceBuffer.appendBuffer(new Uint8Array(frag));
console.log(new Uint8Array(frag));
});
請求工作,如果我設置dataType
到text
但隨後追加源時失敗。我認爲,因爲這種類型是錯誤的。
'dataType'可以是xml,json,script或html - https://api.jquery.com/jQuery.ajax/ – Blazemonger
http://stackoverflow.com/questions/7327776/jq uery-ajax-stream-audio-in-binary-format – Blazemonger