Authored by mali

转码

... ... @@ -82,4 +82,13 @@ public class UfoLiveController {
return new ApiResponse.ApiResponseBuilder().code(200).data(initCameraCode).message("查询成功").build();
}
@RequestMapping(value = "/queryCurrentTime")
public ApiResponse queryCurrentTime() {
LOGGER.info("queryCurrentTime method in.");
Integer currentTime = ufoLiveService.queryCurrentTime();
return new ApiResponse.ApiResponseBuilder().code(200).data(currentTime).message("获取时间成功").build();
}
}
... ...
... ... @@ -150,4 +150,8 @@ public class UfoLiveService implements ApplicationContextAware {
UserCameraRecord userCameraRecord = userCameraRecordMapper.selectUserCameraRecord(new UserHelper().getUserId());
return null == userCameraRecord ? null : userCameraRecord.getCameraCode();
}
public Integer queryCurrentTime() {
return DateUtil.getCurrentTimeSeconds();
}
}
... ...
... ... @@ -723,16 +723,41 @@ function addRecordPage(skup, order_code, id) {
return;
}
$('#startTime').val(parseInt(new Date().getTime() / 1000));
timedCount();
$('#recordBtn').linkbutton({text:'结束录制'});
$('#startTime').val(parseInt(new Date().getTime() / 1000));
//$("#startTime").textbox('setValue',parseInt(new Date().getTime() / 1000));
$.ajax({
contentType: "application/json",
dataType: "json",
type: "GET",
url: contextPath + '/live/queryCurrentTime',
success: function (data) {
if (data.code != 200) {
$('#startTime').val(parseInt(new Date().getTime() / 1000));
} else if (data.data){
$('#startTime').val(data.data);
}
}
});
} else if ($('#endTime').val() == '') {
$('#endTime').val(parseInt(new Date().getTime() / 1000));
stopCount();
// $("#endTime").textbox('setValue',parseInt(new Date().getTime() / 1000));
$('#recordBtn').linkbutton({text:'上传云端'});
$.ajax({
contentType: "application/json",
dataType: "json",
type: "GET",
url: contextPath + '/live/queryCurrentTime',
success: function (data) {
if (data.code != 200) {
$('#endTime').val(parseInt(new Date().getTime() / 1000));
} else if (data.data){
$('#endTime').val(data.data);
}
}
});
} else if ($('#startTime').val() != '' && $('#endTime').val() != ''){
$('#recordBtn').linkbutton('disable');
$.post(contextPath + "/live/generateMp4", {
... ...
... ... @@ -37,11 +37,10 @@
var totalVar;
function stopCount() {
var endTime = parseInt($('#endTime').val());
var startTime = parseInt($('#startTime').val());
var secondVar = parseInt((endTime - startTime) % 60);
if (endTime - startTime > 60) {
var minuteVar = parseInt((endTime - startTime) / 60);
var totalTime = parseInt($('#txt').val());
var secondVar = parseInt(totalTime % 60);
if (totalTime > 60) {
var minuteVar = parseInt(totalTime / 60);
totalVar = minuteVar + '分' + secondVar + '秒';
} else {
totalVar = secondVar + '秒';
... ...