我正在從我的mvc操作方法獲取一個字節數組。我想將它設置爲HTMl視頻標籤的來源。如何做呢。我的代碼如下。有沒有辦法在html5源視頻標籤上使用字節數組。
var sourcePDF = '../../Content/Images/video.webm'
if (sourcePDF != undefined && sourcePDF.trim() != "") {
var url = ResolvedUrl.replace('ActionName', 'StreamFile').replace('ControllerName', 'File');
$.ajax({
type: "POST",
url: url,
data: JSON.stringify({ filename: sourcePDF }),
contentType: "application/json; charset=utf-8",
datatype: "JSON",
success: function (response) {
debugger;
console.log(response)
var HealthCareIframeAppend = '<video width="100%" height="inherit" src="' + response + '" autoplay controls ></video>';
$('#HealthCareAttachementi').append(HealthCareIframeAppend);
$('#_SwitchFullScreenContentNewTab').switchClass('show', 'hide');
},
error: function (error) {
console.log(error);
}
});
你會使用'數據:'URI,但除非你的視頻只有幾KB(不太可能),那麼這將是一個壞主意。是否有理由不能將動作設置爲'
我的問題是,如果我設置src源,它工作正常的Firefox,但不是在鉻becoz鉻具有MP4視頻轉換 –