视频样式转关键帧图片过程增加返回参数验证。

This commit is contained in:
zhangwei
2018-10-25 17:29:49 +08:00
parent 77446728ea
commit f2d013ec70
2 changed files with 71 additions and 45 deletions

View File

@@ -47,47 +47,50 @@ $(function(){
});
$("#srcFile").on('change',function(){
sampleFileValidate(fileType,$("#srcFile").val());
$("#srcFileInfo").val($("#srcFile").val());
var videoToPicture = $("#videoToPicture").val();
if(videoToPicture=="true"){
var fd = new FormData($('#cfgFrom')[0]);
$.ajax({
url: "${ctx}/ntc/av/sample/videoToPicture",
type: "POST",
processData: false,
contentType: false,
data: fd,
async: true,
cache: false,
beforeSend: function(){
loading('onloading...');
},
success: function(data) {
top.$.jBox.closeTip();
if(data.status==1){
$("#picPath").val(data.picFilePath);
$("#showPicture").removeClass("hidden");
var url = "${ctx}/ntc/av/sample/selectVedioPicture?picFilePath="+encodeURIComponent(data.picFilePath);
$.jBox("iframe:"+url, {
title: "",
width: 1350,
height:800,
dragLimit: true,
buttons: { 'close': true,"ok":"ok" }
});
}else{
alert(data.msg);
}
},
error:function(jqXHR, textStatus, errorThrown){
top.$.jBox.closeTip();
alert(errorThrown);
return false;
}
});
if(sampleFileValidate(fileType,$("#srcFile").val())){
//样例文件类型正确进行后续处理
$("#srcFileInfo").val($("#srcFile").val());
var videoToPicture = $("#videoToPicture").val();
if(videoToPicture=="true"){
var fd = new FormData($('#cfgFrom')[0]);
$.ajax({
url: "${ctx}/ntc/av/sample/videoToPicture",
type: "POST",
processData: false,
contentType: false,
data: fd,
async: true,
cache: false,
beforeSend: function(){
loading('onloading...');
},
success: function(data) {
top.$.jBox.closeTip();
if(data.status==1){
$("#picPath").val(data.picFilePath);
$("#showPicture").removeClass("hidden");
var url = "${ctx}/ntc/av/sample/selectVedioPicture?picFilePath="+encodeURIComponent(data.picFilePath);
$.jBox("iframe:"+url, {
title: "",
top: '1%',
draggable:false,
width: 1000,
height:500,
buttons: { 'close': true }
});
}else{
alert(data.msg);
}
},
error:function(jqXHR, textStatus, errorThrown){
top.$.jBox.closeTip();
alert(errorThrown);
return false;
}
});
}
}
});
/* $("#uploadSample,#sampleFileInfo").on('click',function(){